ContainerProvider (WebSocket 2.1 API Documentation - Apache Tomcat 10.1.57)
Description: declaration: package: jakarta.websocket, class: ContainerProvider

# Class ContainerProvider

java.lang.Object
jakarta.websocket.ContainerProvider

public abstract class ContainerProvider extends Object
Use the `ServiceLoader` mechanism to provide instances of the WebSocket client container.

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `ContainerProvider()`
  Creates a new ContainerProvider instance.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected abstract WebSocketContainer`
  `getContainer()`
  Returns the WebSocket container provided by this provider.
  `static WebSocketContainer`
  `getWebSocketContainer()`
  Create a new container used to create outgoing WebSocket connections.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### ContainerProvider

    protected ContainerProvider()
    Creates a new ContainerProvider instance.

- ## Method Details

  - ### getWebSocketContainer

    public static WebSocketContainer getWebSocketContainer()
    Create a new container used to create outgoing WebSocket connections.
    Returns:
      A newly created container.

  - ### getContainer

    protected abstract WebSocketContainer getContainer()
    Returns the WebSocket container provided by this provider.
    Returns:
      The WebSocket container