Package org.glassfish.tyrus.client
Class TyrusClientEngine
java.lang.Object
org.glassfish.tyrus.client.TyrusClientEngine
- All Implemented Interfaces:
ClientEngine
Tyrus
ClientEngine
implementation.- Author:
- Pavel Bucek
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Called when response is received from the server.Nested classes/interfaces inherited from interface org.glassfish.tyrus.spi.ClientEngine
ClientEngine.ClientUpgradeInfo, ClientEngine.ClientUpgradeStatus, ClientEngine.TimeoutHandler
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Default incoming buffer size for client container. -
Method Summary
Modifier and TypeMethodDescriptioncreateUpgradeRequest
(ClientEngine.TimeoutHandler timeoutHandler) Create upgrade request and registerClientEngine.TimeoutHandler
.GetClientEngine.TimeoutHandler
associated with currentClientEngine
instance.void
Process error.processResponse
(UpgradeResponse upgradeResponse, Writer writer, Connection.CloseListener closeListener) Process handshake and returnClientEngine.ClientUpgradeInfo
with handshake status (ClientEngine.ClientUpgradeStatus
).
-
Field Details
-
DEFAULT_INCOMING_BUFFER_SIZE
public static final int DEFAULT_INCOMING_BUFFER_SIZEDefault incoming buffer size for client container.- See Also:
-
-
Method Details
-
createUpgradeRequest
Description copied from interface:ClientEngine
Create upgrade request and registerClientEngine.TimeoutHandler
.- Specified by:
createUpgradeRequest
in interfaceClientEngine
- Parameters:
timeoutHandler
- handshake timeout handler.ClientEngine.TimeoutHandler.handleTimeout()
is invoked ifClientEngine.processResponse(UpgradeResponse, Writer, Connection.CloseListener)
is not called within handshake timeout.- Returns:
- request to be send on the wire or
null
, when the request cannot be created. Whennull
is returned, client should free all resources tied to current connection.
-
processResponse
public ClientEngine.ClientUpgradeInfo processResponse(UpgradeResponse upgradeResponse, Writer writer, Connection.CloseListener closeListener) Description copied from interface:ClientEngine
Process handshake and returnClientEngine.ClientUpgradeInfo
with handshake status (ClientEngine.ClientUpgradeStatus
).- Specified by:
processResponse
in interfaceClientEngine
- Parameters:
upgradeResponse
- response to be processed.writer
- used for sending dataframes from client endpoint.closeListener
- will be called when connection is closed, will be set as listener of returnedConnection
.- Returns:
- info with upgrade status.
- See Also:
-
processError
Description copied from interface:ClientEngine
Process error.This method can be called any time when client encounters an error which cannot be handled in the container before
ClientEngine.ClientUpgradeStatus.SUCCESS
is returned fromClientEngine.processResponse(UpgradeResponse, Writer, Connection.CloseListener)
.- Specified by:
processError
in interfaceClientEngine
- Parameters:
t
- encountered error.- See Also:
-
getTimeoutHandler
GetClientEngine.TimeoutHandler
associated with currentClientEngine
instance.- Returns:
- timeout handler instance or
null
when not present.
-