Skip to content

Using AtmosphereService Annotation

ntrp edited this page Nov 20, 2014 · 3 revisions

The AtmosphereService annotation can be used with existing framework in order to configure Atmosphere at deployment time. For example, you can use this annotation with the Atmosphere-Jersey module to configure AtmosphereInterceptor, BroadcasterCache, etc. You can also use this annotation with other framework. For example, running Jersey 2 resource can be easily done by just doing this.

The Attributes availables are:

  • atmosphereConfig: Configure Atmosphere's property, as defined here. Default is empty.
  • broadcaster: The Broadcaster to use for every request. The default is the DefaultBroadcaster
  • broadcasterCache: Install a BroadcasterCache. Default is UUIDBroadcasterCache
  • broadcastFilters: Install BroadcastFilter for manipulating messages before they get delivered to the client. Default is empty.
  • dispath: When the servlet is defined, setting that value to false will prevent Atmosphere from dispatching the HTTP GET request to the RelectorServletProcessor, which is responsible for running the defined servlet. Default method is GET, and can be changed by using ApplicationConfig. Default value is true.
  • interceptors: The list of AtmosphereInterceptor. By default, tor.html), TrackMessageSizeInterceptor, HeartbeatInterceptor are installed.
  • listeners: Add one or several AtmosphereResourceEventListener. Usefull if your application needs to execute some actions based on the AtmosphereResource's life cycle.
  • path: The path to the resource. The default is "/" so if your have mapped the AtmosphereServlet 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.
  • servlet: A class that implements the Servlet interface. When defined, Atmosphere will dispatch requests to that class using the ReflectorServletProcessor; Default is null.

Step by Step Tutorials

Concepts & Architecture

15 Minutes Tutorial

Advanced Topics

API

Known WebServer Issues

References

External Documentations

githalytics.com alpha

Clone this wiki locally