|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.cosylab.epics.caj.impl.reactor.Reactor
public class Reactor
Implementation of reactor pattern using java.nio.channels.Selector.
| Constructor Summary | |
|---|---|
Reactor()
Creates a new instance of reactor. |
|
| Method Summary | |
|---|---|
void |
disableSelectionKey(SelectionKey key)
Disable selection key - sets its interest ops to 0 and stores its current interest ops (to be restored). |
void |
enableSelectionKey(SelectionKey key)
Enable selection key - restore its interest ops. |
boolean |
isShutdown()
Get shutdown status. |
boolean |
process()
Process requests. |
SelectionKey |
register(SelectableChannel selectableChannel,
int interestOps,
ReactorHandler handler)
Registers SelectableChannel to the reactor. |
void |
setInterestOps(AbstractSelectableChannel channel,
int interestOps)
Change SelectionKey operations of interest. |
void |
shutdown()
Shutdown the reactor. |
void |
unregisterAndClose(SelectableChannel selectableChannel)
Deregisters SelectableChannel from the reactor. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Reactor()
throws IOException
IOException| Method Detail |
|---|
public boolean process()
false is returned.
true if selector is stil active, false when shutdown.public void unregisterAndClose(SelectableChannel selectableChannel)
SelectableChannel from the reactor.
selectableChannel - channel to be unregistered.
public SelectionKey register(SelectableChannel selectableChannel,
int interestOps,
ReactorHandler handler)
throws ClosedChannelException
SelectableChannel to the reactor.
selectableChannel - channel to be registered.interestOps - operations suppored by channel (i.e. operations of interest).handler - handle to process requests.
ClosedChannelExceptionpublic void disableSelectionKey(SelectionKey key)
key - selection key to be disabled.public void enableSelectionKey(SelectionKey key)
key - selection key to be enabled.
public void setInterestOps(AbstractSelectableChannel channel,
int interestOps)
SelectionKey operations of interest.
channel - interestOps - public void shutdown()
public boolean isShutdown()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||