Your SlideShare is downloading. ×
0
The Atmosphere Framework
The Atmosphere Framework
The Atmosphere Framework
The Atmosphere Framework
The Atmosphere Framework
The Atmosphere Framework
The Atmosphere Framework
The Atmosphere Framework
The Atmosphere Framework
The Atmosphere Framework
The Atmosphere Framework
The Atmosphere Framework
The Atmosphere Framework
The Atmosphere Framework
The Atmosphere Framework
The Atmosphere Framework
The Atmosphere Framework
The Atmosphere Framework
The Atmosphere Framework
The Atmosphere Framework
The Atmosphere Framework
The Atmosphere Framework
The Atmosphere Framework
The Atmosphere Framework
The Atmosphere Framework
The Atmosphere Framework
The Atmosphere Framework
The Atmosphere Framework
The Atmosphere Framework
The Atmosphere Framework
The Atmosphere Framework
The Atmosphere Framework
The Atmosphere Framework
The Atmosphere Framework
The Atmosphere Framework
The Atmosphere Framework
The Atmosphere Framework
The Atmosphere Framework
The Atmosphere Framework
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

The Atmosphere Framework

15,077

Published on

Atmosphere talks @ Javaone 2010 on Websocket, Comet and JQuery

Atmosphere talks @ Javaone 2010 on Websocket, Comet and JQuery

