-
-
Notifications
You must be signed in to change notification settings - Fork 751
Using the WebSocketHandlerService Annotation
Jeanfrancois Arcand edited this page Sep 9, 2013
·
2 revisions
The WebSocketHandlerService can be used to configure an implementation of WebSocketHandlerService. As simple as this
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 WebSocketServiceEventListener. 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 DefaultBroadcaster -
interceptors
: The list of AtmosphereInterceptor. It is strongly recommended to install one or all of the following interceptor to simplify your application's code: TrackMessageSizeInterceptor, HeartbeatInterceptor, -
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 UUIDBroadcasterCache -
broadcastFilters
: Install BroadcastFilter for manipulating messages before they get delivered to the client. Default is empty.
The Singleton annotation can be used to force Atmosphere to create a single, thread safe instance of a WebSocketHandlerService's annotated classes. For example, if your application set the @WebSocketHandlerService'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.
- Understanding Atmosphere
- Understanding @ManagedService
- Using javax.inject.Inject and javax.inject.PostConstruct annotation
- Understanding Atmosphere's Annotation
- Understanding AtmosphereResource
- Understanding AtmosphereHandler
- Understanding WebSocketHandler
- Understanding Broadcaster
- Understanding BroadcasterCache
- Understanding Meteor
- Understanding BroadcastFilter
- Understanding Atmosphere's Events Listeners
- Understanding AtmosphereInterceptor
- Configuring Atmosphere for Performance
- Understanding JavaScript functions
- Understanding AtmosphereResourceSession
- Improving Performance by using the PoolableBroadcasterFactory
- Using Atmosphere Jersey API
- Using Meteor API
- Using AtmosphereHandler API
- Using Socket.IO
- Using GWT
- Writing HTML5 Server-Sent Events
- Using STOMP protocol
- Streaming WebSocket messages
- Configuring Atmosphere's Classes Creation and Injection
- Using AtmosphereInterceptor to customize Atmosphere Framework
- Writing WebSocket sub protocol
- Configuring Atmosphere for the Cloud
- Injecting Atmosphere's Components in Jersey
- Sharing connection between Browser's windows and tabs
- Understanding AtmosphereResourceSession
- Manage installed services
- Server Side: javadoc API
- Server Side: atmosphere.xml and web.xml configuration
- Client Side: atmosphere.js API