Why Doesn’t Java HaveInstant Turnaround?Anton Arhipov | ZeroTurnaround
whoamiAnton ArhipovJRebelZeroTurnaround         http://arhipov.blogspot.com                      @antonarhipov            ...
Turnaround Cycle                            Check      Make a                             the      change                 ...
Diversity
VendorsStandards            Operations      dev <<    PROD
Turnaround Cycle                            Check      Make a                             the      change                 ...
Turnaround Time Sink                          Navigation                 OOMApplication                       deployment  ...
Container Startup Timehttp://dow.ngra.de/2010/12/14/jee-oss-container-startup-times-apples-vs-oranges/
http://zeroturnaround.com/java-ee-productivity-report-2011/
http://zeroturnaround.com/java-ee-productivity-report-2011/
Build                            Check        Make a                             the        change                        ...
Build             Resolve dependencies             Copy static resources                Compile classes           Package ...
Exploded Directory Deployment
Jetty Launcherpublic class Launcher {    public static void main(String[] args) {        Server server = new Server();    ...
“…I know about JRebel, but I cannotpay for it, so I tried Maven…”                          - Stackoverflow
This works:mvn jetty:run  others?
getResource(“hello.html”)   read(“src/main/.../hello.html”)
Build             Resolve dependencies             Copy static resources                Compile classes           Package ...
Build             Resolve dependencies             Copy static resources             Compile classes           Package mod...
Why Code Reloading is Hard?
Why Code Reloading is Hard? Externalized       Temporary              State  Serializable        Derivative
How To Reload a Class?           OldClassLoader         NewClassLoader      MyObject.class                     MyObject.cl...
Serialize/deserialize                                               init()       Session                       Session    ...
Session                  Session           Sevlet       New         SevletClasses                       Classes           ...
Component State                   New        NewClass     Object                   Class     Object Old Component      New...
HotSwap                                           Make changes in IDE        OldClassLoader    MyObject.class     New     ...
JRebel vs HotSwap                               HotSwap   JRebelChanging method bodies           +         +Adding/removin...
JRebel                                               Make changes in IDE                  OldClassLoaderFramework         ...
in action
Oh ...The Acid is Kicking In      Questions?
Remoting BETA
http://arhipov.blogspot.com             @antonarhipov                 @javarebel
Why Doesn't Java Has Instant Turnaround - Con-FESS 2012
Why Doesn't Java Has Instant Turnaround - Con-FESS 2012
Why Doesn't Java Has Instant Turnaround - Con-FESS 2012
Why Doesn't Java Has Instant Turnaround - Con-FESS 2012
Upcoming SlideShare
Loading in...5
×

Why Doesn't Java Has Instant Turnaround - Con-FESS 2012

4,563

Published on

Published in: Technology, Education
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
4,563
On Slideshare
0
From Embeds
0
Number of Embeds
37
Actions
Shares
0
Downloads
10
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide
  • Vendors make money on production =&gt; development is secondaryOperations rule development, best practices are heavily influenced by production needsMultiple participants in the standard working groups means a choice between reducing scope of the standard or reducing its qualityStory: when we tried pitching JRebel to a large Java app server vendor the answer was: why bother?
  • Jetty has support for any app layout, but docs are missing. Maven Jetty plugin is the only workable application of this functionality.RAD &amp; Websphere have decent integration that tries to copy the minimal amount of files possible. Copying isn’t a great idea, though.Weblogic has the split directory structure functionality which is powerful on paperEclipse, NetBeans and IntelliJ IDEA have support for publishing applications from the IDE, which varies from decent to awful.SpringSource has fairly decent integration between tooling and server, but only for tc Server.Jboss used to run Ant on every update in Eclipse, Netbeans still does that
  • Externalized ~= PHP, Database, memcachedetcTemporary ~= StatelessJava frameworks/servers often have too much derivative state and it takes too long to createSerializing helps when it can§
  • If you want to preserve the state, this is what you have to do.
  • Class loader scopeEvery deployed application gets a dedicated class loaderState recreationApplication state is recovered by reinitializationSession state is (optionally) serialized and deserialized in the new class loaderReloading timeApplication reinitialization time, typically around one minuteProblemsLeaks memoryLazy caches need to be warmed up every time
  • Class loader scopeEvery deployed application gets a dedicated class loaderState recreationApplication state is recovered by reinitializationSession state is (optionally) serialized and deserialized in the new class loaderReloading timeApplication reinitialization time, typically around one minuteProblemsLeaks memoryLazy caches need to be warmed up every time
  • Class loader scopeClass loader per component/serviceState recreationState restored by framework (component/service recreated)Reloading time(Almost) InstantProblemsOnly managed components can be reloadedManaged components referring unmanaged code can be a problem (twin class issues)
  • Why Doesn't Java Has Instant Turnaround - Con-FESS 2012

    1. 1. Why Doesn’t Java HaveInstant Turnaround?Anton Arhipov | ZeroTurnaround
    2. 2. whoamiAnton ArhipovJRebelZeroTurnaround http://arhipov.blogspot.com @antonarhipov @javarebel
    3. 3. Turnaround Cycle Check Make a the change change Build, de ploy, wai t
    4. 4. Diversity
    5. 5. VendorsStandards Operations dev << PROD
    6. 6. Turnaround Cycle Check Make a the change change Build, de ploy, wai t
    7. 7. Turnaround Time Sink Navigation OOMApplication deployment Container startup time
    8. 8. Container Startup Timehttp://dow.ngra.de/2010/12/14/jee-oss-container-startup-times-apples-vs-oranges/
    9. 9. http://zeroturnaround.com/java-ee-productivity-report-2011/
    10. 10. http://zeroturnaround.com/java-ee-productivity-report-2011/
    11. 11. Build Check Make a the change change Build, deploy, wait
    12. 12. Build Resolve dependencies Copy static resources Compile classes Package modules into JARs Package everything into WAR/EAR
    13. 13. Exploded Directory Deployment
    14. 14. Jetty Launcherpublic 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(); }}
    15. 15. “…I know about JRebel, but I cannotpay for it, so I tried Maven…” - Stackoverflow
    16. 16. This works:mvn jetty:run others?
    17. 17. getResource(“hello.html”) read(“src/main/.../hello.html”)
    18. 18. Build Resolve dependencies Copy static resources Compile classes Package modules into JARs Package everything into WAR/EAR
    19. 19. Build Resolve dependencies Copy static resources Compile classes Package modules into JARs Package everything into WAR/EAR
    20. 20. Why Code Reloading is Hard?
    21. 21. Why Code Reloading is Hard? Externalized Temporary State Serializable Derivative
    22. 22. How To Reload a Class? OldClassLoader NewClassLoader MyObject.class MyObject.class Recreate object MyObject MyObject
    23. 23. Serialize/deserialize init() Session Session Sevlet New SevletClasses Classes App App New StateLibraries State Libraries OldClassLoader NewClassLoader
    24. 24. Session Session Sevlet New SevletClasses Classes App App New State State Libraries OldClassLoader NewClassLoader
    25. 25. Component State New NewClass Object Class Object Old Component New Component ClassLoader ClassLoader
    26. 26. HotSwap Make changes in IDE OldClassLoader MyObject.class New HotSwap Code code Debugger 111000100 101000101 101010010 100010010 New code 111000100 101010010 MyObject
    27. 27. JRebel vs HotSwap HotSwap JRebelChanging method bodies + +Adding/removing methods - +Adding/removing constructors - +Adding/removing fields - +Adding/removing classes - +Adding/removing annotations - +Replacing superclass - -Adding/removing implemented - -interfaces
    28. 28. JRebel Make changes in IDE OldClassLoaderFramework MyObject.class Code 101000101 New code JRebel 100010010 111000100 101010010 MyObject Configuration (XML, annotations,..)
    29. 29. in action
    30. 30. Oh ...The Acid is Kicking In Questions?
    31. 31. Remoting BETA
    32. 32. http://arhipov.blogspot.com @antonarhipov @javarebel
    1. A particular slide catching your eye?

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

    ×