public interface WebSocketContainer
A WebSocketContainer may be accessed by concurrent threads, so implementations must ensure the integrity of its mutable attributes in such circumstances.
Modifier and Type | Method and Description |
---|---|
Session |
connectToServer(Class<?> annotatedEndpointClass,
URI path)
Connect the supplied annotated endpoint to its server.
|
Session |
connectToServer(Class<? extends Endpoint> endpointClass,
ClientEndpointConfig cec,
URI path)
Connect the supplied programmatic endpoint to its server with the given
configuration.
|
Session |
connectToServer(Endpoint endpointInstance,
ClientEndpointConfig cec,
URI path)
Connect the supplied programmatic client endpoint instance to its server
with the given configuration.
|
Session |
connectToServer(Object annotatedEndpointInstance,
URI path)
Connect the supplied annotated endpoint instance to its server.
|
long |
getDefaultAsyncSendTimeout()
Return the number of milliseconds the implementation will timeout
attempting to send a websocket message for all RemoteEndpoints associated
with this container.
|
int |
getDefaultMaxBinaryMessageBufferSize()
Returns the default maximum size of incoming binary message that this container
will buffer.
|
long |
getDefaultMaxSessionIdleTimeout()
Return the default time in milliseconds after which any web socket sessions in this
container will be closed if it has been inactive.
|
int |
getDefaultMaxTextMessageBufferSize()
Returns the default maximum size of incoming text message that this container
will buffer.
|
Set<Extension> |
getInstalledExtensions()
Return the set of Extensions installed in the container.
|
void |
setAsyncSendTimeout(long timeoutmillis)
Sets the number of milliseconds the implementation will timeout
attempting to send a websocket message for all RemoteEndpoints associated
with this container.
|
void |
setDefaultMaxBinaryMessageBufferSize(int max)
Sets the default maximum size of incoming binary message that this container
will buffer.
|
void |
setDefaultMaxSessionIdleTimeout(long timeout)
Sets the default time in milliseconds after which any web socket sessions in this
container will be closed if it has been inactive.
|
void |
setDefaultMaxTextMessageBufferSize(int max)
Sets the maximum size of incoming text message that this container
will buffer.
|
long getDefaultAsyncSendTimeout()
void setAsyncSendTimeout(long timeoutmillis)
Session connectToServer(Object annotatedEndpointInstance, URI path) throws DeploymentException, IOException
ServerEndpoint
annotation. This method
blocks until the connection is established, or throws an error if either
the connection could not be made or there was a problem with the supplied
endpoint class. If the developer uses this method to deploy the client
endpoint, services like dependency injection that are supported, for
example, when the implementation is part of the Java EE platform
may not be available. If the client endpoint uses dependency injection,
use connectToServer(java.lang.Class, java.net.URI)
instead.annotatedEndpointInstance
- the annotated websocket client endpoint
instance.path
- the complete path to the server endpoint.DeploymentException
- if the annotated endpoint instance is not valid.IOException
- if there was a network or protocol problem that
prevented the client endpoint being connected to its server.IllegalStateException
- if called during the deployment phase
of the containing application.Session connectToServer(Class<?> annotatedEndpointClass, URI path) throws DeploymentException, IOException
ServerEndpoint
annotation. This method blocks until the connection
is established, or throws an error if either the connection could not be made or there
was a problem with the supplied endpoint class.annotatedEndpointClass
- the annotated websocket client endpoint.path
- the complete path to the server endpoint.DeploymentException
- if the class is not a valid annotated endpoint class.IOException
- if there was a network or protocol problem that
prevented the client endpoint being connected to its server.IllegalStateException
- if called during the deployment phase
of the containing application.Session connectToServer(Endpoint endpointInstance, ClientEndpointConfig cec, URI path) throws DeploymentException, IOException
connectToServer(java.lang.Class, javax.websocket.ClientEndpointConfig, java.net.URI)
instead.endpointInstance
- the programmatic client endpoint instance Endpoint
.path
- the complete path to the server endpoint.cec
- the configuration used to configure the programmatic endpoint.DeploymentException
- if the configuration is not validIOException
- if there was a network or protocol problem that
prevented the client endpoint being connected to its serverIllegalStateException
- if called during the deployment phase
of the containing application.Session connectToServer(Class<? extends Endpoint> endpointClass, ClientEndpointConfig cec, URI path) throws DeploymentException, IOException
endpointClass
- the programmatic client endpoint class Endpoint
.path
- the complete path to the server endpoint.cec
- the configuration used to configure the programmatic endpoint.DeploymentException
- if the configuration is not validIOException
- if there was a network or protocol problem that prevented the client endpoint being connected to its serverIllegalStateException
- if called during the deployment phase
of the containing application.long getDefaultMaxSessionIdleTimeout()
Session.setMaxIdleTimeout(long)
void setDefaultMaxSessionIdleTimeout(long timeout)
Session.setMaxIdleTimeout(long)
timeout
- the maximum time in milliseconds.int getDefaultMaxBinaryMessageBufferSize()
Session.setMaxBinaryMessageBufferSize(int)
void setDefaultMaxBinaryMessageBufferSize(int max)
max
- the maximum size of binary message in number of bytes.int getDefaultMaxTextMessageBufferSize()
Session.setMaxTextMessageBufferSize(int)
void setDefaultMaxTextMessageBufferSize(int max)
max
- the maximum size of text message in number of bytes.Copyright © 1996-2017, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.