public class DefaultCometHandler<E> extends Object implements CometHandler<E>
| Constructor and Description |
|---|
DefaultCometHandler() |
DefaultCometHandler(CometContext<E> cometContext,
Response response) |
| Modifier and Type | Method and Description |
|---|---|
CometContext<E> |
getCometContext() |
Response |
getResponse() |
void |
onEvent(CometEvent event)
Receive
CometEvent notification. |
void |
onInitialize(CometEvent event)
Receive
CometEvent notification when Grizzly is about to suspend the connection. |
void |
onInterrupt(CometEvent event)
Receive
CometEvent notification when the underlying tcp communication is resumed by Grizzly. |
void |
onTerminate(CometEvent event)
Receive
CometEvent notification when the response is resumed by a CometHandler or by the CometContext |
void |
setCometContext(CometContext<E> cometContext) |
void |
setResponse(Response response) |
public DefaultCometHandler()
public DefaultCometHandler(CometContext<E> cometContext, Response response)
public Response getResponse()
getResponse in interface CometHandler<E>public void setResponse(Response response)
setResponse in interface CometHandler<E>public CometContext<E> getCometContext()
getCometContext in interface CometHandler<E>public void setCometContext(CometContext<E> cometContext)
setCometContext in interface CometHandler<E>public void onEvent(CometEvent event) throws IOException
CometHandlerCometEvent notification. This method will be invoked every time a CometContext.notify(E) is
invoked. The CometEvent will contains the message that can be pushed back to the remote client, cached or
ignored. This method can also be used to resume a connection once a notified by invoking CometContext.resumeCometHandler(org.glassfish.grizzly.comet.CometHandler).onEvent in interface CometHandler<E>IOExceptionpublic void onInitialize(CometEvent event) throws IOException
CometHandlerCometEvent notification when Grizzly is about to suspend the connection. This method is always
invoked during the processing of CometContext.addCometHandler(org.glassfish.grizzly.comet.CometHandler<E>) operations.onInitialize in interface CometHandler<E>IOExceptionpublic void onTerminate(CometEvent event) throws IOException
CometHandlerCometEvent notification when the response is resumed by a CometHandler or by the CometContextonTerminate in interface CometHandler<E>IOExceptionpublic void onInterrupt(CometEvent event) throws IOException
CometHandlerCometEvent notification when the underlying tcp communication is resumed by Grizzly. This happens
when the CometContext.setExpirationDelay(long) expires or when the remote client close the connection.onInterrupt in interface CometHandler<E>IOExceptionCopyright © 2018 Oracle Corporation. All Rights Reserved.