|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.grizzly.comet.CometContext<E>
com.sun.enterprise.web.connector.grizzly.comet.CometContext<E>
CometContext
public class CometContext<E>
The main object used by CometHandler
.
The CometContext
is always available for CometHandler
and can be used to notify other CometHandler
.
Attributes can be added/removed the same way HttpServletSession
is doing. It is not recommended to use attributes if this
CometContext
is not shared amongs multiple
context path (uses HttpServletSession instead).
Field Summary |
---|
Fields inherited from class com.sun.grizzly.comet.CometContext |
---|
blockingNotification, cancelled, continuationType, handlers, INVALID_COMET_HANDLER, notificationHandler |
Constructor Summary | |
---|---|
CometContext(String contextPath,
int continuationType)
Deprecated. |
Method Summary | |
---|---|
int |
addCometHandler(CometHandler handler)
Deprecated. |
int |
addCometHandler(CometHandler handler,
boolean completeExecution)
Deprecated. |
CometHandler |
getCometHandler(int hashCode)
Deprecated. Retrive a CometHandler using its hashKey; |
protected void |
initialize(SelectionKey key)
Deprecated. Initialize the newly added CometHandler . |
boolean |
isActive(CometHandler cometHandler)
Deprecated. |
void |
notify(E attachment)
Deprecated. Notify all CometHandler . |
void |
notify(E attachment,
int eventType,
int cometHandlerID)
Deprecated. Notify a single CometHandler . |
void |
removeCometHandler(CometHandler handler)
Deprecated. |
void |
removeCometHandler(int hashCode)
Deprecated. Remove a CometHandler based on its hashcode. |
void |
resumeCometHandler(CometHandler handler)
Deprecated. |
protected void |
setCometSelector(CometSelector cometSelector)
Deprecated. Set the CometSelector associated with this instance. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public CometContext(String contextPath, int continuationType)
Method Detail |
---|
protected void setCometSelector(CometSelector cometSelector)
CometSelector
associated with this instance.
setCometSelector
in class CometContext<E>
public int addCometHandler(CometHandler handler, boolean completeExecution)
public int addCometHandler(CometHandler handler)
public CometHandler getCometHandler(int hashCode)
CometHandler
using its hashKey;
getCometHandler
in class CometContext<E>
public void removeCometHandler(CometHandler handler)
public void removeCometHandler(int hashCode)
CometHandler
based on its hashcode.
removeCometHandler
in class CometContext<E>
public void resumeCometHandler(CometHandler handler)
public void notify(E attachment) throws IOException
CometHandler
. The attachment can be null. All
CometHandler.onEvent()
will be invoked.
notify
in class CometContext<E>
attachment
- An object shared amongst CometHandler
.
IOException
public boolean isActive(CometHandler cometHandler)
public void notify(E attachment, int eventType, int cometHandlerID) throws IOException
CometHandler
. The attachment can be null.
The type
will determine which code>CometHandler
method will be invoked:
CometEvent.INTERRUPT -> CometHandler.onInterrupt
CometEvent.NOTIFY -> CometHandler.onEvent
CometEvent.INITIALIZE -> CometHandler.onInitialize
CometEvent.TERMINATE -> CometHandler.onTerminate
CometEvent.READ -> CometHandler.onEvent
notify
in class CometContext<E>
attachment
- An object shared amongst CometHandler
.cometHandlerID
- Notify a single CometHandler.
IOException
protected void initialize(SelectionKey key) throws IOException
CometHandler
.
initialize
in class CometContext<E>
key
- The SelectionKey representing the CometHandler.
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |