Class JakartaWebSocketClientContainerProvider

java.lang.Object
jakarta.websocket.ContainerProvider
org.eclipse.jetty.websocket.jakarta.client.JakartaWebSocketClientContainerProvider

public class JakartaWebSocketClientContainerProvider extends jakarta.websocket.ContainerProvider
Client ContainerProvider implementation.

Created by a ServiceLoader call in the ContainerProvider.getWebSocketContainer() call.

  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected jakarta.websocket.WebSocketContainer
    Used by ContainerProvider.getWebSocketContainer() to get a NEW INSTANCE of the Client WebSocketContainer.
    static jakarta.websocket.WebSocketContainer
    Get a new instance of a client WebSocketContainer which uses a supplied HttpClient.
    static void
    stop(jakarta.websocket.WebSocketContainer container)
     

    Methods inherited from class jakarta.websocket.ContainerProvider

    getWebSocketContainer

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • JakartaWebSocketClientContainerProvider

      public JakartaWebSocketClientContainerProvider()
  • Method Details

    • stop

      public static void stop(jakarta.websocket.WebSocketContainer container) throws Exception
      Throws:
      Exception
    • getContainer

      protected jakarta.websocket.WebSocketContainer getContainer()
      Used by ContainerProvider.getWebSocketContainer() to get a NEW INSTANCE of the Client WebSocketContainer.

      NOTE: A WebSocket Client Container is a heavyweight object. It is dangerous to repeatedly request a new container, or to manage many containers. The existing jakarta.websocket API has no lifecycle for a ClientContainer, once started they exist for the duration of the JVM with no ability to stop them. See/Comment on jakarta.websocket Issue #212 if this is a big concern for you.

      Specified by:
      getContainer in class jakarta.websocket.ContainerProvider
    • getContainer

      public static jakarta.websocket.WebSocketContainer getContainer(HttpClient httpClient)
      Get a new instance of a client WebSocketContainer which uses a supplied HttpClient.
      Parameters:
      httpClient - a pre-configured HttpClient to be used by the implementation.
      See Also: