Class SelectorManager
- java.lang.Object
-
- org.eclipse.jetty.util.component.AbstractLifeCycle
-
- org.eclipse.jetty.util.component.ContainerLifeCycle
-
- org.eclipse.jetty.io.SelectorManager
-
- All Implemented Interfaces:
Container,Destroyable,Dumpable,Dumpable.DumpableContainer,LifeCycle
@ManagedObject("Manager of the NIO Selectors") @Deprecated(since="2021-05-27") public abstract class SelectorManager extends ContainerLifeCycle implements Dumpable
Deprecated.SelectorManagermanages a number ofManagedSelectors that simplify the non-blocking primitives provided by the JVM via thejava.niopackage.SelectorManagersubclasses implement methods to return protocol-specificEndPoints andConnections.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceSelectorManager.AcceptListenerDeprecated.The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.-
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 Modifier and Type Field Description static intDEFAULT_CONNECT_TIMEOUTDeprecated.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaccept(java.nio.channels.SelectableChannel channel)Deprecated.voidaccept(java.nio.channels.SelectableChannel channel, java.lang.Object attachment)Deprecated.Registers a channel to perform non-blocking read/write operations.java.io.Closeableacceptor(java.nio.channels.SelectableChannel server)Deprecated.Registers a server channel for accept operations.voidaddAcceptListener(SelectorManager.AcceptListener listener)Deprecated.voidaddEventListener(java.util.EventListener listener)Deprecated.voidconnect(java.nio.channels.SelectableChannel channel, java.lang.Object attachment)Deprecated.Registers a channel to perform a non-blocking connect.voidconnectionClosed(Connection connection)Deprecated.Callback method invoked when a connection is closed.voidconnectionOpened(Connection connection)Deprecated.Callback method invoked when a connection is opened.longgetConnectTimeout()Deprecated.Get the connect timeoutjava.util.concurrent.ExecutorgetExecutor()Deprecated.intgetReservedThreads()Deprecated.SchedulergetScheduler()Deprecated.intgetSelectorCount()Deprecated.abstract ConnectionnewConnection(java.nio.channels.SelectableChannel channel, EndPoint endpoint, java.lang.Object attachment)Deprecated.Factory method to createConnection.voidremoveAcceptListener(SelectorManager.AcceptListener listener)Deprecated.voidremoveEventListener(java.util.EventListener listener)Deprecated.voidsetConnectTimeout(long milliseconds)Deprecated.Set the connect timeout (in milliseconds)voidsetReservedThreads(int threads)Deprecated.-
Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, destroy, dump, dump, dump, dump, dump, dumpObject, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, 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
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer
isDumpable
-
-
-
-
Field Detail
-
DEFAULT_CONNECT_TIMEOUT
public static final int DEFAULT_CONNECT_TIMEOUT
Deprecated.- See Also:
- Constant Field Values
-
-
Method Detail
-
getExecutor
@ManagedAttribute("The Executor") public java.util.concurrent.Executor getExecutor()
Deprecated.
-
getScheduler
@ManagedAttribute("The Scheduler") public Scheduler getScheduler()
Deprecated.
-
getConnectTimeout
@ManagedAttribute("The Connection timeout (ms)") public long getConnectTimeout()
Deprecated.Get the connect timeout- Returns:
- the connect timeout (in milliseconds)
-
setConnectTimeout
public void setConnectTimeout(long milliseconds)
Deprecated.Set the connect timeout (in milliseconds)- Parameters:
milliseconds- the number of milliseconds for the timeout
-
getReservedThreads
@Deprecated public int getReservedThreads()
Deprecated.- Returns:
- -1
-
setReservedThreads
@Deprecated public void setReservedThreads(int threads)
Deprecated.- Parameters:
threads- ignored
-
getSelectorCount
@ManagedAttribute("The number of NIO Selectors") public int getSelectorCount()
Deprecated.- Returns:
- the number of selectors in use
-
connect
public void connect(java.nio.channels.SelectableChannel channel, java.lang.Object attachment)Deprecated.Registers a channel to perform a non-blocking connect.
The channel must be set in non-blocking mode,
SocketChannel.connect(SocketAddress)must be called prior to calling this method, and the connect operation must not be completed (the return value ofSocketChannel.connect(SocketAddress)must be false).- Parameters:
channel- the channel to registerattachment- the attachment object- See Also:
accept(SelectableChannel, Object)
-
accept
public void accept(java.nio.channels.SelectableChannel channel)
Deprecated.- Parameters:
channel- the channel to accept- See Also:
accept(SelectableChannel, Object)
-
accept
public void accept(java.nio.channels.SelectableChannel channel, java.lang.Object attachment)Deprecated.Registers a channel to perform non-blocking read/write operations.
This method is called just after a channel has been accepted by
ServerSocketChannel.accept(), or just after having performed a blocking connect viaSocket.connect(SocketAddress, int), or just after a non-blocking connect viaSocketChannel.connect(SocketAddress)that completed successfully.- Parameters:
channel- the channel to registerattachment- the attachment object
-
acceptor
public java.io.Closeable acceptor(java.nio.channels.SelectableChannel server)
Deprecated.Registers a server channel for accept operations. When a
SocketChannelis accepted from the givenServerSocketChannelthen theaccepted(SelectableChannel)method is called, which must be overridden by a derivation of this class to handle the accepted channel- Parameters:
server- the server channel to register- Returns:
- A Closable that allows the acceptor to be cancelled
-
connectionOpened
public void connectionOpened(Connection connection)
Deprecated.Callback method invoked when a connection is opened.
- Parameters:
connection- the connection just opened
-
connectionClosed
public void connectionClosed(Connection connection)
Deprecated.Callback method invoked when a connection is closed.
- Parameters:
connection- the connection just closed
-
newConnection
public abstract Connection newConnection(java.nio.channels.SelectableChannel channel, EndPoint endpoint, java.lang.Object attachment) throws java.io.IOException
Deprecated.Factory method to create
Connection.- 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
-
addEventListener
public void addEventListener(java.util.EventListener listener)
Deprecated.
-
removeEventListener
public void removeEventListener(java.util.EventListener listener)
Deprecated.
-
addAcceptListener
public void addAcceptListener(SelectorManager.AcceptListener listener)
Deprecated.
-
removeAcceptListener
public void removeAcceptListener(SelectorManager.AcceptListener listener)
Deprecated.
-
-