org.atmosphere.samples.counter
Class CounterLongPollingAtmosphereHandler
java.lang.Object
org.atmosphere.samples.counter.CounterLongPollingAtmosphereHandler
- All Implemented Interfaces:
- AtmosphereHandler<HttpServletRequest,HttpServletResponse>
public class CounterLongPollingAtmosphereHandler
- extends Object
- implements AtmosphereHandler<HttpServletRequest,HttpServletResponse>
Simple application that demonstrate how a Comet long poll request can be implemented.
Mainly, the client send a GET, the AtmosphereHandler suspend the connection. As
soon a POST request arrive, the underlying response is resumed.
- Author:
- jeanfrancoisarcand
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CounterLongPollingAtmosphereHandler
public CounterLongPollingAtmosphereHandler()
onEvent
public AtmosphereEvent onEvent(AtmosphereEvent<HttpServletRequest,HttpServletResponse> event)
throws IOException
- On GET, suspend the conneciton. On POST, resume the connection.
- Specified by:
onEvent in interface AtmosphereHandler<HttpServletRequest,HttpServletResponse>
- Parameters:
event -
- Returns:
-
- Throws:
IOException
onMessage
public AtmosphereEvent onMessage(AtmosphereEvent<HttpServletRequest,HttpServletResponse> event)
throws IOException
- Resume the underlying response on the first
Broadcast
- Specified by:
onMessage in interface AtmosphereHandler<HttpServletRequest,HttpServletResponse>
- Parameters:
event -
- Returns:
-
- Throws:
IOException
Copyright © 2009 SUN Microsystems. All Rights Reserved.