Annotation Type 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
      java.lang.Class<? extends org.atmosphere.cpr.BroadcastFilter>[] broadcastFilter
      Add BroadcastFilter to the broadcast operation.
      java.lang.String contentType
      If the @Produces annotation is missing, this value will be used instead.
      java.lang.Class<? extends org.atmosphere.cpr.AtmosphereResourceEventListener>[] eventListeners
      Add AtmosphereResourceEventListener to the broadcast operation.
      java.lang.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.
    • Element Detail

      • 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

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

        java.lang.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

        java.lang.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

        java.lang.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:
        ""