Wdjhit javaone-2011-aa

784 views
708 views

Published on

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

  • Be the first to like this

No Downloads
Views
Total views
784
On SlideShare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
13
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Wdjhit javaone-2011-aa

  1. 1. Why Doesn’t Java Have Instant Turnaround? Anton Arhipov @antonarhipov Product Lead at ZeroTurnaround
  2. 2. twitter.com/ekabanov
  3. 3. Turnaround cycle Check Make a the change change Build, deploy, wait twitter.com/ekabanov
  4. 4. What about others? twitter.com/ekabanov
  5. 5. Why Java is heavier than others? Vendors Standards Operations Dev << Prod twitter.com/ekabanov
  6. 6. A typical web application build Resolve dependencies Copy static resources Compile classes Package modules in JARs Package everything in a WAR/EAR twitter.com/ekabanov
  7. 7. Exploded layout twitter.com/ekabanov
  8. 8. Automatic building twitter.com/ekabanov
  9. 9. Deployment by linking Linux symbolic links • ln -s • Symlinks can point to any file Windows symbolic links • Sysinternals junction utility on NTFS partitions, included in Windows 7 • Can only link to local directories and must be careful when deleting twitter.com/ekabanov
  10. 10. 2008 => 2011Help!is downloading the internets! twitter.com/ekabanov
  11. 11. 2008 => 2011 this works: mvn jetty:run others? twitter.com/ekabanov
  12. 12. App Server WorkspacegetResource(“hello.html”) read(“src/main/.../hello.html”) twitter.com/ekabanov
  13. 13. A typical web application build Resolve dependencies Copy static resources Compile classes Package modules in JARs Package everything in a WAR/EAR twitter.com/ekabanov
  14. 14. Why code reloading is so hard? Externalized Temporary State Serializable Derivative twitter.com/ekabanov
  15. 15. Reloading an Object OldClassLoader NewClassLoader MyObject.class MyObject.class Recreate the object MyObject MyObject twitter.com/ekabanov
  16. 16. Web Deployment Serialize/deserialize init() Session Session Sevlet New Sevlet Classes Classes App App New State Libraries State Libraries OldClassLoader NewClassLoader twitter.com/ekabanov
  17. 17. Twin ClassLoader Issues Classes Classes Objects Objects and Code and Code Libraries Libraries OutOfMemoryError ClassCastException OldClassLoader … NewClassLoader JVM twitter.com/ekabanov
  18. 18. 2008 => 2011 twitter.com/ekabanov
  19. 19. Frameworks twitter.com/ekabanov
  20. 20. 2008 => 2011 twitter.com/ekabanov
  21. 21. Component State New NewClass Object Class Object Old Component New Component ClassLoader ClassLoader twitter.com/ekabanov
  22. 22. JVM Languages Class-based languages have same limitations as Java Groovy Jython Non-class based languages can have better support JRuby Clojure twitter.com/ekabanov
  23. 23. HotSwap User saves class from IDE OldClassLoader MyObject.class New Code Code HotSwap 111000100 101000101 Debugger 101010010 100010010 New Code 111000100 101010010 MyObject twitter.com/ekabanov
  24. 24. JRebel Class Reloading 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 twitter.com/ekabanov
  25. 25. JRebel MyObject.class file OldClassLoader changed MyObject.class New Code Code JRebel 111000100 101000101 agent 101010010 100010010 New Code 111000100 101010010 MyObject twitter.com/ekabanov
  26. 26. JRebel MyObject.class file Configuration changed OldClassLoader changedFramework MyObject.class Classes New Code Code JRebel 111000100 101000101 101010010 100010010 New Code agent 111000100 101010010 MyObject Configuration (XML, annotations, …) twitter.com/ekabanov
  27. 27. JRebel Integration IDEs Containers Frameworks Build Tools twitter.com/ekabanov
  28. 28. Who is already using JRebel?Banking & FSI Web IT Telco Air / Auto Healthcare Consulting Fashion/Entertain ment twitter.com/ekabanov
  29. 29. (how awesome is that?) Over 40 million builds, redeploys & restarts prevented for 20,000+ Java developers twitter.com/ekabanov
  30. 30. Oracle Weblogic FastSwap<container-descriptor> <fast-swap>true</fast-swap></container-descriptor> weblogic-application.xml twitter.com/ekabanov
  31. 31. Q: Why Doesn’t Java HaveInstant Turnaround? A1: Other languages/platforms aren’t much better! A2: Reloading code is easy, preserving state is hard! A3: It’s better than it used to be! A4: Play!, Tapestry 5 and Grails do that! A5: But what about JRebel? twitter.com/ekabanov
  32. 32. Q? twitter.com/ekabanov
  33. 33. And also…Instant, online rollout and rollback ofchanges to production Java EE appsfor any deployment size. twitter.com/ekabanov

×