protected class ServerConnector.ServerConnectorManager extends SelectorManager
AbstractLifeCycle.AbstractLifeCycleListener
Container.InheritedListener, Container.Listener
LifeCycle.Listener
DEFAULT_CONNECT_TIMEOUT, LOG
Constructor and Description |
---|
ServerConnectorManager(Executor executor,
Scheduler scheduler,
int selectors) |
Modifier and Type | Method and Description |
---|---|
protected void |
accepted(SelectableChannel channel)
Callback method when a channel is accepted from the
ServerSocketChannel
passed to SelectorManager.acceptor(SelectableChannel) . |
protected void |
endPointClosed(EndPoint endpoint)
Callback method invoked when an endpoint is closed.
|
protected void |
endPointOpened(EndPoint endpoint)
Callback method invoked when an endpoint is opened.
|
Connection |
newConnection(SelectableChannel channel,
EndPoint endpoint,
Object attachment)
Factory method to create
Connection . |
protected ChannelEndPoint |
newEndPoint(SelectableChannel channel,
ManagedSelector selectSet,
SelectionKey selectionKey)
Factory method to create
EndPoint . |
accept, accept, acceptor, connect, connectionClosed, connectionFailed, connectionOpened, doAccept, doFinishConnect, doStart, doStop, execute, getConnectTimeout, getExecutor, getScheduler, getSelectorCount, isConnectionPending, newSelector, newSelector, setConnectTimeout
addBean, addBean, addBean, addEventListener, addManaged, contains, destroy, dump, dump, dump, dump, dump, dumpBeans, dumpObject, dumpStdErr, dumpThis, getBean, getBeans, getBeans, isManaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, start, stop, unmanage, updateBean, updateBean, updateBeans
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
protected void accepted(SelectableChannel channel) throws IOException
SelectorManager
ServerSocketChannel
passed to SelectorManager.acceptor(SelectableChannel)
.
The default impl throws an UnsupportedOperationException
, so it must
be overridden by subclasses if a server channel is provided.accepted
in class SelectorManager
channel
- theIOException
- if unable to accept channelprotected ChannelEndPoint newEndPoint(SelectableChannel channel, ManagedSelector selectSet, SelectionKey selectionKey) throws IOException
SelectorManager
Factory method to create EndPoint
.
This method is invoked as a result of the registration of a channel via SelectorManager.connect(SelectableChannel, Object)
or SelectorManager.accept(SelectableChannel)
.
newEndPoint
in class SelectorManager
channel
- the channel associated to the endpointselectSet
- the selector the channel is registered toselectionKey
- the selection keyIOException
- if the endPoint cannot be createdSelectorManager.newConnection(SelectableChannel, EndPoint, Object)
public Connection newConnection(SelectableChannel 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 connectionprotected void endPointOpened(EndPoint endpoint)
SelectorManager
Callback method invoked when an endpoint is opened.
endPointOpened
in class SelectorManager
endpoint
- the endpoint being openedprotected void endPointClosed(EndPoint endpoint)
SelectorManager
Callback method invoked when an endpoint is closed.
endPointClosed
in class SelectorManager
endpoint
- the endpoint being closedCopyright © 1995–2017 Webtide. All rights reserved.