Annotation Interface Asynchronous


@Target(METHOD) @Retention(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

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Class<? extends org.atmosphere.cpr.BroadcastFilter>[]
    Add BroadcastFilter to the broadcast operation.
    If the @Produces annotation is missing, this value will be used instead.
    Class<? extends org.atmosphere.cpr.AtmosphereResourceEventListener>[]
    Add AtmosphereResourceEventListener to the broadcast operation.
    The header value used to create a Broadcaster that will be used to broadcast the asynchronous execution.
    int
    The time a connection will be suspended if no broadcast happens.
    boolean
    Wait for AtmosphereResource before executing the Broadcaster.awaitAndBroadcast(Object, long, java.util.concurrent.TimeUnit).
    boolean
    Write the returned entity back to the calling connection.
  • Element Details

    • waitForResource

      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

      Class<? extends org.atmosphere.cpr.BroadcastFilter>[] broadcastFilter
      Add BroadcastFilter to the broadcast operation.
      Default:
      {}
    • header

      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

      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

      Class<? extends org.atmosphere.cpr.AtmosphereResourceEventListener>[] eventListeners
      Add AtmosphereResourceEventListener to the broadcast operation.
      Default:
      {}
    • writeEntity

      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
    • contentType

      String contentType
      If the @Produces annotation is missing, this value will be used instead.
      Returns:
      the default content-type used if the @Produces annotation is missing.
      Default:
      ""