Presentation is loading. Please wait.

Presentation is loading. Please wait.

Presentation Title Up to Three Lines Long Arial 28pt Name, 26pt Speaker Company, 18pt Misc. Info, 16pt Speaker logo centered below photo.

Similar presentations


Presentation on theme: "Presentation Title Up to Three Lines Long Arial 28pt Name, 26pt Speaker Company, 18pt Misc. Info, 16pt Speaker logo centered below photo."— Presentation transcript:

1 Presentation Title Up to Three Lines Long Arial 28pt Name, 26pt Speaker Company, 18pt Misc. Info, 16pt Speaker logo centered below photo

2 2 Agenda > Introduction > Dynamic Languages and the Java Virtual Machine > GlassFish: A Multi-Language app server > JavaEE and Dynamic Languages > Advance Features > Q&A

3 3 GlassFish v3 A multi-language application server

4 4 > GlassFish integrates dynamic applications seamlessly ● Grails, Rails, Merb, Sinatra, Django, Lift ● Same deploy command for all frameworks ● asadmin deploy ● No packaging (no WAR files required) ● No change in programming model > Under-the-hood wiring ● Implements Rack, Web Server Gateway Interface (WSGI)

5 5 Why Is This Cool? > First-class support for dynamic language apps ● asadmin deploy /path/to/dynamic/app ● Just Works > Easy integration of dynamic apps into existing Java deployments ● Can run Ruby apps alongside Jython, Java EE, etc. > Embedded interpreters allow for some extra tricks > Rails runtime pooling > Monitoring and configuration

6 6 GlassFish v3 Extensibility > Pluggable Containers > Container handles user applications > Each language/framework has it's own container ● JRuby Container (Ruby/Rails/Merb) ● Jython Container (Python/Django) ● Web Container (for Servlet/JSP/Grails based apps) ● Each container is an OSGi bundle > Grizzly adapter to serve HTTP request

7 7 GlassFish JRuby Module JRubySniffer JRubyContai ner JRubyDeploy er GrizzlyAdapt er register Deploy

8 8 More on Scripting Containers... > Dynamic runtime pool ● Used for single threaded languages/framework ● Configurable ● Optimized resource usage > Lazy loading ● Loaded on application deployment ● Faster startup

9 9 GlassFish v3 Runtime

10 10 (J)Ruby on Rails Rack

11 11 Ruby support on GlassFish > Rack support ● Wires a web server to a Ruby application ● Based on WSGI from Python > Run any Ruby application that supports Rack > All major Ruby frameworks support Rack ● Rails (Starting 2.3.2), Merb, Sinatra, Campsite... > GlassFish has in built support for Rails, Merb and Sinatra

12 12 GlassFish gem > Project at RubyForge ● Based on GlassFish v3 Kernel > Lightweight ● Just about 2.5 MB in size > Ruby friendly > More info ● http://glassfishgem.rubyforge.org/

13 13 Using GlassFish gem > How simple can it get?

14 14 Using GlassFish gem > How simple can it get? $ gem install glassfish

15 15 Using GlassFish gem > How simple can it get? $ gem install glassfish $ glassfish

16 16 Using GlassFish gem > How simple can it get? $ gem install glassfish $ glassfish -e production

17 17 Pluggable Framework support > Rack-up script > jruby.applicationType deployment property > GlassFish auto-detects your application Ruby App Deployme nt Ruby App Deployme nt Rack Auto-detector Rack Auto-detector Rails Your Framework Your Framework Merb Sinatr a Rack-up Script Rack-up Script

18 18 Demo Run your Rack aware Ruby application on GlassFish

19 19 (J)Python and Django

20 20 (J)Python and Django on GlassFish > Jython as Python interpreter > Jython container ● Like JRuby, extends GlassFish ● Jython Grizzly Adapter for HTTP processing ● WSGI support makes other Python frameworks simple to plugin > Simple deployment $ asadmin deploy myDjangoApp/

21 21 Demo Django application on GlassFish v3

22 22 Groovy and Grails Spring + Hibernate + Groovy = Grails

23 23 GlassFish v3 is Grails Aware!

24 24 GlassFish Grails Plugin > Install GlassFish as Grails plugin $ grails install-plugin glassfish --global > Now run your application on GlassFish $ grails run-app > Embedded GlassFish for Grails > Same server for development and production > Supports Grails run-app and run-war command

25 25 Agenda > Introduction > Dynamic Languages and the Java Virtual Machine > GlassFish: A Multi-Language app server > JavaEE and Dynamic Languages > Advance Features > Q&A

26 26 JavaEE and Dynamic Languages > JavaEE a mature and robust enterprise platform > Servlet, EJB, JMS, JAX-RS, JAX-WS... > What's possible now ● Co-host JavaEE application with a Ruby application ● Dispatch request from Rails to a Servlet ● Access Rails response inside a JSP ● Write to ServletResponse from inside Rails application > Made possible using JRuby-Rack

27 27 Servlet 3.0 pluggability > JavaEE 6 and Dynamic Languages ● Simple packaging ● No need to package as WAR ● Hence no Warbler needed ● Place Rails application inside WEB-INF directory ● No boilerplate web.xml ● Dynamically add Jruby-Rack ServletFilter and ServletContextListner ● Achived by implementing javax.servlet.ServletContainerInitializer

28 28 Servlet 3.0 Pluggability RailsContainerInitializer extends ServletContainerInitializer { public void onStartup(Set >c, ServletContext ctx) { //c will be null if ServletContainerInitializer does //not have a @HandlesTypes annotation on it. InputStream boot = ctx.getResourceAsStream( "WEB-INF/environment/boot.rb"); //There is a Rails application inside this web archive, //lets add the servlet/filter etc. if(boot != null){ FilterRegistration fr = ctx.addFilter( “JRuby Rack Filter”, filterClass); //Use the FilterRegistration fr to add the //Filter related metadata. }

29 29 Agenda > Introduction > Dynamic Languages and the Java Virtual Machine > GlassFish: A Multi-Language app server > JavaEE and Dynamic Languages > Advance Features > Q&A

30 30 GlassFish Monitoring > Based on GlassFish probe infrastructure > GlassFish probes ● Emits monitoring data ● Probes exposed as dTrace probes ● JMX beans ● RESTful service > Scripting client ● Write monitoring client in Groovy or JRuby and deploy as a service on GlassFish

31 31 Ruby Monitoring > What is monitored in Ruby/Rack applications ● Container Probe ● HTTP stats ● JRuby runtime > Monitor using ● dTrace or JMX or your custom script or REST

32 32 Demo: Rails on Comet

33 33 Q&A

34 Speaker Name, Arial 28pt Speaker Contact Info, 22pt Misc Info, 16pt

35 35 Slide Heading: 36pt Subhead: 28pt > All text is Arial > Level One bullet point: 28pt ● Level Two bullet: 26pt ● Level Three: 22pt ● Level Four and subsequent: 18pt > Text block is aligned to the left


Download ppt "Presentation Title Up to Three Lines Long Arial 28pt Name, 26pt Speaker Company, 18pt Misc. Info, 16pt Speaker logo centered below photo."

Similar presentations


Ads by Google