Class DetectorConnectionFactory.DetectorConnection
java.lang.Object
org.eclipse.jetty.io.AbstractConnection
org.eclipse.jetty.server.DetectorConnectionFactory.DetectorConnection
- All Implemented Interfaces:
Closeable, AutoCloseable, Connection, Connection.UpgradeFrom, Connection.UpgradeTo
- Enclosing class:
DetectorConnectionFactory
private class DetectorConnectionFactory.DetectorConnection
extends AbstractConnection
implements Connection.UpgradeFrom, Connection.UpgradeTo
-
Nested Class Summary
Nested classes/interfaces inherited from interface Connection
Connection.Listener, Connection.UpgradeFrom, Connection.UpgradeTo -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate booleanvoidCallback method invoked when the endpoint is ready to be read.voidonOpen()Callback method invoked when this connection is opened.Invoked during anupgradeto produce a buffer containing bytes that have not been consumed by this connection, and that must be consumed by the upgrade-to connection.voidonUpgradeTo(ByteBuffer buffer) Invoked during anupgradeto receive a buffer containing bytes that have not been consumed by the upgrade-from connection, and that must be consumed by this connection.private voidMethods inherited from class AbstractConnection
addListener, close, failedCallback, fillInterested, getBytesIn, getBytesOut, getCreatedTimeStamp, getEndPoint, getExecutor, getInputBufferSize, getMessagesIn, getMessagesOut, isFillInterested, onClose, onFillInterestedFailed, onIdleExpired, onReadTimeout, removeListener, setInputBufferSize, toConnectionString, toString, tryFillInterested, tryFillInterested
-
Field Details
-
_connector
-
_buffer
-
-
Constructor Details
-
DetectorConnection
-
-
Method Details
-
onUpgradeTo
Description copied from interface:Connection.UpgradeToInvoked during an
upgradeto receive a buffer containing bytes that have not been consumed by the upgrade-from connection, and that must be consumed by this connection.- Specified by:
onUpgradeToin interfaceConnection.UpgradeTo- Parameters:
buffer- a non-null buffer of unconsumed bytes received from the upgrade-from connection. The buffer does not belong to any pool and should be discarded after having consumed its bytes.
-
onUpgradeFrom
Description copied from interface:Connection.UpgradeFromInvoked during an
upgradeto produce a buffer containing bytes that have not been consumed by this connection, and that must be consumed by the upgrade-to connection.- Specified by:
onUpgradeFromin interfaceConnection.UpgradeFrom- Returns:
- a buffer of unconsumed bytes to pass to the upgrade-to connection. The buffer does not belong to any pool and should be discarded after having consumed its bytes. The returned buffer may be null if there are no unconsumed bytes.
-
onOpen
public void onOpen()Description copied from interface:ConnectionCallback method invoked when this connection is opened.
Creators of the connection implementation are responsible for calling this method.
- Specified by:
onOpenin interfaceConnection- Overrides:
onOpenin classAbstractConnection
-
onFillable
public void onFillable()Description copied from class:AbstractConnectionCallback method invoked when the endpoint is ready to be read.
- Specified by:
onFillablein classAbstractConnection- See Also:
-
detectAndUpgrade
private boolean detectAndUpgrade()- Returns:
- true when upgrade was performed, false otherwise.
-
releaseAndClose
private void releaseAndClose()
-