Package org.eclipse.jetty.io
Class ClientConnector.ClientSelectorManager
java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.ContainerLifeCycle
org.eclipse.jetty.io.SelectorManager
org.eclipse.jetty.io.ClientConnector.ClientSelectorManager
- All Implemented Interfaces:
Container
,Destroyable
,Dumpable
,Dumpable.DumpableContainer
,LifeCycle
- Enclosing class:
- ClientConnector
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.jetty.io.SelectorManager
SelectorManager.AcceptListener, SelectorManager.SelectorManagerListener
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener, AbstractLifeCycle.StopException
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
Container.InheritedListener, Container.Listener
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
Dumpable.DumpableContainer
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener
-
Field Summary
Fields inherited from class org.eclipse.jetty.io.SelectorManager
DEFAULT_CONNECT_TIMEOUT
-
Constructor Summary
ConstructorDescriptionClientSelectorManager
(Executor executor, Scheduler scheduler, int selectors) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
connectionFailed
(SelectableChannel channel, Throwable failure, Object attachment) Callback method invoked when a non-blocking connect cannot be completed.void
connectionOpened
(Connection connection, Object context) Callback method invoked when a connection is opened.newConnection
(SelectableChannel channel, EndPoint endPoint, Object attachment) Factory method to createConnection
.protected EndPoint
newEndPoint
(SelectableChannel channel, ManagedSelector selector, SelectionKey selectionKey) Factory method to createEndPoint
.Methods inherited from class org.eclipse.jetty.io.SelectorManager
accept, accept, accepted, acceptor, addEventListener, chooseSelector, connect, connectionClosed, doAccept, doFinishConnect, doStart, doStop, endPointClosed, endPointOpened, execute, getConnectTimeout, getExecutor, getScheduler, getSelectorCount, getTotalKeys, isConnectionPending, newSelector, newSelector, onAccepted, onAcceptFailed, onAccepting, removeEventListener, setConnectTimeout, toString
Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addManaged, contains, destroy, dump, dump, dump, dumpObjects, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, installBean, installBean, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, setBeans, start, stop, unmanage, updateBean, updateBean, updateBeans, updateBeans
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stop
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.eclipse.jetty.util.component.Container
getCachedBeans, getEventListeners
Methods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer
isDumpable
-
Constructor Details
-
ClientSelectorManager
-
-
Method Details
-
newEndPoint
protected EndPoint newEndPoint(SelectableChannel channel, ManagedSelector selector, SelectionKey selectionKey) Description copied from class:SelectorManager
Factory method to create
EndPoint
.This method is invoked as a result of the registration of a channel via
SelectorManager.connect(SelectableChannel, Object)
orSelectorManager.accept(SelectableChannel)
.- Specified by:
newEndPoint
in classSelectorManager
- Parameters:
channel
- the channel associated to the endpointselector
- the selector the channel is registered toselectionKey
- the selection key- Returns:
- a new endpoint
- See Also:
-
newConnection
public Connection newConnection(SelectableChannel channel, EndPoint endPoint, Object attachment) throws IOException Description copied from class:SelectorManager
Factory method to create
Connection
.- Specified by:
newConnection
in classSelectorManager
- Parameters:
channel
- the channel associated to the connectionendPoint
- the endpointattachment
- the attachment- Returns:
- a new connection
- Throws:
IOException
- if unable to create new connection
-
connectionOpened
Description copied from class:SelectorManager
Callback method invoked when a connection is opened.
- Overrides:
connectionOpened
in classSelectorManager
- Parameters:
connection
- the connection just openedcontext
- the attachment associated with the creation of the connection- See Also:
-
connectionFailed
Description copied from class:SelectorManager
Callback method invoked when a non-blocking connect cannot be completed.
By default it just logs with level warning.
- Overrides:
connectionFailed
in classSelectorManager
- Parameters:
channel
- the channel that attempted the connectfailure
- the exception that caused the connect to failattachment
- the attachment object associated at registration
-