public class CounterHandler extends DefaultCometHandler<javax.servlet.http.HttpServletResponse>
Modifier and Type | Method and Description |
---|---|
void |
onEvent(CometEvent event)
Receive
CometEvent notification. |
void |
onInterrupt(CometEvent event)
Receive
CometEvent notification when the underlying tcp communication is resumed by Grizzly. |
getCometContext, getResponse, onInitialize, onTerminate, setCometContext, setResponse
public void onEvent(CometEvent event) throws IOException
CometHandler
CometEvent
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<javax.servlet.http.HttpServletResponse>
onEvent
in class DefaultCometHandler<javax.servlet.http.HttpServletResponse>
IOException
public void onInterrupt(CometEvent event) throws IOException
CometHandler
CometEvent
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<javax.servlet.http.HttpServletResponse>
onInterrupt
in class DefaultCometHandler<javax.servlet.http.HttpServletResponse>
IOException
Copyright © 2013 Oracle Corporation. All Rights Reserved.