Package org.eclipse.jetty.proxy
Class ConnectHandler.ConnectManager
- java.lang.Object
-
- org.eclipse.jetty.util.component.AbstractLifeCycle
-
- org.eclipse.jetty.util.component.ContainerLifeCycle
-
- org.eclipse.jetty.io.SelectorManager
-
- org.eclipse.jetty.proxy.ConnectHandler.ConnectManager
-
- All Implemented Interfaces:
Container
,Destroyable
,Dumpable
,Dumpable.DumpableContainer
,LifeCycle
- Enclosing class:
- ConnectHandler
protected class ConnectHandler.ConnectManager extends SelectorManager
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.jetty.io.SelectorManager
SelectorManager.AcceptListener
-
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener
-
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, LOG
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ConnectManager(java.util.concurrent.Executor executor, Scheduler scheduler, int selectors)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
connectionFailed(java.nio.channels.SelectableChannel channel, java.lang.Throwable ex, java.lang.Object attachment)
Callback method invoked when a non-blocking connect cannot be completed.Connection
newConnection(java.nio.channels.SelectableChannel channel, EndPoint endpoint, java.lang.Object attachment)
Factory method to createConnection
.protected EndPoint
newEndPoint(java.nio.channels.SelectableChannel channel, ManagedSelector selector, java.nio.channels.SelectionKey key)
Factory method to createEndPoint
.-
Methods inherited from class org.eclipse.jetty.io.SelectorManager
accept, accept, accepted, acceptor, addAcceptListener, addEventListener, connect, connectionClosed, connectionOpened, doAccept, doFinishConnect, doStart, doStop, endPointClosed, endPointOpened, execute, getConnectTimeout, getExecutor, getReservedThreads, getScheduler, getSelectorCount, isConnectionPending, newSelector, newSelector, onAccepted, onAcceptFailed, onAccepting, removeAcceptListener, removeEventListener, setConnectTimeout, setReservedThreads
-
Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
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
-
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop, toString
-
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.Dumpable.DumpableContainer
isDumpable
-
-
-
-
Constructor Detail
-
ConnectManager
protected ConnectManager(java.util.concurrent.Executor executor, Scheduler scheduler, int selectors)
-
-
Method Detail
-
newEndPoint
protected EndPoint newEndPoint(java.nio.channels.SelectableChannel channel, ManagedSelector selector, java.nio.channels.SelectionKey key) throws java.io.IOException
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 tokey
- the selection key- Returns:
- a new endpoint
- Throws:
java.io.IOException
- if the endPoint cannot be created- 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: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:
java.io.IOException
- if unable to create new connection
-
connectionFailed
protected void connectionFailed(java.nio.channels.SelectableChannel channel, java.lang.Throwable ex, java.lang.Object attachment)
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 connectex
- the exception that caused the connect to failattachment
- the attachment object associated at registration
-
-