|
||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||
java.lang.Objectcom.nec.webotx.enterprise.web.connector.grizzly.comet.CometEngine
public class 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:
CometEngine cometEngine = CometEngine.getEngine()CometContext cometContext = cometEngine.register(contextPath)
CometHandler to theCometContext returned by the register method:cometContext.addCometHandler(handler);
CometHandler by doing:cometContext.notify(Object)(handler);
| フィールドの概要 | |
|---|---|
static int |
AFTER_RESPONSE_PROCESSING
The token used to support BEFORE_RESPONSE_PROCESSING polling. |
static int |
AFTER_SERVLET_PROCESSING
The token used to support AFTER_SERVLET_PROCESSING polling. |
static int |
BEFORE_REQUEST_PROCESSING
The token used to support BEFORE_REQUEST_PROCESSING polling. |
| メソッドの概要 | |
|---|---|
protected java.nio.channels.SelectionKey |
activateContinuation(java.lang.Long threadId,
CometContext cometContext,
boolean continueExecution)
Tell the CometEngine to activate Grizzly ARP on that CometContext. |
CometContext |
getCometContext(java.lang.String contextPath)
Return the CometContext associated with the cometContext path. |
protected CometTask |
getCometTask(CometContext cometContext,
java.nio.channels.SelectionKey key,
Pipeline ctxPipeline)
Return a clean and configured CometTask |
static CometEngine |
getEngine()
Return a singleton of this Class. |
static java.lang.String |
getNotificationHandlerClassName()
|
protected boolean |
handle(AsyncProcessorTask apt)
Handle an interrupted(or polled) request by matching the current context path with the registered one. |
protected void |
interrupt(java.nio.channels.SelectionKey key)
The CometSelector is expiring idle SelectionKey,
hence we need to resume the current request. |
static java.util.logging.Logger |
logger()
Return the current logger. |
CometContext |
register(java.lang.String contextPath)
Register a context path with this CometEngine. |
CometContext |
register(java.lang.String contextPath,
int type)
Register a context path with this CometEngine. |
protected void |
resume(java.nio.channels.SelectionKey key,
CometContext cometContext)
Resume the long polling request by unblocking the current SelectionKey |
protected void |
returnTask(CometTask cometTask)
Return a Task to the pool. |
static void |
setNotificationHandlerClassName(java.lang.String aNotificationHandlerClassName)
|
CometContext |
unregister(java.lang.String contextPath)
Unregister the CometHandler to the list of the
CometContext. |
| クラス java.lang.Object から継承されたメソッド |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| フィールドの詳細 |
|---|
public static final int BEFORE_REQUEST_PROCESSING
public static final int AFTER_SERVLET_PROCESSING
public static final int AFTER_RESPONSE_PROCESSING
| メソッドの詳細 |
|---|
public static final CometEngine getEngine()
public CometContext unregister(java.lang.String contextPath)
CometHandler to the list of the
CometContext.
public CometContext register(java.lang.String contextPath)
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.
contextPath - the context path used to create the
CometContext
CometContext.
public CometContext register(java.lang.String contextPath,
int type)
CometEngine. The
CometContext returned will be of type
type.
contextPath - the context path used to create the
CometContext
CometContext.
protected boolean handle(AsyncProcessorTask apt)
throws java.io.IOException
CometHandler
apt - the current apt representing the request.
java.io.IOException
protected java.nio.channels.SelectionKey activateContinuation(java.lang.Long threadId,
CometContext cometContext,
boolean continueExecution)
threadId - the Thread.getId().cometContext - An instance of CometContext.
protected CometTask getCometTask(CometContext cometContext,
java.nio.channels.SelectionKey key,
Pipeline ctxPipeline)
CometTask
cometContext - the CometContext to cleankey - The current SelectionKey
public CometContext getCometContext(java.lang.String contextPath)
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.
contextPath - the request's cometContext path.protected void interrupt(java.nio.channels.SelectionKey key)
CometSelector is expiring idle SelectionKey,
hence we need to resume the current request.
key - the expired SelectionKeyprotected void returnTask(CometTask cometTask)
Task to the pool.
protected void resume(java.nio.channels.SelectionKey key,
CometContext cometContext)
SelectionKey
public static java.lang.String getNotificationHandlerClassName()
public static void setNotificationHandlerClassName(java.lang.String aNotificationHandlerClassName)
public static final java.util.logging.Logger logger()
|
||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||