Package org.glassfish.tyrus.spi
Interface Connection
-
public interface Connection
A logical websocket connection. Tyrus creates this connection after successful upgrade and gets data fromReadHandler
and writes data toWriter
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
Connection.CloseListener
Transport close listener that receives connection close notifications from Tyrus.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
close(CloseReason reason)
Notifies tyrus that underlying transport is closing the connection.Connection.CloseListener
getCloseListener()
Returns the same close listener that is passed for creating connection inWebSocketEngine.UpgradeInfo.createConnection(Writer, CloseListener)
.ReadHandler
getReadHandler()
Returns a read handler.Writer
getWriter()
Returns the same writer that is passed for creating connection inWebSocketEngine.UpgradeInfo.createConnection(Writer, CloseListener)
The transport writer that actually writes websocket data to underlying connection.
-
-
-
Method Detail
-
getReadHandler
ReadHandler getReadHandler()
Returns a read handler. A transport can pass websocket data to tyrus using the handler.- Returns:
- tryus read handler that handles websocket data.
-
getWriter
Writer getWriter()
Returns the same writer that is passed for creating connection inWebSocketEngine.UpgradeInfo.createConnection(Writer, CloseListener)
The transport writer that actually writes websocket data to underlying connection.- Returns:
- transport writer that actually writes websocket data to underlying connection.
-
getCloseListener
Connection.CloseListener getCloseListener()
Returns the same close listener that is passed for creating connection inWebSocketEngine.UpgradeInfo.createConnection(Writer, CloseListener)
.This transport close listener receives connection close notifications from Tyrus.
- Returns:
- close listener provided when the connection is created.
-
close
void close(CloseReason reason)
Notifies tyrus that underlying transport is closing the connection.- Parameters:
reason
- for closing the actual connection.
-
-