Package org.apache.http.impl.nio.reactor
Class BaseIOReactor
java.lang.Object
org.apache.http.impl.nio.reactor.AbstractIOReactor
org.apache.http.impl.nio.reactor.BaseIOReactor
- All Implemented Interfaces:
IOReactor
Default implementation of
AbstractIOReactor that serves as a base
for more advanced IOReactor
implementations. This class adds support for the I/O event dispatching
using IOEventDispatch, management of buffering sessions, and
session timeout handling.- Since:
- 4.0
-
Constructor Summary
ConstructorsConstructorDescriptionBaseIOReactor(long selectTimeout) Creates new BaseIOReactor instance.BaseIOReactor(long selectTimeout, boolean interestOpsQueueing) Creates new BaseIOReactor instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute(IOEventDispatch eventDispatch) Activates the I/O reactor.voidsetExceptionHandler(IOReactorExceptionHandler exceptionHandler) Sets exception handler for this I/O reactor.Methods inherited from class org.apache.http.impl.nio.reactor.AbstractIOReactor
addChannel, awaitShutdown, getInterestOpsQueueing, getStatus, gracefulShutdown, hardShutdown, shutdown, shutdown
-
Constructor Details
-
BaseIOReactor
Creates new BaseIOReactor instance.- Parameters:
selectTimeout- the select timeout.- Throws:
IOReactorException- in case if a non-recoverable I/O error.
-
BaseIOReactor
Creates new BaseIOReactor instance.- Parameters:
selectTimeout- the select timeout.interestOpsQueueing- Ops queueing flag.- Throws:
IOReactorException- in case if a non-recoverable I/O error.- Since:
- 4.1
-
-
Method Details
-
execute
public void execute(IOEventDispatch eventDispatch) throws InterruptedIOException, IOReactorException Activates the I/O reactor. The I/O reactor will start reacting to I/O events and dispatch I/O event notifications to the givenIOEventDispatch.- Parameters:
eventDispatch- the I/O event dispatch.- Throws:
InterruptedIOException- if the dispatch thread is interrupted.IOReactorException- in case if a non-recoverable I/O error.
-
setExceptionHandler
Sets exception handler for this I/O reactor.- Parameters:
exceptionHandler- the exception handler.
-