Package org.atmosphere.annotation
Annotation 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
Optional ElementsModifier and TypeOptional ElementDescriptionClass<? extends org.atmosphere.cpr.BroadcastFilter>[]AddBroadcastFilterto the broadcast operation.If the @Produces annotation is missing, this value will be used instead.Class<? extends org.atmosphere.cpr.AtmosphereResourceEventListener>[]AddAtmosphereResourceEventListenerto the broadcast operation.The header value used to create aBroadcasterthat will be used to broadcast the asynchronous execution.intThe time a connection will be suspended if no broadcast happens.booleanWait forAtmosphereResourcebefore executing theBroadcaster.awaitAndBroadcast(Object, long, java.util.concurrent.TimeUnit).booleanWrite the returned entity back to the calling connection.
-
Element Details
-
waitForResource
boolean waitForResourceWait forAtmosphereResourcebefore executing theBroadcaster.awaitAndBroadcast(Object, long, java.util.concurrent.TimeUnit).- Returns:
- true if the broadcast operation must wait before executing.
- Default:
true
-
broadcastFilter
Class<? extends org.atmosphere.cpr.BroadcastFilter>[] broadcastFilterAddBroadcastFilterto the broadcast operation.- Default:
{}
-
header
String headerThe header value used to create aBroadcasterthat will be used to broadcast the asynchronous execution.- Returns:
- The header value used to create a
Broadcaster
- Default:
"X-Atmosphere-tracking-id"
-
period
int periodThe time a connection will be suspended if no broadcast happens. Same asSuspend.period()- Returns:
- The time a connection will be suspended if no broadcast happens.
- Default:
300000
-
eventListeners
Class<? extends org.atmosphere.cpr.AtmosphereResourceEventListener>[] eventListenersAddAtmosphereResourceEventListenerto the broadcast operation.- Default:
{}
-
writeEntity
boolean writeEntityWrite 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
-
contentType
String contentTypeIf the @Produces annotation is missing, this value will be used instead.- Returns:
- the default content-type used if the @Produces annotation is missing.
- Default:
""
-