Using the MeteorService Annotation - Atmosphere/atmosphere GitHub Wiki
The MeteorService can be used to configure existing Servlet based Application. Any Servlet can be simply annotated and can start using the Atmosphere's Meteor API. As simple as this
@MeteorService
The annotation's attributes available are
path
: The path to the resource. The default is "/" so if your have mapped the MeteorServlet to '/*', all request will be delivered to your annotated class. You can also customize the path. The path value will be used to associate the AtmosphereResource with a Broadcaster, and the Broadcater's getID() will be the path value.listeners
: Add one or several AtmosphereResourceEventListener. Usefull if your application needs to execute some actions based on the AtmosphereResource's life cycle.broadcaster
: The Broadcaster to use for every request. The default is the DefaultBroadcasterinterceptors
: The list of AtmosphereInterceptor. It is strongly recommended to install one or all of the following interceptor to simplify your application's code: AtmosphereResourceLifecycleInterceptor, TrackMessageSizeInterceptor, HeartbeatInterceptor, SuspendTrackerInterceptor.atmosphereConfig
: Configure some ApplicationConfig properties. Those properties can be used to configure the Atmosphere's runtime. Default is empty.broadcasterCache
: Install a BroadcasterCache to repent loosing messages when a network outage happens.. Default is UUIDBroadcasterCachebroadcastFilters
: Install BroadcastFilter for manipulating messages before they get delivered to the client. Default is empty.supportSession
: Set to true if HttpSession needs to be supported. Default is false.
Class Scope Annotations available
@Singleton
The Singleton annotation can be used to force Atmosphere to create a single, thread safe instance of a MeteorService annotated classes. For example, if your application set the @MeteorService's path attribute with using path templates {something}
, by default a new instance of the annotated classes will be created. When annotated with Singleton, a single class will be created.