|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface SelectionKeyHandler
A SelectionKeyHandler is used to handle the life cycle of a SelectionKey. Operations like cancelling, registering or closing are handled by SelectionKeyHandler.
| Method Summary | |
|---|---|
void |
cancel(SelectionKey key)
Cancel a SelectionKey and close its Channel. |
void |
close(SelectionKey key)
Close the SelectionKey's channel input or output, but keep alive the SelectionKey. |
void |
expire(Iterator<SelectionKey> keyIterator)
Expire a SelectionKey set. |
void |
expire(SelectionKey key,
long currentTime)
Deprecated. |
SelectorHandler |
getSelectorHandler()
Get associated SelectorHandler |
void |
postProcess(SelectionKey key)
SelectionKey post process notification |
void |
process(SelectionKey key)
SelectionKey process notification |
void |
register(Iterator<SelectionKey> keyIterator,
int selectionKeyOps)
Register a set of SelectionKeys. |
void |
register(SelectableChannel channel,
int selectionKeyOps)
Register a SelectableChannel on Selector. |
void |
register(SelectionKey key,
int selectionKeyOps)
Register a SelectionKey on Selector. |
void |
register(SelectionKey key,
long currentTime)
Deprecated. |
void |
setSelectorHandler(SelectorHandler selectorHandler)
Set associated SelectorHandler |
| Methods inherited from interface com.sun.grizzly.util.Copyable |
|---|
copyTo |
| Method Detail |
|---|
SelectorHandler getSelectorHandler()
SelectorHandler
void setSelectorHandler(SelectorHandler selectorHandler)
SelectorHandler
void process(SelectionKey key)
SelectionKey process notification
key - SelectionKey to processvoid postProcess(SelectionKey key)
SelectionKey post process notification
key - SelectionKey to process
void register(SelectionKey key,
long currentTime)
key - SelectionKey to registercurrentTime - the System.currentTimeMillis
void register(SelectionKey key,
int selectionKeyOps)
SelectionKey on Selector.
key - SelectionKeyselectionKeyOps - The interest set to apply when registering.
to register
void register(SelectableChannel channel,
int selectionKeyOps)
throws ClosedChannelException
SelectableChannel on Selector.
channel - SelectableChannelselectionKeyOps - The interest set to apply when registering.
to register
ClosedChannelException
void register(Iterator<SelectionKey> keyIterator,
int selectionKeyOps)
SelectionKeys.
Note: After processing each SelectionKey it should be
removed from Iterator
selectionKeySet - Iterator of SelectionKeysselectionKeyOps - The interest set to apply when registering.
to register
void expire(SelectionKey key,
long currentTime)
SelectionKey. If a SelectionKey is
inactive for certain time (timeout), the SelectionKey
will be cancelled and its associated Channel closed.
key - SelectionKey to expirecurrentTime - the System.currentTimeMillisvoid expire(Iterator<SelectionKey> keyIterator)
SelectionKey set. Method checks
each SelectionKey from theSet. And if
a SelectionKey is inactive for certain time (timeout),
the SelectionKey will be cancelled and its associated Channel closed.
keyIterator - Iterator of SelectionKeys
to expirevoid cancel(SelectionKey key)
key - SelectionKey to cancelvoid close(SelectionKey key)
key - SelectionKey to close
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||