Package org.apache.http.impl.nio.reactor
Class DefaultListeningIOReactor
java.lang.Object
org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor
org.apache.http.impl.nio.reactor.DefaultListeningIOReactor
- All Implemented Interfaces:
IOReactor,ListeningIOReactor
public class DefaultListeningIOReactor
extends AbstractMultiworkerIOReactor
implements ListeningIOReactor
Default implementation of
ListeningIOReactor. This class extends
AbstractMultiworkerIOReactor with capability to listen for incoming
connections.- Since:
- 4.0
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of DefaultListeningIOReactor with default configuration.DefaultListeningIOReactor(int workerCount, ThreadFactory threadFactory, HttpParams params) Deprecated.DefaultListeningIOReactor(int workerCount, HttpParams params) Deprecated.Creates an instance of DefaultListeningIOReactor with the given configuration.DefaultListeningIOReactor(IOReactorConfig config, ThreadFactory threadFactory) Creates an instance of DefaultListeningIOReactor with the given configuration. -
Method Summary
Modifier and TypeMethodDescriptionReturns a set of endpoints for this I/O reactor.listen(SocketAddress address) Opens a new listener endpoint with the given socket address.voidpause()Suspends the I/O reactor preventing it from accepting new connections on all active endpoints.voidresume()Resumes the I/O reactor restoring its ability to accept incoming connections on all active endpoints.Methods inherited from class org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor
execute, getAuditLog, getStatus, setExceptionHandler, shutdown, shutdown
-
Constructor Details
-
DefaultListeningIOReactor
public DefaultListeningIOReactor(IOReactorConfig config, ThreadFactory threadFactory) throws IOReactorException Creates an instance of DefaultListeningIOReactor with the given configuration.- Parameters:
config- I/O reactor configuration.threadFactory- the factory to create threads. Can benull.- Throws:
IOReactorException- in case if a non-recoverable I/O error.- Since:
- 4.2
-
DefaultListeningIOReactor
Creates an instance of DefaultListeningIOReactor with the given configuration.- Parameters:
config- I/O reactor configuration. Can benull.- Throws:
IOReactorException- in case if a non-recoverable I/O error.- Since:
- 4.2
-
DefaultListeningIOReactor
Creates an instance of DefaultListeningIOReactor with default configuration.- Throws:
IOReactorException- in case if a non-recoverable I/O error.- Since:
- 4.2
-
DefaultListeningIOReactor
@Deprecated public DefaultListeningIOReactor(int workerCount, ThreadFactory threadFactory, HttpParams params) throws IOReactorException Deprecated.- Throws:
IOReactorException
-
DefaultListeningIOReactor
@Deprecated public DefaultListeningIOReactor(int workerCount, HttpParams params) throws IOReactorException Deprecated.- Throws:
IOReactorException
-
-
Method Details
-
listen
Description copied from interface:ListeningIOReactorOpens a new listener endpoint with the given socket address. Once the endpoint is fully initialized it starts accepting incoming connections and propagates I/O activity notifications to the I/O event dispatcher.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.- Specified by:
listenin interfaceListeningIOReactor- Parameters:
address- the socket address to listen on.- Returns:
- listener endpoint.
-
getEndpoints
Description copied from interface:ListeningIOReactorReturns a set of endpoints for this I/O reactor.- Specified by:
getEndpointsin interfaceListeningIOReactor- Returns:
- set of endpoints.
-
pause
Description copied from interface:ListeningIOReactorSuspends the I/O reactor preventing it from accepting new connections on all active endpoints.- Specified by:
pausein interfaceListeningIOReactor- Throws:
IOException- in case of an I/O error.
-
resume
Description copied from interface:ListeningIOReactorResumes the I/O reactor restoring its ability to accept incoming connections on all active endpoints.- Specified by:
resumein interfaceListeningIOReactor- Throws:
IOException- in case of an I/O error.
-
DefaultListeningIOReactor(IOReactorConfig, ThreadFactory)