protected class UnixSocketConnector.UnixSocketConnectorManager extends SelectorManager
SelectorManager.AcceptListener
AbstractLifeCycle.AbstractLifeCycleListener
Container.InheritedListener, Container.Listener
LifeCycle.Listener
DEFAULT_CONNECT_TIMEOUT, LOG
Constructor and Description |
---|
UnixSocketConnectorManager(java.util.concurrent.Executor executor,
Scheduler scheduler,
int selectors) |
Modifier and Type | Method and Description |
---|---|
protected void |
accepted(java.nio.channels.SelectableChannel channel)
Callback method when a channel is accepted from the
ServerSocketChannel
passed to SelectorManager.acceptor(SelectableChannel) . |
protected java.nio.channels.SelectableChannel |
doAccept(java.nio.channels.SelectableChannel server) |
protected boolean |
doFinishConnect(java.nio.channels.SelectableChannel channel) |
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.
|
protected boolean |
isConnectionPending(java.nio.channels.SelectableChannel channel) |
Connection |
newConnection(java.nio.channels.SelectableChannel channel,
EndPoint endpoint,
java.lang.Object attachment)
Factory method to create
Connection . |
protected EndPoint |
newEndPoint(java.nio.channels.SelectableChannel channel,
ManagedSelector selector,
java.nio.channels.SelectionKey selectionKey)
Factory method to create
EndPoint . |
protected java.nio.channels.Selector |
newSelector() |
accept, accept, acceptor, addAcceptListener, addEventListener, connect, connectionClosed, connectionFailed, connectionOpened, doStart, doStop, execute, getConnectTimeout, getExecutor, getReservedThreads, getScheduler, getSelectorCount, newSelector, onAccepted, onAcceptFailed, onAccepting, removeAcceptListener, removeEventListener, setConnectTimeout, setReservedThreads
addBean, addBean, addBean, addEventListener, addManaged, contains, destroy, dump, dump, dump, dump, dump, dumpBeans, dumpObject, dumpObjects, dumpStdErr, dumpThis, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, 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, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
dump, dump, dump, dumpObject, dumpObjects, dumpSelf
public UnixSocketConnectorManager(java.util.concurrent.Executor executor, Scheduler scheduler, int selectors)
protected void accepted(java.nio.channels.SelectableChannel channel) throws java.io.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
- thejava.io.IOException
- if unable to accept channelprotected java.nio.channels.Selector newSelector() throws java.io.IOException
newSelector
in class SelectorManager
java.io.IOException
protected EndPoint newEndPoint(java.nio.channels.SelectableChannel channel, ManagedSelector selector, java.nio.channels.SelectionKey selectionKey) throws java.io.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 endpointselector
- the selector the channel is registered toselectionKey
- the selection keyjava.io.IOException
- if the endPoint cannot be createdSelectorManager.newConnection(SelectableChannel, EndPoint, Object)
public Connection newConnection(java.nio.channels.SelectableChannel channel, EndPoint endpoint, java.lang.Object attachment) throws java.io.IOException
SelectorManager
Factory method to create Connection
.
newConnection
in class SelectorManager
channel
- the channel associated to the connectionendpoint
- the endpointattachment
- the attachmentjava.io.IOException
- 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 closedprotected boolean doFinishConnect(java.nio.channels.SelectableChannel channel) throws java.io.IOException
doFinishConnect
in class SelectorManager
java.io.IOException
protected boolean isConnectionPending(java.nio.channels.SelectableChannel channel)
isConnectionPending
in class SelectorManager
protected java.nio.channels.SelectableChannel doAccept(java.nio.channels.SelectableChannel server) throws java.io.IOException
doAccept
in class SelectorManager
java.io.IOException
Copyright © 1995–2023 Webtide. All rights reserved.