com.sun.enterprise.web.connector.grizzly.comet
Class CometEngine

java.lang.Object
  extended by com.sun.grizzly.comet.CometEngine
      extended by com.sun.enterprise.web.connector.grizzly.comet.CometEngine

Deprecated. - Use CometEngine

public class CometEngine
extends CometEngine

Main class allowing Comet support on top of Grizzly Asynchronous Request Processing mechanism. This class is the entry point to any component interested to execute Comet request style. Components can be Servlets, JSP, JSF or pure Java class. A component interested to support Comet request must do: (1) First, register the cometContext path on which Comet support will be applied: CometEngine cometEngine = CometEngine.getEngine() CometContext cometContext = cometEngine.register(contextPath) (2) Second, add an instance of CometHandler to the CometContext returned by the register method: cometContext.addCometHandler(handler); (3) Finally, you can notify other CometHandler by doing: cometContext.notify(Object)(handler); You can also select the stage where the request polling happens when registering the cometContext path (see register(String,int);

Author:
Jeanfrancois Arcand

Field Summary
 
Fields inherited from class com.sun.grizzly.comet.CometEngine
activeContexts, AFTER_RESPONSE_PROCESSING, AFTER_SERVLET_PROCESSING, BEFORE_REQUEST_PROCESSING, cometContexts, cometSelector, cometTasks, notificationHandlerClassName, pipeline, threadsId, updatedCometContexts
 
Constructor Summary
CometEngine()
          Deprecated.  
 
Method Summary
 CometContext getCometContext(String contextPath)
          Deprecated. Return the CometContext associated with the cometContext path.
static CometEngine getEngine()
          Deprecated. 
 CometContext register(String contextPath)
          Deprecated. Register a context path with this CometEngine.
 CometContext register(String contextPath, int type)
          Deprecated. Register a context path with this CometEngine.
 
Methods inherited from class com.sun.grizzly.comet.CometEngine
activateContinuation, getCometTask, getNotificationHandlerClassName, handle, interrupt, loadNotificationHandlerInstance, logger, resume, returnTask, setNotificationHandlerClassName, unregister
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CometEngine

public CometEngine()
Deprecated. 
Method Detail

getEngine

public static CometEngine getEngine()
Deprecated. 


register

public CometContext register(String contextPath)
Deprecated. 
Register a context path with this CometEngine. The CometContext returned will be of type AFTER_SERVLET_PROCESSING, which means the request target (most probably a Servlet) will be executed first and then polled.

Overrides:
register in class CometEngine
Parameters:
contextPath - the context path used to create the CometContext
Returns:
CometContext a configured CometContext.

register

public CometContext register(String contextPath,
                             int type)
Deprecated. 
Register a context path with this CometEngine. The CometContext returned will be of type type.

Overrides:
register in class CometEngine
Parameters:
contextPath - the context path used to create the CometContext
Returns:
CometContext a configured CometContext.

getCometContext

public CometContext getCometContext(String contextPath)
Deprecated. 
Return the CometContext associated with the cometContext path. XXX: This is not secure as a you can get a CometContext associated with another cometContext path. But this allow interesting application... MUST BE REVISTED.

Overrides:
getCometContext in class CometEngine
Parameters:
contextPath - the request's cometContext path.


Copyright © 2008 SUN Microsystems. All Rights Reserved.