-
-
Notifications
You must be signed in to change notification settings - Fork 750
Migrating your Atmosphere 0.x to 0.9 new API
Starting with Atmosphere 0.9, both client and server have backward incompatible API changes. That means an application that was written against version lower than 0.9 may not work. If you are using atmosphere-jersey, you don't need to change anything.
-
AtmosphereResource, AtmosphereHandler no longer have generics.
>Before: AtmosphereHandler\<HttpServletRequest,HttpServletResponse\> >Now: AtmosphereHandler
So you need to remove the generic in your AtmosphereHandler to make it work again.
-
HttpServletRequest, HttpServletResponse are now hidden in Atmosphere. So replace all occurrence of those classes with their associated AtmosphereRequest and AtmosphereResponse
-
AtmosphereResource and Broadcaster new fluid API. The return type of many of AtmosphereResource and Broadcaster has been changed to return 'this'. Just recompile your application to avoid linkage exception.
atmosphere.js has been completely rewritten and has a few backward incompatibilities with the previous version:
-
jQuery.atmosphere.subscribe now return a Response object that can be used to push messages. With previous version you needed to call jQuery.atmosphere.response.push to achieve the same functionality. This is no longer supported and you must use the returned object of jQuery.atmosphere.subscribe.
-
the jQuery.atmosphere.publish(url,callback,request) is no longer supported and replaced by jQuery.atmosphere.publish(request). To inspect the response, attach a function to the request (see next section) named onMessagePublished.
-
callback usage has been deprecated. Instead, jQuery.atmosphere and jQuery.atmosphere.request support function that can be used to receive notification.
onOpen(response): invoked when the connection get opened onClose(response): invoked when the connection get closed onReconnect(request,response) invoked when reconnecting. This is where you can change the request. onMessage(response): when a message is received onError(response): when an unexpected error occurs onMessagePublished: when you push a message to the server, the response will be sent to that function
All samples have been re-written and can be used to understand the changes. Take a look at the PubSub Client-Server or the infamous Chat Client-Server to realize how simple Atmosphere is!
- 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