java.lang.Object | |
↳ | org.apache.http.impl.nio.reactor.AbstractIOReactor |
Known Direct Subclasses |
Generic implementation of IOReactor
that can used as a subclass
for more specialized I/O reactors. It is based on a single Selector
instance.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates new AbstractIOReactor instance.
| |||||||||||
Creates new AbstractIOReactor instance.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Adds new channel entry.
| |||||||||||
Blocks for the given period of time in milliseconds awaiting
the completion of the reactor shutdown.
| |||||||||||
Returns
true if interest Ops queueing is enabled, false otherwise. | |||||||||||
Returns the current status of the reactor.
| |||||||||||
Attempts graceful shutdown of this I/O reactor.
| |||||||||||
Attempts force-shutdown of this I/O reactor.
| |||||||||||
Initiates shutdown of the reactor and blocks approximately for the given
period of time in milliseconds waiting for the reactor to terminate all
active connections, to shut down itself and to release system resources
it currently holds.
| |||||||||||
Initiates shutdown of the reactor and blocks for a default period of
time waiting for the reactor to terminate all active connections, to shut
down itself and to release system resources it currently holds.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Triggered when the key signals
OP_ACCEPT readiness. | |||||||||||
Closes out all active channels registered with the selector of
this I/O reactor.
| |||||||||||
Closes out all new channels pending registration with the selector of
this I/O reactor.
| |||||||||||
Closes out all I/O sessions maintained by this I/O reactor.
| |||||||||||
Triggered when the key signals
OP_CONNECT readiness. | |||||||||||
Activates the I/O reactor.
| |||||||||||
Obtains
IOSession instance associated with the given selection
key. | |||||||||||
Processes new event on the given selection key.
| |||||||||||
Queues the given I/O session to be processed asynchronously as closed.
| |||||||||||
Triggered when the key signals
OP_READ readiness. | |||||||||||
Triggered when a session has been closed.
| |||||||||||
Triggered when new session has been created.
| |||||||||||
Triggered to verify whether the I/O session associated with the
given selection key has not timed out.
| |||||||||||
Triggered to validate keys currently registered with the selector.
| |||||||||||
Triggered when the key signals
OP_WRITE readiness. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
org.apache.http.nio.reactor.IOReactor
|
Creates new AbstractIOReactor instance.
selectTimeout | the select timeout. |
---|
IOReactorException | in case if a non-recoverable I/O error. |
---|
Creates new AbstractIOReactor instance.
selectTimeout | the select timeout. |
---|---|
interestOpsQueueing | Ops queueing flag. |
IOReactorException | in case if a non-recoverable I/O error. |
---|
Adds new channel entry. The channel will be asynchronously registered with the selector.
channelEntry | the channel entry. |
---|
Blocks for the given period of time in milliseconds awaiting the completion of the reactor shutdown.
timeout | the maximum wait time. |
---|
InterruptedException | if interrupted. |
---|
Returns true
if interest Ops queueing is enabled, false
otherwise.
Returns the current status of the reactor.
Attempts graceful shutdown of this I/O reactor.
Initiates shutdown of the reactor and blocks approximately for the given period of time in milliseconds waiting for the reactor to terminate all active connections, to shut down itself and to release system resources it currently holds.
gracePeriod | wait time in milliseconds. |
---|
IOReactorException |
---|
Initiates shutdown of the reactor and blocks for a default period of time waiting for the reactor to terminate all active connections, to shut down itself and to release system resources it currently holds. It is up to individual implementations to decide for how long this method can remain blocked.
IOReactorException |
---|
Triggered when the key signals OP_ACCEPT
readiness.
Super-classes can implement this method to react to the event.
key | the selection key. |
---|
Closes out all active channels registered with the selector of this I/O reactor.
IOReactorException | - not thrown currently |
---|
Closes out all new channels pending registration with the selector of this I/O reactor.
IOReactorException | - not thrown currently |
---|
Closes out all I/O sessions maintained by this I/O reactor.
Triggered when the key signals OP_CONNECT
readiness.
Super-classes can implement this method to react to the event.
key | the selection key. |
---|
Activates the I/O reactor. The I/O reactor will start reacting to I/O events and triggering notification methods.
This method will enter the infinite I/O select loop on
the Selector
instance associated with this I/O reactor.
The method will remain blocked unto the I/O reactor is shut down or the execution thread is interrupted.
InterruptedIOException | if the dispatch thread is interrupted. |
---|---|
IOReactorException | in case if a non-recoverable I/O error. |
Obtains IOSession
instance associated with the given selection
key.
key | the selection key. |
---|
Processes new event on the given selection key.
key | the selection key that triggered an event. |
---|
Queues the given I/O session to be processed asynchronously as closed.
session | the closed I/O session. |
---|
Triggered when the key signals OP_READ
readiness.
Super-classes can implement this method to react to the event.
key | the selection key. |
---|
Triggered when a session has been closed.
Super-classes can implement this method to react to the event.
session | closed I/O session. |
---|
Triggered when new session has been created.
Super-classes can implement this method to react to the event.
key | the selection key. |
---|---|
session | new I/O session. |
Triggered to verify whether the I/O session associated with the given selection key has not timed out.
Super-classes can implement this method to react to the event.
key | the selection key. |
---|---|
now | current time as long value. |
Triggered to validate keys currently registered with the selector. This method is called after each I/O select loop.
Super-classes can implement this method to run validity checks on active sessions and include additional processing that needs to be executed after each I/O select loop.
keys | all selection keys registered with the selector. |
---|
Triggered when the key signals OP_WRITE
readiness.
Super-classes can implement this method to react to the event.
key | the selection key. |
---|