Class ServerListenerHandler


  • public abstract class ServerListenerHandler
    extends Object
    Handler interface for processing incoming event-stream-rpc connections and their lifetimes.
    • Constructor Detail

      • ServerListenerHandler

        public ServerListenerHandler()
    • Method Detail

      • onNewConnection

        protected abstract ServerConnectionHandler onNewConnection​(ServerConnection serverConnection,
                                                                   int errorCode)
        Invoked upon receiving a new connection, or if an error happened upon connection creation. If errorCode is non-zero, onConnectionShutdown() will never be invoked.
        Parameters:
        serverConnection - The new server connection to use for communications. Is non-null when errorCode is 0.
        errorCode - represents any error that occurred during connection establishment
        Returns:
        Return an instance of ServerConnectionHandler, for processing connection specific events.
      • onConnectionShutdown

        protected abstract void onConnectionShutdown​(ServerConnection serverConnection,
                                                     int errorCode)
        Invoked upon connection shutdown. serverConnection will never be null. This function is only invoked if onNewConnection() was invoked with a zero errorCode.
        Parameters:
        serverConnection - connection the shutdown occurred on.
        errorCode - shutdown reason. 0 means clean shutdown.