public abstract class AbstractServerConnection extends AbstractAttachable implements ServerConnection
| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractServerConnection.ConduitState |
ServerConnection.CloseListener| Modifier and Type | Field and Description |
|---|---|
protected org.xnio.Pool<ByteBuffer> |
bufferPool |
protected org.xnio.StreamConnection |
channel |
protected List<ServerConnection.CloseListener> |
closeListeners |
protected io.undertow.server.AbstractServerConnection.CloseSetter |
closeSetter |
protected org.xnio.Pooled<ByteBuffer> |
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,
org.xnio.Pool<ByteBuffer> 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 |
close() |
org.xnio.Pool<ByteBuffer> |
getBufferPool()
Get the buffer pool for this connection.
|
int |
getBufferSize() |
org.xnio.StreamConnection |
getChannel()
Get the underlying channel.
|
org.xnio.ChannelListener.Setter<ServerConnection> |
getCloseSetter() |
org.xnio.Pooled<ByteBuffer> |
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.
|
org.xnio.conduits.ConduitStreamSinkChannel |
getSinkChannel() |
org.xnio.conduits.ConduitStreamSourceChannel |
getSourceChannel() |
org.xnio.OptionMap |
getUndertowOptions() |
org.xnio.XnioWorker |
getWorker() |
boolean |
isOpen() |
AbstractServerConnection.ConduitState |
resetChannel()
Resets the channel to its original state, effectively disabling all current conduit
wrappers.
|
void |
restoreChannel(AbstractServerConnection.ConduitState state)
Resores the channel conduits to a previous state.
|
void |
setExtraBytes(org.xnio.Pooled<ByteBuffer> extraBytes) |
<T> T |
setOption(org.xnio.Option<T> option,
T value) |
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) |
addToAttachmentList, getAttachment, getAttachmentList, putAttachment, removeAttachmentclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetSslSessionInfo, sendOutOfBandResponse, setSslSessionInfo, upgradeChanneladdToAttachmentList, getAttachment, getAttachmentList, putAttachment, removeAttachmentprotected final org.xnio.StreamConnection channel
protected final io.undertow.server.AbstractServerConnection.CloseSetter closeSetter
protected final org.xnio.Pool<ByteBuffer> 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 org.xnio.Pooled<ByteBuffer> extraBytes
public AbstractServerConnection(org.xnio.StreamConnection channel,
org.xnio.Pool<ByteBuffer> bufferPool,
HttpHandler rootHandler,
org.xnio.OptionMap undertowOptions,
int bufferSize)
public HttpHandler getRootHandler()
public org.xnio.Pool<ByteBuffer> getBufferPool()
getBufferPool in interface ServerConnectionpublic org.xnio.StreamConnection getChannel()
public org.xnio.ChannelListener.Setter<ServerConnection> getCloseSetter()
getCloseSetter in interface org.xnio.channels.BoundChannelgetCloseSetter in interface org.xnio.channels.CloseableChannelgetCloseSetter in interface org.xnio.channels.ConnectedChannelpublic org.xnio.XnioWorker getWorker()
getWorker in interface ServerConnectiongetWorker in interface org.xnio.channels.CloseableChannelpublic org.xnio.XnioIoThread getIoThread()
getIoThread in interface ServerConnectiongetIoThread in interface org.xnio.channels.CloseableChannelpublic boolean isOpen()
isOpen in interface ServerConnectionisOpen in interface Channelpublic boolean supportsOption(org.xnio.Option<?> option)
supportsOption in interface ServerConnectionsupportsOption in interface org.xnio.channels.Configurablepublic <T> T getOption(org.xnio.Option<T> option)
throws IOException
getOption in interface ServerConnectiongetOption in interface org.xnio.channels.ConfigurableIOExceptionpublic <T> T setOption(org.xnio.Option<T> option,
T value)
throws IllegalArgumentException,
IOException
setOption in interface ServerConnectionsetOption in interface org.xnio.channels.ConfigurableIllegalArgumentExceptionIOExceptionpublic void close()
throws IOException
close in interface ServerConnectionclose in interface Closeableclose in interface AutoCloseableclose in interface Channelclose in interface InterruptibleChannelclose in interface org.xnio.channels.CloseableChannelIOExceptionpublic SocketAddress getPeerAddress()
ServerConnectiongetPeerAddress in interface ServerConnectiongetPeerAddress in interface org.xnio.channels.ConnectedChannelpublic <A extends SocketAddress> A getPeerAddress(Class<A> type)
ServerConnectiongetPeerAddress in interface ServerConnectiongetPeerAddress in interface org.xnio.channels.ConnectedChannelA - The address typetype - The type of address to returnpublic SocketAddress getLocalAddress()
getLocalAddress in interface ServerConnectiongetLocalAddress in interface org.xnio.channels.BoundChannelpublic <A extends SocketAddress> A getLocalAddress(Class<A> type)
getLocalAddress in interface ServerConnectiongetLocalAddress in interface org.xnio.channels.BoundChannelpublic org.xnio.OptionMap getUndertowOptions()
getUndertowOptions in interface ServerConnectionpublic int getBufferSize()
getBufferSize in interface ServerConnectionpublic org.xnio.Pooled<ByteBuffer> getExtraBytes()
public void setExtraBytes(org.xnio.Pooled<ByteBuffer> 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 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 interface ServerConnectionlistener - The close listenerpublic org.xnio.conduits.ConduitStreamSinkChannel getSinkChannel()
getSinkChannel in interface ServerConnectionpublic org.xnio.conduits.ConduitStreamSourceChannel getSourceChannel()
getSourceChannel in interface ServerConnectionCopyright © 2013 JBoss by Red Hat. All Rights Reserved.