Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Rapid Java application development with JRebel

Rapid Java application development with JRebel

Anton Arhipov

February 26, 2012
Tweet

More Decks by Anton Arhipov

Other Decks in Programming

Transcript

  1. Turnaround  Cycle   Make  a   change   Build,  

    deploy,   wait   Check   the   change  
  2.                  dev  <<

     PROD   Opera,ons   Standards   Vendors  
  3. Turnaround  Cycle   Make  a   change   Build,  

    deploy,   wait   Check   the   change  
  4. Build   Package  everything  into  WAR/EAR   Package  modules  into

     JARs   Compile  classes   Copy  sta,c  resources   Resolve  dependencies  
  5. JeBy  Launcher   public class Launcher { public static void

    main(String[] args) { Server server = new Server(); SelectChannelConnector connector = new SelectChannelConnector(); connector.setPort(8080); server.addConnector(connector); WebAppContext context = new WebAppContext("war", "/"); server.setHandler(context); server.start(); } }
  6. “…I  know  about  JRebel,  but  I  cannot   pay  for

     it,  so  I  tried  Maven…”                                                                                        -­‐  Stackoverflow  
  7. Build   Package  everything  into  WAR/EAR   Package  modules  into

     JARs   Compile  classes   Copy  sta,c  resources   Resolve  dependencies  
  8. Build   Package  everything  into  WAR/EAR   Package  modules  into

     JARs   Compile  classes   Copy  sta,c  resources   Resolve  dependencies  
  9. Classes Libraries OldClassLoader NewClassLoader Sevlet New Classes New Libraries Sevlet

    Session Session init()   App State App State Serialize/deserialize  
  10. Twin  ClassLoader  Issues   JVM Classes Libraries OldClassLoader NewClassLoader Objects

    and Code Classes Libraries Objects and Code OutOfMemoryError ClassCastException …
  11. MyObject MyObject.class   OldClassLoader Code   101000101   100010010  

    Debugger HotSwap   New  code   111000100   101010010   New  code   111000100   101010010   Make  changes  in  IDE   HotSwap  
  12. JRebel  vs  HotSwap   HotSwap   JRebel   Changing  method

     bodies   +   +   Adding/removing  methods   -­‐   +   Adding/removing  constructors   -­‐   +   Adding/removing  fields   -­‐   +   Adding/removing  classes   -­‐   +   Adding/removing  annotaJons   -­‐   +   Replacing  superclass   -­‐   -­‐   Adding/removing  implemented   interfaces   -­‐   -­‐  
  13. MyObject MyObject.class   OldClassLoader Code   101000101   100010010  

    New  code   111000100   101010010   Make  changes  in  IDE   JRebel   Framework   Configura,on   (XML,  annota,ons,..)   JRebel