Class JakartaWebSocketConnection

  • All Implemented Interfaces:
    AutoCloseable, Connection, StreamHandler

    public final class JakartaWebSocketConnection
    extends WebSocketConnection
    Generic WebSocket connection which is based on Jakarta WebSocket API.

    The connection is implemented from a server point of view, i.e. during stream restarts no "open" element is sent.

    Client implementations may use this class and pass their own message handler which restarts the stream.

    • Constructor Detail

      • JakartaWebSocketConnection

        public JakartaWebSocketConnection​(javax.websocket.Session session,
                                          ConnectionConfiguration connectionConfiguration,
                                          StreamHandler streamHandler,
                                          Consumer<Throwable> onException,
                                          CompletionStage<Void> closeFuture,
                                          javax.websocket.MessageHandler.Whole<StreamElement> messageHandler)
        Creates
        Parameters:
        session - The session.
        connectionConfiguration - The configuration.
        streamHandler - Handles inbound elements.
        onException - Handles exceptions.
        closeFuture - The close future, which is completed when the session is closed.
        messageHandler - Optional message handler; if null the default handling of this connection is used.