org.atmosphere.samples.pubsub
Class AsynchronousAnnotation

java.lang.Object
  extended by org.atmosphere.samples.pubsub.AsynchronousAnnotation

public class AsynchronousAnnotation
extends Object

Simple Asynchronous sample that demonstrate how task can be asynchronously executed. This class support all protocol and use the HeaderConfig to create a single Broadcaster associated with the remote client.

Author:
Jeanfrancois Arcand

Constructor Summary
AsynchronousAnnotation()
           
 
Method Summary
 Callable<String> publish(String message)
          Asynchronously return a String.
 String subscribe()
          Suspend the connection, wait for a broadcast events.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AsynchronousAnnotation

public AsynchronousAnnotation()
Method Detail

subscribe

@Asynchronous
public String subscribe()
Suspend the connection, wait for a broadcast events.

Returns:

publish

@Asynchronous
public Callable<String> publish(String message)
Asynchronously return a String.

Parameters:
message - a message sent by the client.
Returns:
a Callable that will resume the suspended connection if long-polling/jsonp is used, or keep-alive the connection for websocket and http streaming.


Copyright © 2012. All Rights Reserved.