Package org.eclipse.jetty.proxy
Class ConnectHandler.DownstreamConnection
- java.lang.Object
-
- org.eclipse.jetty.io.AbstractConnection
-
- org.eclipse.jetty.proxy.ProxyConnection
-
- org.eclipse.jetty.proxy.ConnectHandler.DownstreamConnection
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,Connection,Connection.UpgradeTo
- Enclosing class:
- ConnectHandler
public class ConnectHandler.DownstreamConnection extends ProxyConnection implements Connection.UpgradeTo
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.io.Connection
Connection.Listener, Connection.UpgradeFrom, Connection.UpgradeTo
-
-
Field Summary
-
Fields inherited from class org.eclipse.jetty.proxy.ProxyConnection
LOG
-
-
Constructor Summary
Constructors Constructor Description DownstreamConnection(EndPoint endPoint, java.util.concurrent.Executor executor, ByteBufferPool bufferPool, java.util.concurrent.ConcurrentMap<java.lang.String,java.lang.Object> context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidonOpen()Callback method invoked when this connection is opened.voidonUpgradeTo(java.nio.ByteBuffer buffer)Callback method invoked when this connection is upgraded.protected intread(EndPoint endPoint, java.nio.ByteBuffer buffer)protected voidwrite(EndPoint endPoint, java.nio.ByteBuffer buffer, Callback callback)-
Methods inherited from class org.eclipse.jetty.proxy.ProxyConnection
getByteBufferPool, getConnection, getContext, onFillable, setConnection, toConnectionString
-
Methods inherited from class org.eclipse.jetty.io.AbstractConnection
addListener, close, failedCallback, fillInterested, getBytesIn, getBytesOut, getCreatedTimeStamp, getEndPoint, getExecutor, getInputBufferSize, getMessagesIn, getMessagesOut, isFillInterested, onClose, onFillInterestedFailed, onIdleExpired, onReadTimeout, removeListener, setInputBufferSize, toString, tryFillInterested, tryFillInterested
-
-
-
-
Constructor Detail
-
DownstreamConnection
public DownstreamConnection(EndPoint endPoint, java.util.concurrent.Executor executor, ByteBufferPool bufferPool, java.util.concurrent.ConcurrentMap<java.lang.String,java.lang.Object> context)
-
-
Method Detail
-
onUpgradeTo
public void onUpgradeTo(java.nio.ByteBuffer buffer)
Description copied from interface:Connection.UpgradeToCallback method invoked when this connection is upgraded.
This must be called before
Connection.onOpen().- Specified by:
onUpgradeToin interfaceConnection.UpgradeTo- Parameters:
buffer- 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 pool
-
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
-
read
protected int read(EndPoint endPoint, java.nio.ByteBuffer buffer) throws java.io.IOException
- Specified by:
readin classProxyConnection- Throws:
java.io.IOException
-
write
protected void write(EndPoint endPoint, java.nio.ByteBuffer buffer, Callback callback)
- Specified by:
writein classProxyConnection
-
-