Published in: Technology
0 Comments
9 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
15,077
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
235
Comments
0
Likes
9
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Building Powerful WebSocket, Comet, and RESTful Applications Using Atmosphere<br />http://twitter.com/atmo_framework<br />Jeanfrancois Arcand<br />http://twitter.com/jfarcand<br />Paul Sandoz<br />http://twitter.com/PaulSandoz<br />
  • 2. Creator of the Grizzly Framework <br />Creatpr of GlassFish v3 Grizzly Micro Kernel<br />Creator and Co-Leader of Atmosphere<br />Jeanfrancois<br />9 years @ Sun Microsystem<br />Creator Async Http Client<br />Co-leader of Atmosphere<br />Creator and Lead of Jersey<br />Paul<br />13 years @ Sun Microsystem<br />Java Champion<br />
  • 3. News and Update<br />Comet and WebSocket Protocol<br />The Atmosphere Framework<br />Ya Ya Ya That’s Impossible<br />High-level RESTful and asynchronous applications<br />Twitter Search<br />Conclusion <br />Q & A<br />
  • 4. PrimeFaces (JSF) Spring IntegrationAkka (Scala/Actor) GWT-Comet Apache Tuscany Grails (Plug In)Atlassian (JIRA) Ning (Social Network)AutoDesk (AutoCad) Fabric3 (3D) Thinked (Journie), Sonatype (Secret)<br />Wink Wicket Struts JQuery<br />Atmosphere 0.6.2<br />New! Atmosphere Gaming Framework<br />
  • 5. LongPolling<br />Web<br />Socket<br />Streaming<br />Browser<br />Server<br />Browser<br />Server<br />Browser<br />Server<br />Request<br />Request<br />Request<br />Request<br />Response<br />Response<br />Response<br />Response<br />Response<br />Upgrade<br />Data<br />Data<br />
  • 6. Atmosphere<br />Java WebServer<br />
  • 7. WebSocket<br />Nothing<br />Comet<br />Java WebServer<br />Atmosphere<br />
  • 8. Atmosphere<br />WebSocket<br />Comet API<br />Servlet 3.0 API<br />Nothing<br />Comet<br />Java WebServer<br />
  • 9. Atmosphere<br />Atmosphere Application<br />Atmosphere Runtime<br />WebSocket<br />Comet API<br />Servlet 3.0 API<br />Nothing<br />Comet<br />Java WebServer<br />
  • 10. Atmosphere<br />Atmosphere Application<br />Atmosphere Runtime<br />Guice<br />WebSocket<br />Comet API<br />Servlet 3.0 API<br />Nothing<br />Comet<br />Java WebServer<br />
  • 11. Atmosphere<br />Servlet<br />Atmosphere Application<br />Servlet runner<br />Atmosphere Runtime<br />Guice<br />WebSocket<br />Comet API<br />Servlet 3.0 API<br />Nothing<br />Comet<br />Java WebServer<br />
  • 12. Atmosphere<br />Atmosphere Annotations<br />Servlet<br />Atmosphere Application<br />Servlet runner<br />Atmosphere Runtime<br />Guice<br />WebSocket<br />Comet API<br />Servlet 3.0 API<br />Nothing<br />Comet<br />Java WebServer<br />
  • 13. Atmosphere<br />Cluster<br />Atmosphere Annotations<br />Servlet<br />Atmosphere Application<br />Servlet runner<br />Atmosphere Runtime<br />Guice<br />WebSocket<br />Comet API<br />Servlet 3.0 API<br />Nothing<br />Comet<br />Java WebServer<br />
  • 14. Atmosphere<br />Atmosphere Application<br />Cluster<br />Atmosphere Annotations<br />Jersey<br />Servlet<br />Atmosphere Application<br />Servlet runner<br />Atmosphere Runtime<br />Guice<br />WebSocket<br />Comet API<br />Servlet 3.0 API<br />Nothing<br />Comet<br />Java WebServer<br />
  • 15. Atmosphere<br />Atmosphere JQuery<br />Atmosphere Application<br />Cluster<br />Atmosphere Annotations<br />Jersey<br />Servlet<br />Atmosphere Application<br />Servlet runner<br />Atmosphere Runtime<br />Guice<br />WebSocket<br />Comet API<br />Servlet 3.0 API<br />Nothing<br />Comet<br />Java WebServer<br />
  • 16. Atmosphere<br />Atmosphere JQuery<br />Atmosphere Application<br />Cluster<br />Atmosphere Annotations<br />Jersey<br />Servlet<br />Atmosphere Application<br />Servlet runner<br />Atmosphere Runtime<br />Guice<br />WebSocket<br />Comet API<br />Servlet 3.0 API<br />Nothing<br />Comet<br />Java WebServer<br />
  • 17. Atmosphere<br />Atmosphere JQuery<br />Atmosphere Application<br />Atmosphere Application<br />Atmosphere Spade Server<br />Powered by Grizzly<br />Embed<br />Guice<br />WebSocket<br />Comet API<br />Servlet 3.0 API<br />Nothing<br />Comet<br />
  • 18. Why<br />
  • 19. Clustering<br />Why<br />
  • 20. JMS<br />JGroups<br />Clustering<br />Why<br />
  • 21. JMS<br />JGroups<br />Clustering<br />Guarantee Delivery<br />Why<br />
  • 22. Cache<br />JMS<br />JGroups<br />OOM Manager<br />Clustering<br />Guarantee Delivery<br />Events Aggregation<br />Proxy<br />Why<br />
  • 23. Cache<br />JMS<br />JGroups<br />OOM Manager<br />Clustering<br />Guarantee Delivery<br />Events Aggregation<br />Proxy<br />Why<br />Portable & Unified<br />
  • 24. Cache<br />JMS<br />JGroups<br />OOM Manager<br />Clustering<br />Guarantee Delivery<br />Events Aggregation<br />Proxy<br />Why<br />Servlet 3.0<br />Blocking I/O<br />Portable & Unified<br />Comet Native<br />Web<br />Socket<br />New protocol<br />
  • 25. Cache<br />JMS<br />JGroups<br />OOM Manager<br />Clustering<br />Guarantee Delivery<br />Events Aggregation<br />Proxy<br />Why<br />Servlet 3.0<br />Blocking I/O<br />Portable & Unified<br />Client<br />Comet Native<br />Web<br />Socket<br />New protocol<br />
  • 26. Cache<br />JMS<br />JGroups<br />OOM Manager<br />Clustering<br />Guarantee Delivery<br />Events Aggregation<br />Proxy<br />Why<br />Servlet 3.0<br />Blocking I/O<br />GWT<br />JQuery<br />Portable & Unified<br />Client<br />Java EE<br />Comet Native<br />Web<br />Socket<br />Grails<br />JSF<br />New protocol<br />
  • 27. Cache<br />JMS<br />JGroups<br />OOM Manager<br />Clustering<br />Guarantee Delivery<br />Events Aggregation<br />Proxy<br />Why<br />JRuby<br />Servlet 3.0<br />Blocking I/O<br />GWT<br />JQuery<br />Portable & Unified<br />Client<br />Java EE<br />Comet Native<br />Web<br />Socket<br />Grails<br />JSF<br />New protocol<br />
  • 28. Cache<br />JMS<br />JGroups<br />OOM Manager<br />Clustering<br />Guarantee Delivery<br />Events Aggregation<br />Proxy<br />Why<br />JRuby<br />Groovy<br />Servlet 3.0<br />Blocking I/O<br />GWT<br />JQuery<br />Portable & Unified<br />Client<br />Java EE<br />Comet Native<br />Web<br />Socket<br />Grails<br />JSF<br />New protocol<br />
  • 29. Cache<br />JMS<br />JGroups<br />OOM Manager<br />Clustering<br />Guarantee Delivery<br />Events Aggregation<br />Proxy<br />Why<br />JRuby<br />Scala<br />Groovy<br />Servlet 3.0<br />Blocking I/O<br />GWT<br />JQuery<br />Portable & Unified<br />Client<br />Java EE<br />Comet Native<br />Web<br />Socket<br />Grails<br />JSF<br />New protocol<br />
  • 30. Same API everywhere. No need to learn the protocol!<br />
  • 31. Comet<br />Web<br />Socket<br />IE<br />Chrome<br />JQuery Plugin<br />Auto detect best transport to use! Emulate WebSocket!<br />Comet<br />Web<br />Socket<br />Web<br />Socket<br />Server Side Events<br />Safari<br />Firefox<br />Opera<br />Comet<br />Comet<br />Comet<br />
  • 32. Ya Ya Ya<br />That’s impossible!<br />
  • 33. @Path("/pubsub/{topic}")<br />@Produces("text/html;charset=ISO-8859-1")<br />public class JQueryPubSub {<br /> private @PathParam("topic") Broadcaster topic;<br /> @GET<br /> public SuspendResponse<String> subscribe() {<br /> return new SuspendResponse.SuspendResponseBuilder<String>()<br /> .broadcaster(topic)<br /> .outputComments(true)<br /> .addListener(new EventsLogger())<br /> .build();<br /> }<br /> @POST<br />@Broadcast<br /> public Broadcastable publish(@FormParam("message") String message) {<br /> return new Broadcastable(message, "", topic);<br /> }<br />
  • 34. function subscribe()<br /> {<br /> function callback(response)<br /> {<br /> if (response.transport != 'polling' && response.state != 'connected' <br /> && response.state != 'closed') {<br /> if (response.status == 200) {<br /> var data = response.responseBody<br /> if (data.length > 0) {<br /> $('ul').prepend($('<li></li>').text(" Message Received: " + data + " using transport: " + response.transport));<br /> }<br /> }<br /> }<br /> }<br /> $.atmosphere.subscribe(document.location.toString() + 'pubsub/' <br /> + getElementByIdValue('topic'),<br />callback : callback,<br /> $.atmosphere.request = {transport: getElementByIdValue('transport')});<br /> }<br />
  • 35. JAX-RS and Jersey with AtmosphereRESTful and asynchronous Web applications <br /><ul><li>JAX-RS is the Java API for RESTful Web services
  • 36. Jersey is the reference implementation and provides additional functionality
  • 37. Atmosphere leverages the extensibility of Jersey
  • 38. Atmosphere and Jersey can evolve at their own rates
  • 39. Combine JAX-RS and Atmosphere annotations</li></li></ul><li>High-level Atmosphere conceptsLeveraging the power of REST, JAX-RS/Jersey <br /><ul><li>@Suspend or SuspendResponse API
  • 40. Suspend a response
  • 41. @Resume
  • 42. Resume a response
  • 43. @Broadcast or Broadcaster API
  • 44. Broadcast events
  • 45. @Schedule
  • 46. Schedule execution of periodic broadcast
  • 47. @Cluster
  • 48. Cluster broadcasting</li></li></ul><li>We want a Twitter Real Time Search!<br />
  • 49. Conclusion<br />Write Powerfull Asynchronous Web Application using Atmosphere<br />Write once, Run Anywhere<br />Transport free!<br />Browser nightmare free<br />Extremely Simple!<br />Join the community<br />http://github.com/Atmosphere/atmosphere<br />
  • 50. THANKS YOU!<br />http://twitter.com/atmo_framework<br />Jeanfrancois Arcand<br />jfarcand@apache.org<br />Paul Sandoz<br />Paul.sandoz@oracle.com<br />

×