The Atmosphere Comet Abstraction Framework Releases Alpha
Atmosphere which started off as an evolution of Grizzly, is a POJO based framework that aims to bring Comet to the masses. This Comet Abstraction Framework released its first alpha version and InfoQ had a Q&A with its creator Jean-Francois Arcand about it.
Since the Atmosphere framework is portable it can run on any Java based Web Server, including Tomcat,Jetty, GlassFish,Resin, Jersey,RESTlet etc. without having to wait for the Servlet 3.0 implementations and without the developer needing to utilize any container-specific push/Comet mechanism.
Jean-Francois explains the motivation behind Atmosphere:
Currently, writing a portable Comet application is impossible: JBossWeb has AIO, Tomcat has its a different AIO API, Jetty has its Continuation API and pre Servlet 3.0 API support, Grizzly has its Comet Framework and Grizzlet API, etc. So, framework like DWR, ICEFaces and Bindows all added native support and abstracted a layer in order to support different Comet API. Worse, if your application uses those API directly, then you are stuck with one Web Server. Not bad if you are using Grizzly Comet, but if you are using the competitor, then you cannot meet the Grizzly!
The current Servlet EG are working on a proposal to add support for Comet in the upcoming Servlet 3.0 specification, but before the planet fully supports the spec it may takes ages. And the proposal will contains a small subset of the current set of features some containers already supports like asynchronous I/O (Tomcat, Grizzly), container-managed thread pool for concurrently handling the push operations, filters for push operations. etc. Not to say that using Atmosphere, framework will not longer have to care about native implementation, but instead build on top of Atmosphere. Protocol like Bayeux will comes for free, and will run on all WebServer by under the hood using their native API.
So I'm launching Atmosphere, hoping to close the gap and simplify the creation of Comet based application based on the experience/feedback I got since two year with the Grizzly Comet Framework.
The official announcement outlines the requirements for an application to utilize Atmosphere:
To bundle Atmosphere inside your web application, download atmosphere-cpr jar file from here: http://download.java.net/maven/2/org/atmosphere/atmosphere-portable-runtime/ and put it under WEB-INF/lib
Download the context.xml file (required for Tomcat support): http://is.gd/ngMm and put it under META-INF/ or your war file
Optionally, you can define you AtmosphereHandler by creating an atmosphere.xml like: http://is.gd/ngM1 under META-INF of you war file
This is optional, as the framework can autodetect your AtmosphereHandler and map it using it class's name (see the chat demo for more info).
InfoQ discussed with Jean-Francois about the release of Atmosphere:
InfoQ: Jean-Francois, would you like to describe to us the various components that make up atmosphere?
Right now we are planning to have 3 modules. The first one (released last week) is a the CPR (Comet Portable Runtime) which brings portability to web application who want t use Comet . The second one, called core, will bring the CPR inside Project Jersey and will allow the use of REST, annotation, IoC etc. That will make building Comet application quite easy. The last one, called PlugIn, will allow developer to extend the core (using annotation) . An example can consist of adding clustering capability to your web application. e.g when a connection is suspended on instance 1, it will gets notified when a push happens if annotated. So you will be able to cluster comet application and gets them updated all at the same time.
InfoQ: What is the roadmap and when are the upcoming releases planned for?
By the end of April we should have core and cpr module available. The PlugIn will be an ongoing effort.
InfoQ: How do you see Atmosphere evolving side-bys-de with the Servlet 3.0 spec?
Atmosphere will support Servlet 3.0 async API, but Atmosphere offer more than what 3.0 propose. As an example, the Atmosphere’s Broadcaster is very useful when it is time to push/aggregate/filter data between suspended connections.
Shane Hastie Aug 30, 2014
Roy Rapoport Aug 28, 2014