Interface Connection
- All Superinterfaces:
AutoCloseable,Closeable
- All Known Implementing Classes:
AbstractConnection,HttpConnection,HttpConnectionOverHTTP,NegotiatingClientConnection,NegotiatingServerConnection,SslConnection
A Connection is associated to an EndPoint so that I/O events
happening on the EndPoint can be processed by the Connection.
A typical implementation of Connection overrides onOpen() to
set read interest on the EndPoint,
and when the EndPoint signals read readyness, this Connection can
read bytes from the network and interpret them.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceDeprecated.The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.static interfaceDeprecated.The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.static interfaceDeprecated.The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(Connection.Listener listener) Deprecated.Adds a listener of connection events.voidclose()Deprecated.Performs a logical close of this connection.longDeprecated.longDeprecated.longDeprecated.Deprecated.longDeprecated.longDeprecated.voidonClose()Deprecated.Callback method invoked when this connection is closed.booleanDeprecated.Callback method invoked upon an idle timeout event.voidonOpen()Deprecated.Callback method invoked when this connection is opened.voidremoveListener(Connection.Listener listener) Deprecated.Removes a listener of connection events.
-
Method Details
-
addListener
Deprecated.Adds a listener of connection events.
- Parameters:
listener- the listener to add
-
removeListener
Deprecated.Removes a listener of connection events.
- Parameters:
listener- the listener to remove
-
onOpen
void onOpen()Deprecated.Callback method invoked when this connection is opened.
Creators of the connection implementation are responsible for calling this method.
-
onClose
void onClose()Deprecated.Callback method invoked when this connection is closed.
Creators of the connection implementation are responsible for calling this method.
-
getEndPoint
EndPoint getEndPoint()Deprecated.- Returns:
- the
EndPointassociated with this Connection.
-
close
void close()Deprecated.Performs a logical close of this connection.
For simple connections, this may just mean to delegate the close to the associated
EndPointbut, for example, SSL connections should write the SSL close message before closing the associatedEndPoint.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
onIdleExpired
boolean onIdleExpired()Deprecated.Callback method invoked upon an idle timeout event.
Implementations of this method may return true to indicate that the idle timeout handling should proceed normally, typically failing the EndPoint and causing it to be closed.
When false is returned, the handling of the idle timeout event is halted immediately and the EndPoint left in the state it was before the idle timeout event.
- Returns:
- true to let the EndPoint handle the idle timeout, false to tell the EndPoint to halt the handling of the idle timeout.
-
getMessagesIn
long getMessagesIn()Deprecated. -
getMessagesOut
long getMessagesOut()Deprecated. -
getBytesIn
long getBytesIn()Deprecated. -
getBytesOut
long getBytesOut()Deprecated. -
getCreatedTimeStamp
long getCreatedTimeStamp()Deprecated.
-