public class ConnectHandler.DownstreamConnection extends ProxyConnection implements Connection.UpgradeTo
Connection.Listener, Connection.UpgradeFrom, Connection.UpgradeTo| Modifier and Type | Field and Description |
|---|---|
private java.nio.ByteBuffer |
buffer |
LOG| Constructor and Description |
|---|
DownstreamConnection(EndPoint endPoint,
java.util.concurrent.Executor executor,
ByteBufferPool bufferPool,
java.util.concurrent.ConcurrentMap<java.lang.String,java.lang.Object> context) |
| Modifier and Type | Method and Description |
|---|---|
void |
onOpen()
Callback method invoked when this connection is opened.
|
void |
onUpgradeTo(java.nio.ByteBuffer buffer)
Callback method invoked when this connection is upgraded.
|
protected int |
read(EndPoint endPoint,
java.nio.ByteBuffer buffer) |
protected void |
write(EndPoint endPoint,
java.nio.ByteBuffer buffer,
Callback callback) |
getByteBufferPool, getConnection, getContext, onFillable, setConnection, toConnectionStringaddListener, close, failedCallback, fillInterested, getBytesIn, getBytesOut, getCreatedTimeStamp, getEndPoint, getExecutor, getInputBufferSize, getMessagesIn, getMessagesOut, isFillInterested, onClose, onFillInterestedFailed, onIdleExpired, onReadTimeout, removeListener, setInputBufferSize, toString, tryFillInterested, tryFillInterestedpublic DownstreamConnection(EndPoint endPoint, java.util.concurrent.Executor executor, ByteBufferPool bufferPool, java.util.concurrent.ConcurrentMap<java.lang.String,java.lang.Object> context)
public void onUpgradeTo(java.nio.ByteBuffer buffer)
Connection.UpgradeToCallback method invoked when this connection is upgraded.
This must be called before Connection.onOpen().
onUpgradeTo in interface Connection.UpgradeTobuffer - An optional buffer that can contain prefilled data. Typically this
results from an upgrade of one protocol to the other where the old connection has buffered
data destined for the new connection. The new connection must take ownership of the buffer
and is responsible for returning it to the buffer poolpublic void onOpen()
ConnectionCallback method invoked when this connection is opened.
Creators of the connection implementation are responsible for calling this method.
onOpen in interface ConnectiononOpen in class AbstractConnectionprotected int read(EndPoint endPoint, java.nio.ByteBuffer buffer) throws java.io.IOException
read in class ProxyConnectionjava.io.IOExceptionprotected void write(EndPoint endPoint, java.nio.ByteBuffer buffer, Callback callback)
write in class ProxyConnection