protected class AbstractHttpClientTransport.ClientSelectorManager extends SelectorManager
AbstractLifeCycle.AbstractLifeCycleListener
LifeCycle.Listener
DEFAULT_CONNECT_TIMEOUT, LOG
Modifier | Constructor and Description |
---|---|
protected |
ClientSelectorManager(HttpClient client,
int selectors) |
Modifier and Type | Method and Description |
---|---|
protected void |
connectionFailed(SocketChannel channel,
Throwable x,
Object attachment)
Callback method invoked when a non-blocking connect cannot be completed.
|
Connection |
newConnection(SocketChannel channel,
EndPoint endPoint,
Object attachment)
Factory method to create
Connection . |
protected EndPoint |
newEndPoint(SocketChannel channel,
ManagedSelector selector,
SelectionKey key)
Factory method to create
EndPoint . |
accept, accept, accepted, acceptor, connect, connectionClosed, connectionOpened, doStart, doStop, dump, dump, endPointClosed, endPointOpened, execute, finishConnect, getConnectTimeout, getExecutor, getScheduler, getSelectorCount, getSelectorPriorityDelta, newSelector, setConnectTimeout, setSelectorPriorityDelta
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, setStopTimeout, start, stop
protected ClientSelectorManager(HttpClient client, int selectors)
protected EndPoint newEndPoint(SocketChannel channel, ManagedSelector selector, SelectionKey key)
SelectorManager
Factory method to create EndPoint
.
This method is invoked as a result of the registration of a channel via SelectorManager.connect(SocketChannel, Object)
or SelectorManager.accept(SocketChannel)
.
newEndPoint
in class SelectorManager
channel
- the channel associated to the endpointselector
- the selector the channel is registered tokey
- the selection keySelectorManager.newConnection(SocketChannel, EndPoint, Object)
public Connection newConnection(SocketChannel channel, EndPoint endPoint, Object attachment) throws IOException
SelectorManager
Factory method to create Connection
.
newConnection
in class SelectorManager
channel
- the channel associated to the connectionendPoint
- the endpointattachment
- the attachmentIOException
- if unable to create new connectionSelectorManager.newEndPoint(SocketChannel, ManagedSelector, SelectionKey)
protected void connectionFailed(SocketChannel channel, Throwable x, Object attachment)
SelectorManager
Callback method invoked when a non-blocking connect cannot be completed.
By default it just logs with level warning.
connectionFailed
in class SelectorManager
channel
- the channel that attempted the connectx
- the exception that caused the connect to failattachment
- the attachment object associated at registrationCopyright © 1995-2016 Webtide. All Rights Reserved.