Package org.atmosphere.annotation
Annotation Interface Suspend
Suspend the underlying response. Once suspended, a response might be allowed
to consume
Broadcast events, depending on the scope ([@link Suspend#SCOPE}).
By default, a suspended response is suspended able to consume
any broadcasted events executed inside the same application (SCOPE.APPLICATION).
The period can also be per suspended response (SCOPE.REQUEST) or available to other
application (SCOPE.VM).- Author:
- Jeanfrancois Arcand
-
Nested Class Summary
Nested Classes -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionIf the @Produces annotation is missing, this value will be used instead.Class<? extends org.atmosphere.cpr.AtmosphereResourceEventListener>[]AddAtmosphereResourceEventListenerto track internal events.booleanDeprecated.intHow long a response stay suspended intimeUnit(), default is -1booleanResume all suspended response on the first broadcast operation.The Scope of theBroadcasterthat will be created once the response gets suspended.booleanWrite the returned entity back to the calling connection.
-
Element Details
-
period
int periodHow long a response stay suspended intimeUnit(), default is -1- Returns:
- Default:
-1
-
timeUnit
TimeUnit timeUnit- Returns:
- Default:
MILLISECONDS
-
scope
Suspend.SCOPE scopeThe Scope of theBroadcasterthat will be created once the response gets suspended. One final word on Broadcaster: by default, a Broadcaster will broadcast using all resources/classes on which the response has been suspended. This behavior is configurable and you can configure it setting the appropriate scope- REQUEST: broadcast events only to the suspended response associated with the current request.
- APPLICATION: broadcast events to all suspended responses associated with the current application.
- VM: broadcast events to all suspended responses created inside the current virtual machine.
- Returns:
- The Scope of the
Broadcasterthat will be created once the response gets suspended.
- Default:
APPLICATION
-
outputComments
Deprecated.By default, output some comments when suspending the connection. Deprecated. No longer required- Default:
true
-
resumeOnBroadcast
boolean resumeOnBroadcastResume all suspended response on the first broadcast operation.- Default:
false
-
listeners
Class<? extends org.atmosphere.cpr.AtmosphereResourceEventListener>[] listenersAddAtmosphereResourceEventListenerto track internal events.- 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:
""
-