Top Description Fields Methods
org.glassfish.tyrus.spi

public Interface ClientContainer

Imports
java.io.IOException, java.util.Map, jakarta.websocket.ClientEndpointConfig, .DeploymentException

Entry point for client implementation.
Author
Pavel Bucek

Field Summary

Modifier and TypeField and Description
public static final String
INCOMING_BUFFER_SIZE

Deprecated please use org.glassfish.tyrus.client.ClientProperties#INCOMING_BUFFER_SIZE.
Property name for maximal incoming buffer size.
public static final String

Method Summary

Modifier and TypeMethod and Description
public void
openClientSocket(ClientEndpointConfig
endpoint configuration. SPI consumer can access user properties, jakarta.websocket.ClientEndpointConfig.Configurator, extensions and subprotocol configuration, etc..
cec
,
Map<String, Object>
properties passed from client container. Don't mix up this with jakarta.websocket.ClientEndpointConfig#getUserProperties(), these are Tyrus proprietary.
properties
,
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).
clientEngine
)

Open client socket - connect to endpoint specified with url parameter.

Field Detail

INCOMING_BUFFER_SIZEback to summary
public static final String INCOMING_BUFFER_SIZE

Deprecated

please use org.glassfish.tyrus.client.ClientProperties#INCOMING_BUFFER_SIZE.

Property name for maximal incoming buffer size.

Can be set in properties map (see openClientSocket(jakarta.websocket.ClientEndpointConfig, java.util.Map, ClientEngine)).

WLS_INCOMING_BUFFER_SIZEback to summary
public static final String WLS_INCOMING_BUFFER_SIZE

WLS version of org.glassfish.tyrus.spi.ClientContainer#INCOMING_BUFFER_SIZE.

Method Detail

openClientSocketback to summary
public void openClientSocket(ClientEndpointConfig cec, Map<String, Object> properties, ClientEngine clientEngine) throws DeploymentException, IOException

Open client socket - connect to endpoint specified with url parameter.

Called from ClientManager when jakarta.websocket.WebSocketContainer#connectToServer(Class, jakarta.websocket.ClientEndpointConfig, java.net.URI) is invoked.

Parameters
cec:ClientEndpointConfig

endpoint configuration. SPI consumer can access user properties, jakarta.websocket.ClientEndpointConfig.Configurator, extensions and subprotocol configuration, etc..

properties:Map<String, Object>

properties passed from client container. Don't mix up this with jakarta.websocket.ClientEndpointConfig#getUserProperties(), these are Tyrus proprietary.

clientEngine: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).

Exceptions
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.