org.atmosphere.config.service
Annotation Type AtmosphereService


@Target(value=TYPE)
@Retention(value=RUNTIME)
public @interface AtmosphereService

An annotation which acts exactly as a ManagedService annotated resource, but that can be used with frameworks like Jersey, Wicket or any framework running the Atmosphere Framework. The annotation allow configuring Atmosphere's components like Broadcaster, AtmosphereInterceptor, etc. This annotation doesn't install any Atmosphere Component like ManagedService, AtmosphereHandler or WebSocketHandler. The framework supporting the annotation must itself deploy an Atmosphere's Service when specified, The servlet() returned value will be used to install a ReflectorServletProcessor that will dispatch requests to the Servlet. You can customize the request dispatch by setting the dispatch() to false. When set to false, the ReflectorServletProcessor.onRequest(org.atmosphere.cpr.AtmosphereResource) will never be invoked.


Optional Element Summary
 String[] atmosphereConfig
          Atmosphere's configuration that will be passed to the associated AtmosphereHandler.
 Class<? extends Broadcaster> broadcaster
          The Broadcaster class name
 Class<? extends BroadcasterCache> broadcasterCache
          The BroadcasterCache class name
 Class<? extends BroadcastFilter>[] broadcastFilters
          A list of BroadcastFilter
 boolean dispatch
          Dispatch the managed AtmosphereResource to the mapped AtmosphereHandler.onRequest(org.atmosphere.cpr.AtmosphereResource).
 Class<? extends AtmosphereInterceptor>[] interceptors
          A list of AtmosphereInterceptor to install.
 Class<? extends AtmosphereResourceEventListener>[] listeners
          Add AtmosphereResourceEventListener to track internal events.
 String path
          The Servlet path instance to instantiate at startup.
 String servlet
          The Servlet instance to instantiate at startup.
 

listeners

public abstract Class<? extends AtmosphereResourceEventListener>[] listeners
Add AtmosphereResourceEventListener to track internal events.

Default:
{}

broadcastFilters

public abstract Class<? extends BroadcastFilter>[] broadcastFilters
A list of BroadcastFilter

Default:
{}

broadcaster

public abstract Class<? extends Broadcaster> broadcaster
The Broadcaster class name

Returns:
The Broadcaster class name
Default:
org.atmosphere.cpr.DefaultBroadcaster.class

interceptors

public abstract Class<? extends AtmosphereInterceptor>[] interceptors
A list of AtmosphereInterceptor to install. Default are TrackMessageSizeInterceptor and HeartbeatInterceptor

Default:
{org.atmosphere.client.TrackMessageSizeInterceptor.class, org.atmosphere.interceptor.HeartbeatInterceptor.class}

atmosphereConfig

public abstract String[] atmosphereConfig
Atmosphere's configuration that will be passed to the associated AtmosphereHandler. Configuration name and value is delimited by "=", and different configuration lines are separated by comma.

Default:
{}

broadcasterCache

public abstract Class<? extends BroadcasterCache> broadcasterCache
The BroadcasterCache class name

Returns:
The Broadcaster class name. Default is UUIDBroadcasterCache
Default:
org.atmosphere.cache.UUIDBroadcasterCache.class

servlet

public abstract String servlet
The Servlet instance to instantiate at startup.

Default:
""

path

public abstract String path
The Servlet path instance to instantiate at startup.

Default:
"/"

dispatch

public abstract boolean dispatch
Dispatch the managed AtmosphereResource to the mapped AtmosphereHandler.onRequest(org.atmosphere.cpr.AtmosphereResource). If set to false, no HTTP GET operations will invoke the ReflectorServletProcessor.onRequest(org.atmosphere.cpr.AtmosphereResource). The HTTP method can be customized using ApplicationConfig.ATMOSPHERERESOURCE_INTERCEPTOR_METHOD value via atmosphereConfig(). If the servlet() is undefined changing this value has no effect.

Default:
true


Copyright © 2013. All Rights Reserved.