0
The Polyglot Future    of JBoss AS       Toby Crawley       Red Hat, Inc.
PresentThe Polyglot Future    of JBoss AS       Toby Crawley       Red Hat, Inc.
Yours Truly• Senior SW Engineer at Red Hat• Core developer on TorqueBox &  Immutant• Member of Project:Odd• @tcrawley
Agenda• intro• JBoss AS• JRuby & TorqueBox• Clojure & Immutant• crap, a demo• outro
JBoss AS 7• Low memory footprint• Modularized class loader isolation• Fast startup time• Performant• EE6
“Java is a DSL for takinglarge XML files andconverting them to stacktraces”                   Scott Bellware
GoalLeverage the AS as a platform to reduce some of the accidental complexity of your deployment       environment and all...
GoalTo make you more productive.
GoalTo make you happy.
Ruby• Expressive• Dynamic typing• Less ceremony• Makes you feel more cleverer
Set<Person> people = new HashSet<Person>();for ( Team each : teams ) {  people.addAll( each.getMembers() );}for ( Person e...
teams. collect(&:members). flatten.uniq.each(&:promote!)
JRuby• Real threads• Simple access to Java• Fastest Ruby implementation
require javabar = org.projectodd.foo.Bar.newbar.a_value = 42bar.bazerize
TorqueBox is an Application Server forRuby built on top of JBoss AS7
Ruby!APIs!/!Programming!Models                               Java!APIs!/!Programming!Models                               ...
WebSupports any Rack framework (Rails,Sinata, Padrino, etc). Requests come in,responses go out. Works like you wouldexpect...
Web...but no war required. Just pointTorqueBox at the application root.
Scheduled JobsSimple cron-like scheduling that sharesyour applications lifecycle.
Scheduled Jobsclass TPSReportJob def run  # work happens here endend
Scheduled JobsTorqueBox.configure do job TPSReportJob,    :cron => 0 */5 * * * ?end
BackgroundableAsynchronous execution with a simpleapi. Shares your applications lifecycle.
Backgroundableinclude TorqueBox::Messagingclass User  include Backgroundable always_background :send_welcome def send_welc...
MessagingLayered on top of JMS and HornetQ.Useful for decoupling or polyglot interop.
Messagingqueue = inject( /queue/morris_day )queue.publish( Time.now )puts queue.receive# Fri Dec 2 16:44:22 -0500 2011
Messaginginclude TorqueBox::Messagingclass TheTime < MessageProcessor def on_message(body)  # What time is it?!?  puts bod...
MessagingTorqueBox.configure do queue /queue/morris_day do   processor TheTime endend
ServicesLong running daemons that share theapplications lifecycle.
Injectionaka Inversion of Control. Telling thecontainer what you need and letting itwire things up.
Distributed          TransactionsTrue multi-resource distributedtransactions.
Things I Skipped• Built-in WebSockets• Simple clustering• Key/Value store via Infinispan  (Caching)
Clojure• Modern Lisp for the JVM• Functional• Immutable data• Concise syntax• Nice Java integration
Set<Person> people = new HashSet<Person>();for ( Team each : teams ) {  people.addAll( each.getMembers() );}for ( Person e...
(map promote! (set (extract :members teams)))
(def extract mapcat)(map promote! (set (extract :members teams)))
(doto (org.projectodd.foo.Bar.) (.setAValue 42) (.bazerize))
Immutant
Immutant is an Application Server forClojure being built on top of JBoss AS7
WebSupports Ring handlers. Works like youwould expect. Requests come in,responses go out. Endpoints can becreated dynamica...
Web(require [immutant.web :as web])(defn my-ring-handler [request] ;; process request here)(web/start "/" my-ring-handler)...
MessagingLayered on top of JMS and HornetQ.Useful for decoupling or polyglot interop.
Messaging(require  [immutant.messaging :as msg])(def q "/queue/morris_day")(msg/start q)(msg/publish q (Date.))(println (m...
Messaging(msg/listen "/queue/morris_day" (fn [body]   ;; What time is it?!?   (println body)))
DaemonsLong running daemons that share theapplications lifecycle.
Coming Soon• Scheduled Jobs• Distributed futures• Distributed state• Multi-resource transactions• Injection• You tell us!
http://www.flickr.com/photos/-lucaslove/5084345964/
http://www.flickr.com/photos/jdgoring/179412740/
Clojuretwitter                       daemon                        queue           Ruby                                 Ja...
Language     LOC  Ruby       ~110 Clojure     ~50  Java       ~30Javascript   ~25
Availability• TorqueBox: 2.0.0.beta1 released today• Immutant: incremental builds available
Availability                              Monday• TorqueBox: 2.0.0.beta1 released today• Immutant: incremental builds avai...
http://www.flickr.com/photos/daveynin/4194763701/
Resources• http://torquebox.org• #torquebox on freenode• @torquebox• http://immutant.org• #immutant on freenode• @immutants
http://www.flickr.com/photos/thaths/3760407774/
Devignition 2011
Devignition 2011
Devignition 2011
Devignition 2011
Upcoming SlideShare
Loading in...5
×

Devignition 2011

3,324

Published on

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

No Downloads
Views
Total Views
3,324
On Slideshare
0
From Embeds
0
Number of Embeds
7
Actions
Shares
0
Downloads
27
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • You! - java, other jvm langs, ruby, clojure\n\n
  • Fire up your laptops\n
  • JBoss, AS, AS7\n
  • \n
  • JVM is a platform\n
  • &quot;just as the JVM...&quot;\n
  • distill\nnot for the boss, but for your own happiness\n
  • distill further\n
  • \n
  • \n
  • a comparison\n
  • \n
  • \n
  • \n
  • \n
  • 1) teaches the AS how to deploy ruby apps\n2) exposes AS functionality via ruby interfaces\nstill run java (multiple apps)\n
  • &quot;skimming the surface&quot;\n&quot;in the room&quot;\n
  • \n
  • \n
  • \n
  • \n
  • First look at torquebox.rb\n
  • \n
  • Mention Futures\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • first class\ndefined a symbol pointing to the mapcat function\n
  • \n
  • \n
  • 1) teaches the AS how to deploy clojure apps\n2) exposes AS functionality via clojure interfaces\njava too!\n
  • mention no war\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • WIP\navout\n
  • Each are just modules added to the AS, so we can overlay\n
  • wish me luck! (shout?)\nCMD-TAB\n
  • \n
  • focus on solving the problem, not the platform\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • try it out, find bugs\n
  • try it out, find bugs\n
  • we&apos;ve talked about TB &amp; I, and how they work\nand how they can be used together to build polyglot apps\nHopefully compelling\nif you try it, maybe we can make you happy\n\n
  • torquebox docs\nsausage, help\n(services story if there is time)\n
  • I have stickers!\nAre we still running?\n
  • Transcript of "Devignition 2011"

    1. 1. The Polyglot Future of JBoss AS Toby Crawley Red Hat, Inc.
    2. 2. PresentThe Polyglot Future of JBoss AS Toby Crawley Red Hat, Inc.
    3. 3. Yours Truly• Senior SW Engineer at Red Hat• Core developer on TorqueBox & Immutant• Member of Project:Odd• @tcrawley
    4. 4. Agenda• intro• JBoss AS• JRuby & TorqueBox• Clojure & Immutant• crap, a demo• outro
    5. 5. JBoss AS 7• Low memory footprint• Modularized class loader isolation• Fast startup time• Performant• EE6
    6. 6. “Java is a DSL for takinglarge XML files andconverting them to stacktraces” Scott Bellware
    7. 7. GoalLeverage the AS as a platform to reduce some of the accidental complexity of your deployment environment and allow you to use the best tool for the job.
    8. 8. GoalTo make you more productive.
    9. 9. GoalTo make you happy.
    10. 10. Ruby• Expressive• Dynamic typing• Less ceremony• Makes you feel more cleverer
    11. 11. Set<Person> people = new HashSet<Person>();for ( Team each : teams ) { people.addAll( each.getMembers() );}for ( Person each : people ) { each.promote();}
    12. 12. teams. collect(&:members). flatten.uniq.each(&:promote!)
    13. 13. JRuby• Real threads• Simple access to Java• Fastest Ruby implementation
    14. 14. require javabar = org.projectodd.foo.Bar.newbar.a_value = 42bar.bazerize
    15. 15. TorqueBox is an Application Server forRuby built on top of JBoss AS7
    16. 16. Ruby!APIs!/!Programming!Models Java!APIs!/!Programming!Models Message Processors Polyglot WebSockets InjectionSinatra Rails Jobs STOMP POJO REST Servlet Rack Daemons Tasks Spring JMS JavaEE JRuby!Component!Deployers!&!Gems Java!Enterprise!Services JBoss Web Messaging Infinispan Cache TorqueBox HornetQ Transactions Core Quartz Security TorqueBox Core PicketLink JRuby with JIT Managed Services Container Java Virtual Machine
    17. 17. WebSupports any Rack framework (Rails,Sinata, Padrino, etc). Requests come in,responses go out. Works like you wouldexpect...
    18. 18. Web...but no war required. Just pointTorqueBox at the application root.
    19. 19. Scheduled JobsSimple cron-like scheduling that sharesyour applications lifecycle.
    20. 20. Scheduled Jobsclass TPSReportJob def run # work happens here endend
    21. 21. Scheduled JobsTorqueBox.configure do job TPSReportJob, :cron => 0 */5 * * * ?end
    22. 22. BackgroundableAsynchronous execution with a simpleapi. Shares your applications lifecycle.
    23. 23. Backgroundableinclude TorqueBox::Messagingclass User include Backgroundable always_background :send_welcome def send_welcome # slow email process endend
    24. 24. MessagingLayered on top of JMS and HornetQ.Useful for decoupling or polyglot interop.
    25. 25. Messagingqueue = inject( /queue/morris_day )queue.publish( Time.now )puts queue.receive# Fri Dec 2 16:44:22 -0500 2011
    26. 26. Messaginginclude TorqueBox::Messagingclass TheTime < MessageProcessor def on_message(body) # What time is it?!? puts body endend
    27. 27. MessagingTorqueBox.configure do queue /queue/morris_day do processor TheTime endend
    28. 28. ServicesLong running daemons that share theapplications lifecycle.
    29. 29. Injectionaka Inversion of Control. Telling thecontainer what you need and letting itwire things up.
    30. 30. Distributed TransactionsTrue multi-resource distributedtransactions.
    31. 31. Things I Skipped• Built-in WebSockets• Simple clustering• Key/Value store via Infinispan (Caching)
    32. 32. Clojure• Modern Lisp for the JVM• Functional• Immutable data• Concise syntax• Nice Java integration
    33. 33. Set<Person> people = new HashSet<Person>();for ( Team each : teams ) { people.addAll( each.getMembers() );}for ( Person each : people ) { each.promote();}
    34. 34. (map promote! (set (extract :members teams)))
    35. 35. (def extract mapcat)(map promote! (set (extract :members teams)))
    36. 36. (doto (org.projectodd.foo.Bar.) (.setAValue 42) (.bazerize))
    37. 37. Immutant
    38. 38. Immutant is an Application Server forClojure being built on top of JBoss AS7
    39. 39. WebSupports Ring handlers. Works like youwould expect. Requests come in,responses go out. Endpoints can becreated dynamically.
    40. 40. Web(require [immutant.web :as web])(defn my-ring-handler [request] ;; process request here)(web/start "/" my-ring-handler)...(web/stop "/")
    41. 41. MessagingLayered on top of JMS and HornetQ.Useful for decoupling or polyglot interop.
    42. 42. Messaging(require [immutant.messaging :as msg])(def q "/queue/morris_day")(msg/start q)(msg/publish q (Date.))(println (msg/receive q)); #<Date Fri Dec 2 16:54:56 EST 2011>
    43. 43. Messaging(msg/listen "/queue/morris_day" (fn [body] ;; What time is it?!? (println body)))
    44. 44. DaemonsLong running daemons that share theapplications lifecycle.
    45. 45. Coming Soon• Scheduled Jobs• Distributed futures• Distributed state• Multi-resource transactions• Injection• You tell us!
    46. 46. http://www.flickr.com/photos/-lucaslove/5084345964/
    47. 47. http://www.flickr.com/photos/jdgoring/179412740/
    48. 48. Clojuretwitter daemon queue Ruby Java processor TweetClassifier web topic sockets you! and you? and you!
    49. 49. Language LOC Ruby ~110 Clojure ~50 Java ~30Javascript ~25
    50. 50. Availability• TorqueBox: 2.0.0.beta1 released today• Immutant: incremental builds available
    51. 51. Availability Monday• TorqueBox: 2.0.0.beta1 released today• Immutant: incremental builds available
    52. 52. http://www.flickr.com/photos/daveynin/4194763701/
    53. 53. Resources• http://torquebox.org• #torquebox on freenode• @torquebox• http://immutant.org• #immutant on freenode• @immutants
    54. 54. http://www.flickr.com/photos/thaths/3760407774/
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×