|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Reactor
The Reactor interface is used to describe an object
that is used to schedule asynchronous I/O operations. An operation
is performed by handing it to the reactor, which will determine
if an interested event has occurred. This allows the operation to
perform the task in a manner that does not block.
Implementing an Operation object requires that the
operation itself is aware of the I/O task it is performing. For
example, if the operation is concerned with reading data from the
underlying channel then the operation should perform the read, if
there is more data required then that operation to register with
the reactor again to receive further notifications.
Operation| Method Summary | |
|---|---|
void |
process(Operation task)
This method is used to execute the provided operation without the need to specifically check for I/O events. |
void |
process(Operation task,
int require)
This method is used to execute the provided operation when there is an I/O event that task is interested in. |
void |
stop()
This is used to stop the reactor so that further requests to execute operations does nothing. |
| Method Detail |
|---|
void process(Operation task)
throws IOException
SelectableChannel is
ready, or if the I/O operation can be performed without knowing
if the channel is ready. Typically this is an efficient means
to perform a poll rather than a select on the channel.
task - this is the task to execute immediately
IOException
void process(Operation task,
int require)
throws IOException
SelectableChannel object to determine
the events that are ready on the channel. If this reactor is
interested in any of the ready events then the task is executed.
task - this is the task to execute on interested eventsrequire - this is the bitmask value for interested events
IOException
void stop()
throws IOException
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||