Class JavaxWebSocketClientContainer

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

@ManagedObject("JSR356 Client Container") public class JavaxWebSocketClientContainer extends JavaxWebSocketContainer implements javax.websocket.WebSocketContainer
Container for Client use of the javax.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

    • JavaxWebSocketClientContainer

      public JavaxWebSocketClientContainer()
    • JavaxWebSocketClientContainer

      public JavaxWebSocketClientContainer(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
    • JavaxWebSocketClientContainer

      public JavaxWebSocketClientContainer(WebSocketComponents components)
    • JavaxWebSocketClientContainer

      public JavaxWebSocketClientContainer(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 javax.websocket.Session connectToServer(Class<? extends javax.websocket.Endpoint> endpointClass, javax.websocket.ClientEndpointConfig providedConfig, URI path) throws javax.websocket.DeploymentException, IOException
      Specified by:
      connectToServer in interface javax.websocket.WebSocketContainer
      Throws:
      javax.websocket.DeploymentException
      IOException
    • connectToServer

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

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

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

      public JavaxWebSocketFrameHandlerFactory getFrameHandlerFactory()
      Specified by:
      getFrameHandlerFactory in class JavaxWebSocketContainer
    • getExecutor

      public Executor getExecutor()
      Specified by:
      getExecutor in class JavaxWebSocketContainer
    • 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()