Class JakartaWebSocketClientContainer

All Implemented Interfaces:
jakarta.websocket.WebSocketContainer, Container, Destroyable, Dumpable, Dumpable.DumpableContainer, LifeCycle
Direct Known Subclasses:
JakartaWebSocketServerContainer

@ManagedObject("JSR356 Client Container") public class JakartaWebSocketClientContainer extends JakartaWebSocketContainer implements jakarta.websocket.WebSocketContainer
Container for Client use of the jakarta.websocket API.

This should be specific to a JVM if run in a standalone mode. or specific to a WebAppContext if running on the Jetty server.

  • Field Details

  • Constructor Details

    • JakartaWebSocketClientContainer

      public JakartaWebSocketClientContainer()
    • JakartaWebSocketClientContainer

      public JakartaWebSocketClientContainer(HttpClient httpClient)
      Create a WebSocketContainer using the supplied HttpClient for environments where you want to configure SSL/TLS or Proxy behaviors.
      Parameters:
      httpClient - the HttpClient instance to use
    • JakartaWebSocketClientContainer

      public JakartaWebSocketClientContainer(WebSocketComponents components)
    • JakartaWebSocketClientContainer

      public JakartaWebSocketClientContainer(WebSocketComponents components, Function<WebSocketComponents,WebSocketCoreClient> coreClientFactory)
  • Method Details

    • setShutdownContainer

      public static void setShutdownContainer(ContainerLifeCycle container)
    • getHttpClient

      protected HttpClient getHttpClient()
    • getWebSocketCoreClient

      protected WebSocketCoreClient getWebSocketCoreClient()
    • convertCause

      public static Throwable convertCause(Throwable error)
    • connectToServer

      public jakarta.websocket.Session connectToServer(Class<? extends jakarta.websocket.Endpoint> endpointClass, jakarta.websocket.ClientEndpointConfig providedConfig, URI path) throws jakarta.websocket.DeploymentException, IOException
      Specified by:
      connectToServer in interface jakarta.websocket.WebSocketContainer
      Throws:
      jakarta.websocket.DeploymentException
      IOException
    • connectToServer

      public jakarta.websocket.Session connectToServer(Class<?> annotatedEndpointClass, URI path) throws jakarta.websocket.DeploymentException, IOException
      Specified by:
      connectToServer in interface jakarta.websocket.WebSocketContainer
      Throws:
      jakarta.websocket.DeploymentException
      IOException
    • connectToServer

      public jakarta.websocket.Session connectToServer(jakarta.websocket.Endpoint endpoint, jakarta.websocket.ClientEndpointConfig providedConfig, URI path) throws jakarta.websocket.DeploymentException, IOException
      Specified by:
      connectToServer in interface jakarta.websocket.WebSocketContainer
      Throws:
      jakarta.websocket.DeploymentException
      IOException
    • connectToServer

      public jakarta.websocket.Session connectToServer(Object endpoint, URI path) throws jakarta.websocket.DeploymentException, IOException
      Specified by:
      connectToServer in interface jakarta.websocket.WebSocketContainer
      Throws:
      jakarta.websocket.DeploymentException
      IOException
    • getFrameHandlerFactory

      public JakartaWebSocketFrameHandlerFactory getFrameHandlerFactory()
      Specified by:
      getFrameHandlerFactory in class JakartaWebSocketContainer
    • getExecutor

      public Executor getExecutor()
      Specified by:
      getExecutor in class JakartaWebSocketContainer
    • doStart

      protected void doStart() throws Exception
      Description copied from class: ContainerLifeCycle
      Starts the managed lifecycle beans in the order they were added.
      Overrides:
      doStart in class ContainerLifeCycle
      Throws:
      AbstractLifeCycle.StopException - If thrown, the lifecycle will immediately be stopped.
      Exception - If there was a problem starting. Will cause a transition to FAILED state
    • doStop

      protected void doStop() throws Exception
      Description copied from class: ContainerLifeCycle
      Stops the managed lifecycle beans in the reverse order they were added.
      Overrides:
      doStop in class ContainerLifeCycle
      Throws:
      Exception - If there was a problem stopping. Will cause a transition to FAILED state
    • doClientStart

      protected void doClientStart()
    • doClientStop

      protected void doClientStop()
    • getContextHandler

      public Object getContextHandler()