All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.contek.invoker.commons.websocket.IWebSocketLiveKeeper Maven / Gradle / Ivy

There is a newer version: 3.8.0
Show newest version
package io.contek.invoker.commons.websocket;

import javax.annotation.concurrent.Immutable;
import javax.annotation.concurrent.ThreadSafe;

@ThreadSafe
public interface IWebSocketLiveKeeper extends IWebSocketListener {

  static IWebSocketLiveKeeper.NoOp noOp() {
    return IWebSocketLiveKeeper.NoOp.INSTANCE;
  }

  void onHeartbeat(WebSocketSession session) throws WebSocketSessionInactiveException;

  @Immutable
  final class NoOp implements IWebSocketLiveKeeper {

    private static final NoOp INSTANCE = new NoOp();

    @Override
    public void onHeartbeat(WebSocketSession session) throws WebSocketSessionInactiveException {}

    @Override
    public void onMessage(AnyWebSocketMessage message, WebSocketSession session) {}

    @Override
    public void afterDisconnect() {}

    private NoOp() {}
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy