As soom as {@link #addCometHandler} is invoked, Grizzly will automaticallysuspend the request/response (will not commit the response). A response can be resumed by invoking {@link resumeCometHandler}, which will automatically commit the response and remove the associated CometHandler from the CometContext. A CometContext uses a {@link NotificationHandler} to invoke, using the callingthread or a Grizzly thread pool, all CometHandler than have been added using the {@link #addCometHandler}. A {@link NotificationHandler} can be used to filteror transform the content that will eventually be pushed back to all connected clients. You can also use a {@link NotificationHandler} to throttle push likeinvoking only a subset of the CometHandler, etc.
Attributes can be added/removed the same way {@link HttpServletSession} is doing. It is not recommended to use attributes if this {@link CometContext} is not shared amongs multiplecontext path (uses {@link HttpServletSession} instead).
@author Jeanfrancois Arcand
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|