订阅所有JSP/Servlet的日志 订阅 | 这是最新一篇日志 上一篇 | 下一篇日志 下一篇 ]
JAVA技术

不用重启使用新Class - JavaRebel Brings Class Reloading

附件
javarebel-logo.gif(5.8 K)
 
切换到幻灯片模式

JavaRebel Brings Class Reloading to Java


JavaRebel reloads changes to Java classes on-the-fly without redeploy or restart including new methods and fields. It is a generic solution that works for standalone Java applications as well as application servers. For the impatient: watch the demonstration screencast (~5 mins) and download.

Ever since HotSwap support has been introduced in Java 1.4 people have been craving for more. As witnessed by this bug in the Sun database and numerous other discussions changing method bodies was just not enough. Dynamic languages like Ruby were quick enough to capitalize on this lack, touting Java EE development as slow and cumbersome.

As time passed by, people have tried to work around the limitation by reloading classes along with their classloader. However since this requires reconstruction of the object state, it will only work in a controlled and limited environment ?e.g. that of a web framework like RIFE, Tapestry 5 and so on.

Just as many others, we were working on a workaround. However, instead of limiting ourselves to the facilities provided by the Java platform, we devised a whole new approach. Using bytecode modification and a little bit of magic, JavaRebel extends the JVM with the ability to reload almost arbitrary changes to classes on-the-fly. This includes adding and removing both methods and fields and the only forbidden changes are to 'extends' and 'implements' clauses. Since all the existing object instances are preserved the application and server can continue running and code changes are immediately visible in the application.

Watch the demonstration screencast (~5 mins), read the feature list or just download JavaRebel from ZeroTurnaround.com and give it a try. Disclaimer: JavaRebel is commercial software with a free trial for 14 days and developer seat cost at 99$.


Features


JavaRebel reloads only individual class files (e.g. the ones in WEB-INF/classes). This allows to use IDE to compile the classes to the output folder and see the changes immediately. The following changes are supported:



  • Changing, adding and removing class/interface methods

  • Changing, adding and removing class fields

  • Changing, adding and removing class constructors

  • Overriding existing methods

  • Creating new classes or renaming old ones (as long as some other class superclass doesn’t change)

  • Changing method parameter or return types or field type without changing its name

  • Changing, adding and removing class/interface constant fields is supported, but will not get reinitialized and thus is only useful for primitive types and Strings


Changing superclass and implemented interfaces is not supported and in such cases JavaRebel will issue a warning.


Note that JavaRebel adds a performance penalty to the application and should be used only in a development environment. Be sure to to switch it off for performance tests.


Comparison


This compares the changes that JavaRebel can reload to those that Sun JVM implementation reloads when debugger is attached (HotSwap).


























































Sun JVM HotSwap JavaRebel
Creating new classes + +
Changing method bodies + +
Adding/removing methods - +
Adding/removing constructors - +
Adding/removing fields - +
Overriding methods - +
Changing method or field types - +
Changing interfaces - +
Changing superclass - -
Changing implemented interfaces - -

Supported JVMs



  • Sun Java 1.4.x

  • Sun Java 5.x

  • Sun Java 6.x

  • JRockit JVM 8.1sp6 or later

  • JRockit JVM 9.x 1.5.0_06 or later


Supported Application Servers:



  • BEA Weblogic 8.x, 9.x, 10.x

  • Oracle OC4J 10.x

  • Oracle OC4J 9.x (on Java 5 or later)

  • Tomcat 4.x, 5.x, 6.x (on Java 5 or later)

  • JBoss 3.x, 4.x (on Java 5 or later)

  • Jetty 5.x, 6.x (on Java 5 or later)



视频演示地址:http://files.zeroturnaround.com/docs/javarebel-jpetstore-screencast/

官方网址:http://www.zeroturnaround.com/javarebel/features

平均得分
(0 次评分)





文章来自: 本站原创
标签: Class JavaRebel Reloading 
评论: 34 | 查看次数: 6519
  • 共有 34 条评论
  • 1
  • 2
  • 3
  • |
  • >>
