public class Reactor extends Object
java.nio.channels.Selector.| Constructor and Description |
|---|
Reactor()
Creates a new instance of reactor.
|
| Modifier and Type | Method and Description |
|---|---|
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. |
public Reactor()
throws IOException
IOExceptionpublic 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()
Copyright © 2004-2020 EPICS. All Rights Reserved.