Package org.glassfish.tyrus.spi
Interface ClientEngine
- All Known Implementing Classes:
TyrusClientEngine
public interface ClientEngine
Facade for handling client operations from containers.
- Author:
- Pavel Bucek, Ondrej Kosatka
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceUpgrade process result.static enumStatus of upgrade process.static interfaceIndicates to container that handshake timeout was reached. -
Method Summary
Modifier and TypeMethodDescriptioncreateUpgradeRequest(ClientEngine.TimeoutHandler timeoutHandler) Create upgrade request and registerClientEngine.TimeoutHandler.voidProcess error.processResponse(UpgradeResponse upgradeResponse, Writer writer, Connection.CloseListener closeListener) Process handshake and returnClientEngine.ClientUpgradeInfowith handshake status (ClientEngine.ClientUpgradeStatus).
-
Method Details
-
createUpgradeRequest
Create upgrade request and registerClientEngine.TimeoutHandler.- Parameters:
timeoutHandler- handshake timeout handler.ClientEngine.TimeoutHandler.handleTimeout()is invoked ifprocessResponse(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. Whennullis returned, client should free all resources tied to current connection.
-
processResponse
ClientEngine.ClientUpgradeInfo processResponse(UpgradeResponse upgradeResponse, Writer writer, Connection.CloseListener closeListener) Process handshake and returnClientEngine.ClientUpgradeInfowith handshake status (ClientEngine.ClientUpgradeStatus).- 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
Process error.This method can be called any time when client encounters an error which cannot be handled in the container before
ClientEngine.ClientUpgradeStatus.SUCCESSis returned fromprocessResponse(UpgradeResponse, Writer, Connection.CloseListener).- Parameters:
t- encountered error.- See Also:
-