org.atmosphere.samples.rest.counter
Class RestLongPolling

java.lang.Object
  extended by org.atmosphere.samples.rest.counter.RestLongPolling

@Singleton
public class RestLongPolling
extends Object

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

Constructor Summary
RestLongPolling()
           
 
Method Summary
 String increment(String count)
           
 String suspend()
          On GET, suspend the conneciton.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RestLongPolling

public RestLongPolling()
Method Detail

suspend

public String suspend()
On GET, suspend the conneciton. On POST, resume the connection.

Parameters:
event -
Returns:
Throws:
IOException

increment

@ResumeOnBroadcast
public String increment(String count)


Copyright © 2009 SUN Microsystems. All Rights Reserved.