|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.simpleframework.transport.reactor.DirectReactor
public class DirectReactor
The DirectReactor
object is used to execute the ready
operations of within a single synchronous thread. This is used
when the I/O operations to be performed do not require much time
to execute and so will not block the execution thread.
Constructor Summary | |
---|---|
DirectReactor()
Constructor for the DirectReactor object. |
|
DirectReactor(boolean cancel)
Constructor for the DirectReactor object. |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DirectReactor() throws java.io.IOException
DirectReactor
object. This is
used to create a reactor that does not require thread pooling
to execute the ready operations. All I/O operations are run
in the selection thread and should complete quickly.
java.io.IOException
public DirectReactor(boolean cancel) throws java.io.IOException
DirectReactor
object. This is
used to create a reactor that does not require thread pooling
to execute the ready operations. All I/O operations are run
in the selection thread and should complete quickly.
cancel
- determines the selection key should be canceled
java.io.IOException
Method Detail |
---|
public void process(Operation task) throws java.io.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.
process
in interface Reactor
task
- this is the task to execute immediately
java.io.IOException
public void process(Operation task, int require) throws java.io.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.
process
in interface Reactor
task
- this is the task to execute on interested eventsrequire
- this is the bit-mask value for interested events
java.io.IOException
public void stop() throws java.io.IOException
stop
in interface Reactor
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |