|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.grizzly.BaseSelectionKeyHandler
com.sun.grizzly.DefaultSelectionKeyHandler
com.sun.grizzly.http.SelectorThreadKeyHandler
public class SelectorThreadKeyHandler
Default HTTP SelectionKeyHandler implementation
Field Summary | |
---|---|
protected ConcurrentLinkedQueue<SelectionKey> |
bannedKeys
Banned SelectionKey registration. |
Fields inherited from class com.sun.grizzly.DefaultSelectionKeyHandler |
---|
nextKeysExpiration, timeout |
Fields inherited from class com.sun.grizzly.BaseSelectionKeyHandler |
---|
logger, selectorHandler |
Constructor Summary | |
---|---|
SelectorThreadKeyHandler()
|
|
SelectorThreadKeyHandler(SelectorThread selectorThread)
|
Method Summary | |
---|---|
void |
addBannedSelectionKey(SelectionKey key)
Add a SelectionKey to the banned list of SelectionKeys. |
void |
cancel(SelectionKey key)
Cancel a SelectionKey and close its associated Channel. |
void |
copyTo(Copyable copy)
Copies current object content to copy object |
void |
doRegisterKey(SelectionKey key,
int ops,
long currentTime)
Registers SelectionKey to handle certain operations |
void |
expire(Iterator<SelectionKey> keys)
Expire a SelectionKey set. |
Methods inherited from class com.sun.grizzly.DefaultSelectionKeyHandler |
---|
clearKeyAttachment, expire, getTimeout, postProcess, process, register, register, register, register, setTimeout |
Methods inherited from class com.sun.grizzly.BaseSelectionKeyHandler |
---|
cancelKey, close, closeChannel, closeChannel, doRegisterKey, getLogger, getSelectorHandler, keyIsValid, setLogger, setSelectorHandler |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected ConcurrentLinkedQueue<SelectionKey> bannedKeys
Constructor Detail |
---|
public SelectorThreadKeyHandler()
public SelectorThreadKeyHandler(SelectorThread selectorThread)
Method Detail |
---|
public void copyTo(Copyable copy)
DefaultSelectionKeyHandler
copyTo
in interface Copyable
copyTo
in class DefaultSelectionKeyHandler
copy
- represents target object, where current object's content will be copiedpublic void doRegisterKey(SelectionKey key, int ops, long currentTime)
DefaultSelectionKeyHandler
SelectionKey
to handle certain operations
doRegisterKey
in class DefaultSelectionKeyHandler
public void expire(Iterator<SelectionKey> keys)
DefaultSelectionKeyHandler
SelectionKey
set. Method checks
each SelectionKey
from the Set
. And if
a SelectionKey
is inactive for certain time (timeout),
the SelectionKey
will be cancelled and its associated Channel closed.
expire
in interface SelectionKeyHandler
expire
in class DefaultSelectionKeyHandler
keys
- Iterator
of SelectionKey
s
to expirepublic void cancel(SelectionKey key)
BaseSelectionKeyHandler
cancel
in interface SelectionKeyHandler
cancel
in class BaseSelectionKeyHandler
key
- SelectionKey
to cancelpublic void addBannedSelectionKey(SelectionKey key)
SelectionKey
to the banned list of SelectionKeys.
A SelectionKey is banned when new registration aren't allowed on the
Selector.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |