com.sun.enterprise.web.connector.grizzly.comet
Class CometContext<E>

java.lang.Object
  extended by com.sun.grizzly.comet.CometContext<E>
      extended by com.sun.enterprise.web.connector.grizzly.comet.CometContext<E>

Deprecated. use CometContext

public class CometContext<E>
extends 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).

Author:
Jeanfrancois Arcand

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 com.sun.grizzly.comet.CometContext
addActiveCometTask, addAttribute, addCometHandler, addCometHandler, addInProgressSelectionKey, getAttribute, getCometHandler, getContextPath, getExpirationDelay, getNotificationHandler, interrupt, isActive, isBlockingNotification, isCancelled, notify, notify, recycle, registerAsyncRead, registerAsyncWrite, removeAttribute, removeCometHandler, removeInProgressSelectionKey, resetSuspendIdleTimeout, resumeCometHandler, resumeCometHandler, setBlockingNotification, setCancelled, setExpirationDelay, setNotificationHandler, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CometContext

public CometContext(String contextPath,
                    int continuationType)
Deprecated. 

Method Detail

setCometSelector

protected void setCometSelector(CometSelector cometSelector)
Deprecated. 
Set the CometSelector associated with this instance.

Overrides:
setCometSelector in class CometContext<E>

addCometHandler

public int addCometHandler(CometHandler handler,
                           boolean completeExecution)
Deprecated. 


addCometHandler

public int addCometHandler(CometHandler handler)
Deprecated. 


getCometHandler

public CometHandler getCometHandler(int hashCode)
Deprecated. 
Retrive a CometHandler using its hashKey;

Overrides:
getCometHandler in class CometContext<E>

removeCometHandler

public void removeCometHandler(CometHandler handler)
Deprecated. 


removeCometHandler

public void removeCometHandler(int hashCode)
Deprecated. 
Remove a CometHandler based on its hashcode.

Overrides:
removeCometHandler in class CometContext<E>

resumeCometHandler

public void resumeCometHandler(CometHandler handler)
Deprecated. 


notify

public void notify(E attachment)
            throws IOException
Deprecated. 
Notify all CometHandler. The attachment can be null. All CometHandler.onEvent() will be invoked.

Overrides:
notify in class CometContext<E>
Parameters:
attachment - An object shared amongst CometHandler.
Throws:
IOException

isActive

public boolean isActive(CometHandler cometHandler)
Deprecated. 


notify

public void notify(E attachment,
                   int eventType,
                   int cometHandlerID)
            throws IOException
Deprecated. 
Notify a single 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
 

Overrides:
notify in class CometContext<E>
Parameters:
attachment - An object shared amongst CometHandler.
cometHandlerID - Notify a single CometHandler.
Throws:
IOException

initialize

protected void initialize(SelectionKey key)
                   throws IOException
Deprecated. 
Initialize the newly added CometHandler.

Overrides:
initialize in class CometContext<E>
Parameters:
key - The SelectionKey representing the CometHandler.
Throws:
IOException


Copyright © 2011 SUN Microsystems. All Rights Reserved.