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, upgradeChanneladdToAttachmentList, createAttachmentMap, getAttachment, getAttachmentList, putAttachment, removeAttachmentprotected 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 ServerConnectionpublic HttpHandler getRootHandler()
public ByteBufferPool getByteBufferPool()
getByteBufferPool in class ServerConnectionpublic org.xnio.StreamConnection getChannel()
public org.xnio.ChannelListener.Setter<ServerConnection> getCloseSetter()
public org.xnio.XnioWorker getWorker()
getWorker in interface org.xnio.channels.CloseableChannelgetWorker in class ServerConnectionpublic org.xnio.XnioIoThread getIoThread()
getIoThread in interface org.xnio.channels.CloseableChannelgetIoThread in class ServerConnectionpublic boolean isOpen()
isOpen in interface ChannelisOpen in class ServerConnectionpublic boolean supportsOption(org.xnio.Option<?> option)
supportsOption in interface org.xnio.channels.ConfigurablesupportsOption in class ServerConnectionpublic <T> T getOption(org.xnio.Option<T> option)
throws IOException getOption in interface org.xnio.channels.ConfigurablegetOption in class ServerConnectionIOExceptionpublic <T> T setOption(org.xnio.Option<T> option,
T value)
throws IllegalArgumentException,
IOException setOption in interface org.xnio.channels.ConfigurablesetOption in class ServerConnectionIllegalArgumentExceptionIOExceptionpublic void close()
throws IOException close in interface Closeableclose in interface AutoCloseableclose in interface Channelclose in interface InterruptibleChannelclose in interface org.xnio.channels.CloseableChannelclose in class ServerConnectionIOExceptionpublic SocketAddress getPeerAddress()
ServerConnectiongetPeerAddress in interface org.xnio.channels.ConnectedChannelgetPeerAddress in class ServerConnectionpublic <A extends SocketAddress> A getPeerAddress(Class<A> type)
ServerConnectiongetPeerAddress in interface org.xnio.channels.ConnectedChannelgetPeerAddress in class ServerConnectionA - The address typetype - The type of address to returnpublic SocketAddress getLocalAddress()
getLocalAddress in interface org.xnio.channels.BoundChannelgetLocalAddress in class ServerConnectionpublic <A extends SocketAddress> A getLocalAddress(Class<A> type)
getLocalAddress in interface org.xnio.channels.BoundChannelgetLocalAddress in class ServerConnectionpublic org.xnio.OptionMap getUndertowOptions()
getUndertowOptions in class ServerConnectionpublic int getBufferSize()
getBufferSize in class ServerConnectionpublic 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)
ServerConnectionaddCloseListener in class ServerConnectionlistener - The close listenerprotected org.xnio.conduits.ConduitStreamSinkChannel getSinkChannel()
getSinkChannel in class ServerConnectionprotected org.xnio.conduits.ConduitStreamSourceChannel getSourceChannel()
getSourceChannel in class ServerConnectionprotected void setUpgradeListener(HttpUpgradeListener upgradeListener)
setUpgradeListener in class ServerConnectionprotected void maxEntitySizeUpdated(HttpServerExchange exchange)
ServerConnectionmaxEntitySizeUpdated in class ServerConnectionexchange - The current exchangeCopyright © 2020 JBoss by Red Hat. All rights reserved.