|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.grizzly.util.SelectionKeyAttachment
com.sun.grizzly.util.SelectedKeyAttachmentLogic
com.sun.grizzly.comet.CometTask
public class CometTask
A Task
implementation that allow Grizzly ARP to invokeCometHandler
CometHandler
when new data (bytes) are available from the
CometSelector
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.sun.grizzly.util.SelectionKeyAttachment |
---|
SelectionKeyAttachment.KeySelectionListener, SelectionKeyAttachment.TimeOutListener |
Field Summary | |
---|---|
protected AsyncProcessorTask |
asyncProcessorTask
The AsyncProcessorTask |
protected boolean |
callInterrupt
true if run() should call comet context.interrupt0 |
protected CometContext |
cometContext
The CometContext associated with this instance. |
protected CometHandler |
cometHandler
The CometHandler associated with this task. |
protected boolean |
cometHandlerIsAsyncRegistered
true if comet handler is registered for async IO in comet context. |
protected boolean |
upcoming_op_isread
The current non blocking operation. |
Fields inherited from class com.sun.grizzly.util.SelectionKeyAttachment |
---|
DEREGISTERED, idleTimeoutDelay, keySelectionListener, timeout, timeoutListener, UNLIMITED_TIMEOUT |
Constructor Summary | |
---|---|
CometTask()
|
|
CometTask(CometContext cometContext,
CometHandler cometHandler)
New CometTask . |
Method Summary | |
---|---|
void |
doTask()
Notify the CometHandler that bytes are available for read. |
AsyncProcessorTask |
getAsyncProcessorTask()
returns the AsyncProcessorTask |
CometContext |
getCometContext()
Return the CometContext associated with this instance. |
CometHandler |
getCometHandler()
returns the CometHandler |
long |
getIdleTimeoutDelay()
Returns the idle timeout delay. |
SelectionKey |
getSelectionKey()
returns selection key |
boolean |
handleSelectedKey(SelectionKey selectionKey)
Used for completely custom selector.select logic. |
boolean |
isComethandlerAsyncRegistered()
returns true if the comet handler is registered for async io |
void |
release(SelectionKey selectionKey)
This should never be called for for comet, due to we are nulling the attachment and completely overriding the selector.select logic. called by grizzly when the selection key is canceled and its socket closed. |
void |
run()
Performs doTask() or cometContext.interrupt0 |
void |
setAsyncProcessorTask(AsyncProcessorTask asyncProcessorTask)
sets the AsyncProcessorTask |
void |
setComethandlerIsAsyncRegistered(boolean cometHandlerIsAsyncRegistered)
sets the comet task async interest flag in the comet task |
boolean |
timedOut(SelectionKey key)
called when idle timeout detected. |
Methods inherited from class com.sun.grizzly.util.SelectionKeyAttachment |
---|
getAttachment, getKeySelectionListener, getTimeout, getTimeoutListener, setIdleTimeoutDelay, setKeySelectionListener, setTimeout, setTimeoutListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final CometContext cometContext
CometContext
associated with this instance.
protected final CometHandler cometHandler
CometHandler
associated with this task.
protected AsyncProcessorTask asyncProcessorTask
AsyncProcessorTask
protected volatile boolean cometHandlerIsAsyncRegistered
protected boolean upcoming_op_isread
protected boolean callInterrupt
Constructor Detail |
---|
public CometTask()
public CometTask(CometContext cometContext, CometHandler cometHandler)
CometTask
.
Method Detail |
---|
public void run()
run
in interface Runnable
public long getIdleTimeoutDelay()
getIdleTimeoutDelay
in class SelectionKeyAttachment
public void release(SelectionKey selectionKey)
release
in class SelectionKeyAttachment
selectionKey
- public boolean timedOut(SelectionKey key)
timedOut
in class SelectionKeyAttachment
public boolean handleSelectedKey(SelectionKey selectionKey)
handleSelectedKey
in class SelectionKeyAttachment
public void doTask() throws IOException
CometHandler
that bytes are available for read.
The notification will invoke all CometContext
IOException
public void setComethandlerIsAsyncRegistered(boolean cometHandlerIsAsyncRegistered)
- public boolean isComethandlerAsyncRegistered()
public CometContext getCometContext()
CometContext
associated with this instance.
CometContext
associated with this
instance.public AsyncProcessorTask getAsyncProcessorTask()
AsyncProcessorTask
public void setAsyncProcessorTask(AsyncProcessorTask asyncProcessorTask)
AsyncProcessorTask
{@link
- AsyncProcessorTask }public SelectionKey getSelectionKey()
public CometHandler getCometHandler()
CometHandler
CometHandler
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |