Manage Installed Services - Atmosphere/atmosphere Wiki
Atmosphere comes with several services (interceptors, broadcaster, broadcaster cache, filters, etc). Sometime, default services are not required for your application and/or you need to install default one. This topic focuses on configurations points that help you to deal with installed services.
Key parameters should be kept in mind when configuring atmosphere with xml:
- Auto detect broadcaster: by default, broadcaster provided by plugins are scanned (hazelcast, redis, rmi, etc). If you don't use one of them, you can disabled it.
- Disable default interceptor: by default, many interceptors are installed by default. You can install some of them manually when you configured atmosphere to not install them by default.
- Disable interceptors: You can exclude some default interceptors from installation step.
- Install broadcast filters: you can install manually any broadcast filter by specifying the class name.
- Install broadcast cache: you can install manually any broadcaster cache by specifying the class name.
- Install broadcaster: you can install manually any broadcaster by specifying the class name.
- Install broadcaster factory: you can install manually any broadcaster factory by specifying the class name.
In addition to XML configuration, most of key settings are direclty availale through @ManagedService annotation when you use it.
Meta services (since 2.2)
Since 2.2 you can add a file named META-INF/services/org.atmosphere.cpr.AtmosphereFramework available inside the classpath.
You can specificy two blocks:
- an install block which enumerates any service to install
- an exclude block which enumerates any default service to not install
INSTALL com.myapp.MyInterceptor org.atmosphere.interceptor.AtmosphereResourceLifecycleInterceptor EXCLUDE org.atmosphere.interceptor.HeartbeatInterceptor
Caution: be sure to not add to your classpath a jar that already includes a meta service file. Currently, only STOMP extension uses this feature. If you don't use STOMP, then you can use this alternative to configure atmosphere.