@ThreadSafe public class DefaultListeningIOReactor extends AbstractMultiworkerIOReactor implements ListeningIOReactor
ListeningIOReactor. This class extends
AbstractMultiworkerIOReactor with capability to listen for incoming
connections.auditLog, config, exceptionHandler, interestOpsQueueing, params, selector, selectTimeout, status| 构造器和说明 |
|---|
DefaultListeningIOReactor()
Creates an instance of DefaultListeningIOReactor with default configuration.
|
DefaultListeningIOReactor(int workerCount,
HttpParams params)
已过时。
|
DefaultListeningIOReactor(int workerCount,
java.util.concurrent.ThreadFactory threadFactory,
HttpParams params)
已过时。
|
DefaultListeningIOReactor(IOReactorConfig config)
Creates an instance of DefaultListeningIOReactor with the given configuration.
|
DefaultListeningIOReactor(IOReactorConfig config,
java.util.concurrent.ThreadFactory threadFactory)
Creates an instance of DefaultListeningIOReactor with the given configuration.
|
| 限定符和类型 | 方法和说明 |
|---|---|
protected void |
cancelRequests()
Triggered to cancel pending session requests.
|
java.util.Set<ListenerEndpoint> |
getEndpoints()
Returns a set of endpoints for this I/O reactor.
|
ListenerEndpoint |
listen(java.net.SocketAddress address)
Opens a new listener endpoint with the given socket address.
|
void |
pause()
Suspends the I/O reactor preventing it from accepting new connections on
all active endpoints.
|
protected void |
processEvents(int readyCount)
Triggered to process I/O events registered by the main
Selector. |
void |
resume()
Resumes the I/O reactor restoring its ability to accept incoming
connections on all active endpoints.
|
addChannel, addExceptionEvent, addExceptionEvent, awaitShutdown, doShutdown, execute, getAuditLog, getStatus, prepareSocket, registerChannel, setExceptionHandler, shutdown, shutdownpublic DefaultListeningIOReactor(IOReactorConfig config, java.util.concurrent.ThreadFactory threadFactory) throws IOReactorException
config - I/O reactor configuration.threadFactory - the factory to create threads.
Can be null.IOReactorException - in case if a non-recoverable I/O error.public DefaultListeningIOReactor(IOReactorConfig config) throws IOReactorException
config - I/O reactor configuration.
Can be null.IOReactorException - in case if a non-recoverable I/O error.public DefaultListeningIOReactor()
throws IOReactorException
IOReactorException - in case if a non-recoverable I/O error.@Deprecated
public DefaultListeningIOReactor(int workerCount,
java.util.concurrent.ThreadFactory threadFactory,
HttpParams params)
throws IOReactorException
DefaultListeningIOReactor(IOReactorConfig, ThreadFactory)@Deprecated
public DefaultListeningIOReactor(int workerCount,
HttpParams params)
throws IOReactorException
DefaultListeningIOReactor(IOReactorConfig)protected void cancelRequests()
throws IOReactorException
AbstractMultiworkerIOReactorSuper-classes can implement this method to react to the event.
cancelRequests 在类中 AbstractMultiworkerIOReactorIOReactorException - in case if a non-recoverable I/O error.protected void processEvents(int readyCount)
throws IOReactorException
AbstractMultiworkerIOReactorSelector.
Super-classes can implement this method to react to the event.
processEvents 在类中 AbstractMultiworkerIOReactorreadyCount - event count.IOReactorException - in case if a non-recoverable I/O error.public ListenerEndpoint listen(java.net.SocketAddress address)
ListeningIOReactor
ListenerEndpoint.waitFor() can be used to wait for the
listener to be come ready to accept incoming connections.
ListenerEndpoint.close() can be used to shut down
the listener even before it is fully initialized.
listen 在接口中 ListeningIOReactoraddress - the socket address to listen on.public java.util.Set<ListenerEndpoint> getEndpoints()
ListeningIOReactorgetEndpoints 在接口中 ListeningIOReactorpublic void pause()
throws java.io.IOException
ListeningIOReactorpause 在接口中 ListeningIOReactorjava.io.IOException - in case of an I/O error.public void resume()
throws java.io.IOException
ListeningIOReactorresume 在接口中 ListeningIOReactorjava.io.IOException - in case of an I/O error.