Module org.eclipse.jetty.io
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:
org.eclipse.jetty.util.component.Container,org.eclipse.jetty.util.component.Destroyable,org.eclipse.jetty.util.component.Dumpable,org.eclipse.jetty.util.component.LifeCycle
- Enclosing class:
- ClientConnector
protected class ClientConnector.ClientSelectorManager extends SelectorManager
-
-
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
org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener, org.eclipse.jetty.util.component.AbstractLifeCycle.StopException
-
-
Field Summary
-
Fields inherited from class org.eclipse.jetty.io.SelectorManager
DEFAULT_CONNECT_TIMEOUT, LOG
-
-
Constructor Summary
Constructors Constructor Description ClientSelectorManager(java.util.concurrent.Executor executor, org.eclipse.jetty.util.thread.Scheduler scheduler, int selectors)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidconnectionFailed(java.nio.channels.SelectableChannel channel, java.lang.Throwable failure, java.lang.Object attachment)Callback method invoked when a non-blocking connect cannot be completed.voidconnectionOpened(Connection connection, java.lang.Object context)Callback method invoked when a connection is opened.ConnectionnewConnection(java.nio.channels.SelectableChannel channel, EndPoint endPoint, java.lang.Object attachment)Factory method to createConnection.protected EndPointnewEndPoint(java.nio.channels.SelectableChannel channel, ManagedSelector selector, java.nio.channels.SelectionKey selectionKey)Factory method to createEndPoint.-
Methods inherited from class org.eclipse.jetty.io.SelectorManager
accept, accept, accepted, acceptor, addEventListener, connect, connectionClosed, doAccept, doFinishConnect, doStart, doStop, endPointClosed, endPointOpened, execute, getConnectTimeout, getExecutor, getScheduler, getSelectorCount, isConnectionPending, newSelector, newSelector, onAccepted, onAcceptFailed, onAccepting, removeEventListener, setConnectTimeout
-
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, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, setBeans, start, stop, unmanage, updateBean, updateBean, updateBeans
-
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stop, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
Method Detail
-
newEndPoint
protected EndPoint newEndPoint(java.nio.channels.SelectableChannel channel, ManagedSelector selector, java.nio.channels.SelectionKey selectionKey)
Description copied from class:SelectorManagerFactory 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:
newEndPointin 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:
SelectorManager.newConnection(SelectableChannel, EndPoint, Object)
-
newConnection
public Connection newConnection(java.nio.channels.SelectableChannel channel, EndPoint endPoint, java.lang.Object attachment) throws java.io.IOException
Description copied from class:SelectorManagerFactory method to create
Connection.- Specified by:
newConnectionin classSelectorManager- Parameters:
channel- the channel associated to the connectionendPoint- the endpointattachment- the attachment- Returns:
- a new connection
- Throws:
java.io.IOException- if unable to create new connection
-
connectionOpened
public void connectionOpened(Connection connection, java.lang.Object context)
Description copied from class:SelectorManagerCallback method invoked when a connection is opened.
- Overrides:
connectionOpenedin classSelectorManager- Parameters:
connection- the connection just openedcontext- the attachment associated with the creation of the connection- See Also:
SelectorManager.newConnection(SelectableChannel, EndPoint, Object)
-
connectionFailed
protected void connectionFailed(java.nio.channels.SelectableChannel channel, java.lang.Throwable failure, java.lang.Object attachment)Description copied from class:SelectorManagerCallback method invoked when a non-blocking connect cannot be completed.
By default it just logs with level warning.
- Overrides:
connectionFailedin classSelectorManager- Parameters:
channel- the channel that attempted the connectfailure- the exception that caused the connect to failattachment- the attachment object associated at registration
-
-