org.atmosphere.annotation
Annotation Type Asynchronous


@Target(value=METHOD)
@Retention(value=RUNTIME)
@Documented
public @interface Asynchronous

Suspend the response and use the Broadcaster associated with HeaderConfig.X_ATMOSPHERE_TRACKING_ID to publish the result.

Author:
Jeanfrancois Arcand

Optional Element Summary
 Class<? extends BroadcastFilter>[] broadcastFilter
          Add BroadcastFilter to the broadcast operation.
 Class<? extends AtmosphereResourceEventListener>[] eventListeners
          Add AtmosphereResourceEventListener to the broadcast operation.
 String header
          The header value used to create a Broadcaster that will be used to broadcast the asynchronous execution.
 int period
          The time a connection will be suspended if no broadcast happens.
 boolean waitForResource
          Wait for AtmosphereResource before executing the Broadcaster.awaitAndBroadcast(Object, long, java.util.concurrent.TimeUnit).
 boolean writeEntity
          Write the returned entity back to the calling connection.
 

waitForResource

public abstract boolean waitForResource
Wait for AtmosphereResource before executing the Broadcaster.awaitAndBroadcast(Object, long, java.util.concurrent.TimeUnit).

Returns:
true if the broadcast operation must wait before executing.
Default:
true

broadcastFilter

public abstract Class<? extends BroadcastFilter>[] broadcastFilter
Add BroadcastFilter to the broadcast operation.

Default:
{}

header

public abstract String header
The header value used to create a Broadcaster that will be used to broadcast the asynchronous execution.

Returns:
The header value used to create a Broadcaster
Default:
"X-Atmosphere-tracking-id"

period

public abstract int period
The time a connection will be suspended if no broadcast happens. Same as Suspend.period()

Returns:
The time a connection will be suspended if no broadcast happens.
Default:
300000

eventListeners

public abstract Class<? extends AtmosphereResourceEventListener>[] eventListeners
Add AtmosphereResourceEventListener to the broadcast operation.

Default:
{}

writeEntity

public abstract boolean writeEntity
Write the returned entity back to the calling connection. Default is false.

Returns:
true if the entity needs to be written back to the calling connection.
Default:
true


Copyright © 2012. All Rights Reserved.