public abstract class AbstractServerConnection extends ServerConnection
Modifier and Type | Class and Description |
---|---|
static class | AbstractServerConnection.ConduitState |
ServerConnection.CloseListener
Modifier and Type | Field and Description |
---|---|
protected ByteBufferPool | bufferPool |
protected org.xnio.StreamConnection | channel |
protected List<ServerConnection.CloseListener> | closeListeners |
protected io.undertow.server.AbstractServerConnection.CloseSetter | closeSetter |
protected HttpServerExchange | current |
protected PooledByteBuffer | extraBytes Any extra bytes that were read from the channel. |
protected org.xnio.conduits.StreamSinkConduit | originalSinkConduit |
protected org.xnio.conduits.StreamSourceConduit | originalSourceConduit |
protected HttpHandler | rootHandler |
protected org.xnio.OptionMap | undertowOptions |
Constructor and Description |
---|
AbstractServerConnection(org.xnio.StreamConnection channel, ByteBufferPool bufferPool, HttpHandler rootHandler, org.xnio.OptionMap undertowOptions, int bufferSize) |
Modifier and Type | Method and Description |
---|---|
void | addCloseListener(ServerConnection.CloseListener listener) Adds a close listener, than will be invoked with the connection is closed |
void | clearChannel() Resets the channel to its original state, effectively disabling all current conduit wrappers. |
void | close() |
org.xnio.Pool<ByteBuffer> | getBufferPool() |
int | getBufferSize() |
ByteBufferPool | getByteBufferPool() Get the buffer pool for this connection. |
org.xnio.StreamConnection | getChannel() Get the underlying channel. |
org.xnio.ChannelListener.Setter<ServerConnection> | getCloseSetter() |
PooledByteBuffer | getExtraBytes() |
org.xnio.XnioIoThread | getIoThread() |
SocketAddress | getLocalAddress() |
<A extends SocketAddress> | getLocalAddress(Class<A> type) |
<T> T | getOption(org.xnio.Option<T> option) |
org.xnio.conduits.StreamSinkConduit | getOriginalSinkConduit() |
org.xnio.conduits.StreamSourceConduit | getOriginalSourceConduit() |
SocketAddress | getPeerAddress() Returns the actual address of the remote connection. |
<A extends SocketAddress> | getPeerAddress(Class<A> type) Returns the actual address of the remote connection. |
HttpHandler | getRootHandler() Get the root HTTP handler for this connection. |
protected org.xnio.conduits.ConduitStreamSinkChannel | getSinkChannel() |
protected org.xnio.conduits.ConduitStreamSourceChannel | getSourceChannel() |
org.xnio.OptionMap | getUndertowOptions() |
org.xnio.XnioWorker | getWorker() |
boolean | isOpen() |
protected void | maxEntitySizeUpdated(HttpServerExchange exchange) Callback that is invoked if the max entity size is updated. |
AbstractServerConnection.ConduitState | resetChannel() Resets the channel to its original state, effectively disabling all current conduit wrappers. |
void | restoreChannel(AbstractServerConnection.ConduitState state) Restores the channel conduits to a previous state. |
void | setExtraBytes(PooledByteBuffer extraBytes) |
<T> T | setOption(org.xnio.Option<T> option, T value) |
protected void | setUpgradeListener(HttpUpgradeListener upgradeListener) |
protected static org.xnio.conduits.StreamSinkConduit | sink(AbstractServerConnection.ConduitState state) |
protected static org.xnio.conduits.StreamSourceConduit | source(AbstractServerConnection.ConduitState state) |
boolean | supportsOption(org.xnio.Option<?> option) |
exchangeComplete, getSinkConduit, getSslSession, getSslSessionInfo, getTransportProtocol, isConnectSupported, isContinueResponseSupported, isPushSupported, isRequestTrailerFieldsSupported, isUpgradeSupported, pushResource, pushResource, sendOutOfBandResponse, setConnectListener, setSslSessionInfo, terminateRequestChannel, upgradeChannel
addToAttachmentList, createAttachmentMap, getAttachment, getAttachmentList, putAttachment, removeAttachment
protected final org.xnio.StreamConnection channel
protected final io.undertow.server.AbstractServerConnection.CloseSetter closeSetter
protected final ByteBufferPool bufferPool
protected final HttpHandler rootHandler
protected final org.xnio.OptionMap undertowOptions
protected final org.xnio.conduits.StreamSourceConduit originalSourceConduit
protected final org.xnio.conduits.StreamSinkConduit originalSinkConduit
protected final List<ServerConnection.CloseListener> closeListeners
protected HttpServerExchange current
protected PooledByteBuffer extraBytes
public AbstractServerConnection(org.xnio.StreamConnection channel, ByteBufferPool bufferPool, HttpHandler rootHandler, org.xnio.OptionMap undertowOptions, int bufferSize)
public org.xnio.Pool<ByteBuffer> getBufferPool()
getBufferPool
in class ServerConnection
public HttpHandler getRootHandler()
public ByteBufferPool getByteBufferPool()
getByteBufferPool
in class ServerConnection
public org.xnio.StreamConnection getChannel()
public org.xnio.ChannelListener.Setter<ServerConnection> getCloseSetter()
public org.xnio.XnioWorker getWorker()
getWorker
in interface org.xnio.channels.CloseableChannel
getWorker
in class ServerConnection
public org.xnio.XnioIoThread getIoThread()
getIoThread
in interface org.xnio.channels.CloseableChannel
getIoThread
in class ServerConnection
public boolean isOpen()
isOpen
in interface Channel
isOpen
in class ServerConnection
public boolean supportsOption(org.xnio.Option<?> option)
supportsOption
in interface org.xnio.channels.Configurable
supportsOption
in class ServerConnection
public <T> T getOption(org.xnio.Option<T> option) throws IOException
getOption
in interface org.xnio.channels.Configurable
getOption
in class ServerConnection
IOException
public <T> T setOption(org.xnio.Option<T> option, T value) throws IllegalArgumentException, IOException
setOption
in interface org.xnio.channels.Configurable
setOption
in class ServerConnection
IllegalArgumentException
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in interface Channel
close
in interface InterruptibleChannel
close
in interface org.xnio.channels.CloseableChannel
close
in class ServerConnection
IOException
public SocketAddress getPeerAddress()
ServerConnection
getPeerAddress
in interface org.xnio.channels.ConnectedChannel
getPeerAddress
in class ServerConnection
public <A extends SocketAddress> A getPeerAddress(Class<A> type)
ServerConnection
getPeerAddress
in interface org.xnio.channels.ConnectedChannel
getPeerAddress
in class ServerConnection
A
- The address typetype
- The type of address to returnpublic SocketAddress getLocalAddress()
getLocalAddress
in interface org.xnio.channels.BoundChannel
getLocalAddress
in class ServerConnection
public <A extends SocketAddress> A getLocalAddress(Class<A> type)
getLocalAddress
in interface org.xnio.channels.BoundChannel
getLocalAddress
in class ServerConnection
public org.xnio.OptionMap getUndertowOptions()
getUndertowOptions
in class ServerConnection
public int getBufferSize()
getBufferSize
in class ServerConnection
public PooledByteBuffer getExtraBytes()
public void setExtraBytes(PooledByteBuffer extraBytes)
public org.xnio.conduits.StreamSourceConduit getOriginalSourceConduit()
public org.xnio.conduits.StreamSinkConduit getOriginalSinkConduit()
public AbstractServerConnection.ConduitState resetChannel()
AbstractServerConnection.ConduitState
object that can be used the restore the channel.public void clearChannel()
public void restoreChannel(AbstractServerConnection.ConduitState state)
state
- The original stateresetChannel()
protected static org.xnio.conduits.StreamSinkConduit sink(AbstractServerConnection.ConduitState state)
protected static org.xnio.conduits.StreamSourceConduit source(AbstractServerConnection.ConduitState state)
public void addCloseListener(ServerConnection.CloseListener listener)
ServerConnection
addCloseListener
in class ServerConnection
listener
- The close listenerprotected org.xnio.conduits.ConduitStreamSinkChannel getSinkChannel()
getSinkChannel
in class ServerConnection
protected org.xnio.conduits.ConduitStreamSourceChannel getSourceChannel()
getSourceChannel
in class ServerConnection
protected void setUpgradeListener(HttpUpgradeListener upgradeListener)
setUpgradeListener
in class ServerConnection
protected void maxEntitySizeUpdated(HttpServerExchange exchange)
ServerConnection
maxEntitySizeUpdated
in class ServerConnection
exchange
- The current exchangeCopyright © 2020 JBoss by Red Hat. All rights reserved.