public class InMemoryClientContainer extends Object implements ClientContainer
ClientContainer
implementation.Modifier and Type | Field and Description |
---|---|
static String |
SERVER_CONFIG
Property used to define server config used for in-memory container.
|
INCOMING_BUFFER_SIZE, WLS_INCOMING_BUFFER_SIZE
Constructor and Description |
---|
InMemoryClientContainer() |
Modifier and Type | Method and Description |
---|---|
void |
openClientSocket(javax.websocket.ClientEndpointConfig cec,
Map<String,Object> properties,
ClientEngine clientEngine)
Open client socket - connect to endpoint specified with
url parameter. |
public static final String SERVER_CONFIG
ServerApplicationConfig
and is provided as user
parameter in ClientEndpointConfig
.public void openClientSocket(javax.websocket.ClientEndpointConfig cec, Map<String,Object> properties, ClientEngine clientEngine) throws javax.websocket.DeploymentException, IOException
ClientContainer
url
parameter.
Called from ClientManager when WebSocketContainer.connectToServer(Class,
javax.websocket.ClientEndpointConfig, java.net.URI)
is invoked.openClientSocket
in interface ClientContainer
cec
- endpoint configuration. SPI consumer can access user properties, ClientEndpointConfig.Configurator
, extensions and subprotocol
configuration,
etc..properties
- properties passed from client container. Don't mix up this with EndpointConfig.getUserProperties()
, these are Tyrus proprietary.clientEngine
- one instance equals to one connection, cannot be reused. Implementation is expected to call
ClientEngine.createUpgradeRequest(ClientEngine.TimeoutHandler)
and ClientEngine.processResponse(UpgradeResponse, Writer,
org.glassfish.tyrus.spi.Connection.CloseListener)
(in that order).javax.websocket.DeploymentException
- when the client endpoint is invalid or when there is any other (not
specified) connection problem.IOException
- when there is any I/O issue related to opening client socket or
connecting to remote endpoint.Copyright © 2012-2015, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.