beeflee [2009-10-13 13:24:57]
beeflee [2009-08-25 14:47:16]
beeflee [2009-08-24 17:54:31]
beeflee [2009-06-09 12:08:26]
sijialgc [2009-05-04 15:50:43]
beeflee [2009-04-29 14:58:48]
pailiko001 [2009-03-12 10:02:28]
游客 [2009-01-09 17:33:25]
游客 [2009-01-09 08:45:42]
游客 [2009-01-08 14:15:45]
不倫ありませんか!メル友無料募集サイト女子高生人妻DX人妻Magic!!出会い探し人妻がハマる出会い系プチ家出掲示板NO.1!リターンズ素敵な恋人探し素敵なメル友探しスタビLuxury出会い系サーチ出会いの森セフレPlaySpotセックスフレンド大陸出会い系オンリー出会い-Loversセフレステーションご近所の人妻探し出会い探し出会い系サイトFreedom出会い系案内所ピンクの恋人セックスフレンド無料サイト-プレミアムメル友を探そう出会い放題ご近所のアイシテル!メル友ちぇき!セフレ伝説ご近所のメル友探し不倫人妻秘密サークル
游客 [2008-12-13 10:40:01]
游客 [2008-12-05 18:41:11]
游客 [2008-11-18 19:23:21]
游客 [2008-11-01 13:47:58]
游客 [2008-10-22 16:35:28]
Buy Lotro Gold | Lord Of The Rings Online Gold
Lotro Accounts
| Buy Lotro Accounts
Lord Of The Rings Online Power Leveling | Lord Of The Rings Online PowerLeveling
Lotro Cd Key | Lord Time Card
Lotro Gold | Lotro Gold Instant Delivery
lord of the rings online accounts | lord of the rings online accounts for sale
Lotro Power Leveling | Lotro Powerleveling
Lord Of The Rings Online Cd Key | Lord Of The Rings Online Time Card
Lord of the Rings Online Gold
Buy Lotro Gold
Sell LoTRO Gold
LoTRO CD Key
LoTRO Europe Gold
Cheap LoTRO Accounts
Lord of the Rings Online Power Leveling
Lord of the Rings online CD Key
Cheap Lotro Gold
Air Jordan Shoes
Warhammer Gold
Warhammer Online Gold
Warhammer Accounts
Warhammer Power Leveling
Warhammer Online Key
Warhammer Gold
Warhammer Online Gold
Warhammer Time Card
Warhammer CD Key
WAR gold
warhammer online gold
Buy WAR gold
Buy warhammer gold
Buy warhammer online gold
warhammer gold
WAR Accounts
warhammer Accounts
warhammer online Accounts
Buy WAR Accounts
warhammer Accounts for sale
Warhammer Power Leveling
Warhammer Online Power Leveling
War Power Leveling
Buy Warhammer Power Leveling
Warhammer PowerLeveling
Cheap Warhammer Power Leveling
Cheap Warhammer Online Power Leveling
Buy War Power Leveling
Warhammer EU Power Leveling
Cheap Warhammer Gold
Cheap Warhammer online gold
Buy Cheap Warhammer Gold
Buy WAR Gold
Warhammer EU Gold
Warhammer EU Power Leveling
Warhammer EU CD Key
Warhammer EU Accounts
Warhammer CD Key
Warhammer online CD Key
Warhammer Timecard
Buy Warhammer Time Card
Warhammer 60 days Time Card
Cheap WAR Accounts
Cheap warhammer Accounts
Cheap warhammer online Accounts
Buy Cheap WAR Accounts
buy Warhammer CD Key
buy Warhammer online CD Key
cheap Warhammer CD key
warhammer time card
Warhammer prepaid time card
  • 共有 34 条评论
  • 1
  • 2
  • 3
  • |
  • >>
发表评论
昵 称:  登录
内 容:
选 项:
字数限制 1000 字 | UBB代码 开启 | [img]标签 开启