订阅所有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 
评论: 11 | 查看次数: 2043
  • 共有 11 条评论
游客 [2008-08-25 22:57:47]
游客 [2008-08-07 14:23:08]
游客 [2008-08-07 13:30:14]
For those who are inexperienced with purchasing the lotro gold,lotro accountsand lotro powerleveling from lotro goldsellers,there are many lotro gold sellers that are frauds and scams that can not be removed from the internet.Firstly.reviewsof the lord of the rings online gold sellers and hearing out what other customers have to see can be very helpful.
wow gold
buy wow gold
lotro gold
aoc gold
lineage 2 adena
wow gold
buy wow gold
lotro gold
aoc gold
lineage 2 adena

lotro gold
lotro gold for sale
lord of the rings online gold
游客 [2008-08-07 13:29:49]
For those who are inexperienced with purchasing the lotro gold,lotro accountsand lotro powerleveling from lotro goldsellers,there are many lotro gold sellers that are frauds and scams that can not be removed from the internet.Firstly.reviewsof the lord of the rings online gold sellers and hearing out what other customers have to see can be very helpful.
wow gold
buy wow gold
lotro gold
aoc gold
lineage 2 adena
wow gold
buy wow gold
lotro gold
aoc gold
lineage 2 adena

lotro gold
lotro gold for sale
lord of the rings online gold
游客 [2008-08-06 14:16:31]
游客 [2008-08-01 11:40:32]
游客 [2008-07-25 17:18:26]
游客 [2008-07-24 05:55:58]
游客 [2008-06-18 11:14:16]
游客 [2008-06-13 11:25:07]
精油
论文发表
上海翻译公司
上海翻译
英语培训
英语口语
神经性皮炎
皮炎
湿疹
荨麻疹
慢性荨麻疹
藏獒
液压缸
油缸
破碎机
北京旅游
北京旅行社
条码机
条码打印机
条形码打印机
阴茎增大
伟哥
发酵罐
冰淇淋
加盟店
冷饮店
冰淇淋机
冰淇淋粉
冰激凌
大豆床上用品
保健内衣
羊绒内衣
大豆纤维面料
团购礼品
移民
投资移民
商业移民
技术移民
美国移民
澳洲移民
德国移民
英国移民
加拿大移民
热电偶插头
测温线
热电阻
硅碳棒
除湿机
抽湿机
工业除湿机
空气净化器
空气净化机
吸塑机
纸管机
无缝管
合金管
无缝管
无缝钢管
高血压
无线网桥
无线监控
产品设计
men spa beijing
men massage beijing
pearl jewelry
Beijing Tour
china Tour
beijing Tour
china Tour
beijing Tour
China Necklace Wholesale
China Bracelet Wholesale
China Ring wholesale
China gemstone beads wholesale
China Jewelry Accessories wholesale
China Semiprecious beads wholesale
replica handbag
replica tiffany
replica watches
louis vuitton replica
chanel replica
gucci replica
Chinese language
Chinese learn
learning Chinese
learn mandarin
ecosway
gasifier
coal gas
coal gasification
pro dj cases
beijing tour
beijing tours
beijing travel
beijing tours
china tour
beijing
china tours
china travel
beijing china
china beijing
beijing hotel
beijing hotels
China Flights
carved fireplace
stone bathtub
marble fountain
marble bench
marble fireplace
marble sculpture
marble columns
marble lions
marble doorway
marble gazebo
marble pillar
marble fireplace surround
marble statue
marble bathtub
yxxiao0929 [2007-10-15 14:29:49]
你试过了没?好用不,经常为重启而头疼呢
  • 共有 11 条评论
发表评论
昵 称:  登录
内 容:
选 项:
字数限制 1000 字 | UBB代码 开启 | [img]标签 开启