Top Description Inners Methods
org.glassfish.tyrus.spi

public Interface Connection

Imports
jakarta.websocket.CloseReason

A logical websocket connection. Tyrus creates this connection after successful upgrade and gets data from ReadHandler and writes data to Writer.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
Connection.CloseListener

Transport close listener that receives connection close notifications from Tyrus.

Method Summary

Modifier and TypeMethod and Description
public void
close(CloseReason
for closing the actual connection.
reason
)

Notifies tyrus that underlying transport is closing the connection.

public Connection.CloseListener

Returns:

close listener provided when the connection is created.
getCloseListener
()

Returns the same close listener that is passed for creating connection in WebSocketEngine.UpgradeInfo#createConnection(Writer, CloseListener).

public ReadHandler

Returns:

tryus read handler that handles websocket data.
getReadHandler
()

Returns a read handler.

public Writer

Returns:

transport writer that actually writes websocket data to underlying connection.
getWriter
()

Returns the same writer that is passed for creating connection in WebSocketEngine.UpgradeInfo#createConnection(Writer, CloseListener) The transport writer that actually writes websocket data to underlying connection.

Method Detail

closeback to summary
public void close(CloseReason reason)

Notifies tyrus that underlying transport is closing the connection.

Parameters
reason:CloseReason

for closing the actual connection.

getCloseListenerback to summary
public Connection.CloseListener getCloseListener()

Returns the same close listener that is passed for creating connection in WebSocketEngine.UpgradeInfo#createConnection(Writer, CloseListener).

This transport close listener receives connection close notifications from Tyrus.

Returns:Connection.CloseListener

close listener provided when the connection is created.

getReadHandlerback to summary
public ReadHandler getReadHandler()

Returns a read handler. A transport can pass websocket data to tyrus using the handler.

Returns:ReadHandler

tryus read handler that handles websocket data.

getWriterback to summary
public Writer getWriter()

Returns the same writer that is passed for creating connection in WebSocketEngine.UpgradeInfo#createConnection(Writer, CloseListener) The transport writer that actually writes websocket data to underlying connection.

Returns:Writer

transport writer that actually writes websocket data to underlying connection.

org.glassfish.tyrus.spi back to summary

public Interface Connection.CloseListener


Transport close listener that receives connection close notifications from Tyrus.

Method Summary

Modifier and TypeMethod and Description
public void
close(CloseReason
for closing the connection.
reason
)

Tyrus notifies that logical connection is closed.

Method Detail

closeback to summary
public void close(CloseReason reason)

Tyrus notifies that logical connection is closed.

Parameters
reason:CloseReason

for closing the connection.