java.lang.Object | ||
↳ | org.apache.http.impl.nio.reactor.AbstractIOReactor | |
↳ | org.apache.http.impl.nio.reactor.BaseIOReactor |
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.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates new BaseIOReactor instance.
| |||||||||||
Creates new BaseIOReactor instance.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Activates the I/O reactor.
| |||||||||||
Sets exception handler for this I/O reactor.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
This I/O reactor implementation does not react to the
OP_ACCEPT event. | |||||||||||
This I/O reactor implementation does not react to the
OP_CONNECT event. | |||||||||||
Obtains
IOSession instance associated with the given selection
key. | |||||||||||
Handles the given RuntimeException.
| |||||||||||
Processes
OP_READ event on the given selection key. | |||||||||||
Processes closed I/O session.
| |||||||||||
Processes newly created I/O session.
| |||||||||||
Performs timeout check for the I/O session associated with the given
selection key.
| |||||||||||
Verifies whether any of the sessions associated with the given selection
keys timed out by invoking the
timeoutCheck(SelectionKey, long)
method. | |||||||||||
Processes
OP_WRITE event on the given selection key. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.apache.http.impl.nio.reactor.AbstractIOReactor
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
org.apache.http.nio.reactor.IOReactor
|
Creates new BaseIOReactor instance.
selectTimeout | the select timeout. |
---|
IOReactorException | in case if a non-recoverable I/O error. |
---|
Creates new BaseIOReactor instance.
selectTimeout | the select timeout. |
---|---|
interestOpsQueueing | Ops queueing flag. |
IOReactorException | in case if a non-recoverable I/O error. |
---|
Activates the I/O reactor. The I/O reactor will start reacting to I/O
events and dispatch I/O event notifications to the given
IOEventDispatch
.
InterruptedIOException | if the dispatch thread is interrupted. |
---|---|
IOReactorException | in case if a non-recoverable I/O error. |
Sets exception handler for this I/O reactor.
exceptionHandler | the exception handler. |
---|
This I/O reactor implementation does not react to the
OP_ACCEPT
event.
Super-classes can override this method to react to the event.
key | the selection key. |
---|
This I/O reactor implementation does not react to the
OP_CONNECT
event.
Super-classes can override this method to react to the event.
key | the selection key. |
---|
Obtains IOSession
instance associated with the given selection
key.
key | the selection key. |
---|
Handles the given RuntimeException. This method delegates
handling of the exception to the IOReactorExceptionHandler
,
if available.
ex | the runtime exception. |
---|
Processes OP_READ
event on the given selection key.
This method dispatches the event notification to the
inputReady(IOSession)
method.
key | the selection key. |
---|
Processes closed I/O session. This method dispatches the event
notification to the disconnected(IOSession)
method.
session | closed I/O session. |
---|
Processes newly created I/O session. This method dispatches the event
notification to the connected(IOSession)
method.
key | the selection key. |
---|---|
session | new I/O session. |
Performs timeout check for the I/O session associated with the given selection key.
key | the selection key. |
---|---|
now | current time as long value. |
Verifies whether any of the sessions associated with the given selection
keys timed out by invoking the timeoutCheck(SelectionKey, long)
method.
This method will also invoke the
inputReady(IOSession)
method on all sessions
that have buffered input data.
keys | all selection keys registered with the selector. |
---|
Processes OP_WRITE
event on the given selection key.
This method dispatches the event notification to the
outputReady(IOSession)
method.
key | the selection key. |
---|