Interface ClientContainer


  • public interface ClientContainer
    Entry point for client implementation.
    Author:
    Pavel Bucek
    • Method Detail

      • openClientSocket

        void openClientSocket​(jakarta.websocket.ClientEndpointConfig cec,
                              java.util.Map<java.lang.String,​java.lang.Object> properties,
                              ClientEngine clientEngine)
                       throws jakarta.websocket.DeploymentException,
                              java.io.IOException
        Open client socket - connect to endpoint specified with url parameter.

        Called from ClientManager when WebSocketContainer.connectToServer(Class, jakarta.websocket.ClientEndpointConfig, java.net.URI) is invoked.

        Parameters:
        cec - endpoint configuration. SPI consumer can access user properties, ClientEndpointConfig.Configurator, extensions and subprotocol configuration, etc..
        properties - properties passed from client container. Don't mix up this with EndpointConfig.getUserProperties(), these are Tyrus proprietary.
        clientEngine - one instance equals to one connection, cannot be reused. Implementation is expected to call ClientEngine.createUpgradeRequest(ClientEngine.TimeoutHandler) and ClientEngine.processResponse(UpgradeResponse, Writer, org.glassfish.tyrus.spi.Connection.CloseListener) (in that order).
        Throws:
        jakarta.websocket.DeploymentException - when the client endpoint is invalid or when there is any other (not specified) connection problem.
        java.io.IOException - when there is any I/O issue related to opening client socket or connecting to remote endpoint.