javax.websocket

## Interface WebSocketContainer

All Known Subinterfaces:
  ServerContainer

    public interface WebSocketContainer

### Method Summary

Methods
`Session` `connectToServer(java.lang.Class<?> annotatedEndpointClass, java.net.URI path)`
`Session` `connectToServer(java.lang.Class<? extends Endpoint> endpoint, ClientEndpointConfig clientEndpointConfiguration, java.net.URI path)` Creates a new connection to the WebSocket.
`Session` `connectToServer(Endpoint endpoint, ClientEndpointConfig clientEndpointConfiguration, java.net.URI path)` Creates a new connection to the WebSocket.
`Session` `connectToServer(java.lang.Object endpoint, java.net.URI path)`
`long` `getDefaultAsyncSendTimeout()` Obtain the default timeout (in milliseconds) for sending a message asynchronously.
`int` `getDefaultMaxBinaryMessageBufferSize()` Get the default maximum buffer size (in bytes) for binary messages.
`long` `getDefaultMaxSessionIdleTimeout()` Get the current default session idle timeout in milliseconds.
`int` `getDefaultMaxTextMessageBufferSize()` Get the default maximum buffer size (in characters) for text messages.
`java.util.Set<Extension>` `getInstalledExtensions()` Get the set of extensions that are supported by this WebSocket implementation.
`void` `setAsyncSendTimeout(long timeout)` Set the default timeout (in milliseconds) for sending a message asynchronously.
`void` `setDefaultMaxBinaryMessageBufferSize(int max)` Set the default maximum buffer size (in bytes) for binary messages.
`void` `setDefaultMaxSessionIdleTimeout(long timeout)` Set the current default session idle timeout in milliseconds.
`void` `setDefaultMaxTextMessageBufferSize(int max)` Set the default maximum buffer size (in characters) for text messages.

### Method Detail

#### getDefaultAsyncSendTimeout

    long getDefaultAsyncSendTimeout()

Obtain the default timeout (in milliseconds) for sending a message asynchronously. A non-positive value means an infinite timeout.

#### setAsyncSendTimeout

    void setAsyncSendTimeout(long timeout)

Set the default timeout (in milliseconds) for sending a message asynchronously. A non-positive value means an infinite timeout.

#### connectToServer

    Session connectToServer(java.lang.Object endpoint,
                          java.net.URI path)
                            throws DeploymentException,
                                   java.io.IOException

Throws:
  `DeploymentException`
  `java.io.IOException`

#### connectToServer

    Session connectToServer(java.lang.Class<?> annotatedEndpointClass,
                          java.net.URI path)
                            throws DeploymentException,
                                   java.io.IOException

Throws:
  `DeploymentException`
  `java.io.IOException`

#### connectToServer

    Session connectToServer(Endpoint endpoint,
                          ClientEndpointConfig clientEndpointConfiguration,
                          java.net.URI path)
                            throws DeploymentException,
                                   java.io.IOException

Creates a new connection to the WebSocket.

Parameters:
  `endpoint` - The endpoint instance that will handle responses from the server
  `clientEndpointConfiguration` - Used to configure the new connection
  `path` - The full URL of the WebSocket endpoint to connect to
Returns:
  The WebSocket session for the connection
Throws:
  `DeploymentException` - If the connection can not be established
  `java.io.IOException`

#### connectToServer

    Session connectToServer(java.lang.Class<? extends Endpoint> endpoint,
                          ClientEndpointConfig clientEndpointConfiguration,
                          java.net.URI path)
                            throws DeploymentException,
                                   java.io.IOException

Creates a new connection to the WebSocket.

Parameters:
  `endpoint` - An instance of this class will be created to handle responses from the server
  `clientEndpointConfiguration` - Used to configure the new connection
  `path` - The full URL of the WebSocket endpoint to connect to
Returns:
  The WebSocket session for the connection
Throws:
  `DeploymentException` - If the connection can not be established
  `java.io.IOException`

#### getDefaultMaxSessionIdleTimeout

    long getDefaultMaxSessionIdleTimeout()

Get the current default session idle timeout in milliseconds. Zero or negative values indicate an infinite timeout.

#### setDefaultMaxSessionIdleTimeout

    void setDefaultMaxSessionIdleTimeout(long timeout)

Set the current default session idle timeout in milliseconds. Zero or negative values indicate an infinite timeout.

#### getDefaultMaxBinaryMessageBufferSize

    int getDefaultMaxBinaryMessageBufferSize()

Get the default maximum buffer size (in bytes) for binary messages.

#### setDefaultMaxBinaryMessageBufferSize

    void setDefaultMaxBinaryMessageBufferSize(int max)

Set the default maximum buffer size (in bytes) for binary messages.

#### getDefaultMaxTextMessageBufferSize

    int getDefaultMaxTextMessageBufferSize()

Get the default maximum buffer size (in characters) for text messages.

#### setDefaultMaxTextMessageBufferSize

    void setDefaultMaxTextMessageBufferSize(int max)

Set the default maximum buffer size (in characters) for text messages.

#### getInstalledExtensions

    java.util.Set<Extension> getInstalledExtensions()

Get the set of extensions that are supported by this WebSocket implementation.