不用重启使用新Class - JavaRebel Brings Class Reloading
作者:anotherbug 日期:2007-10-13 14:33:47
| 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 次评分)
评论: 39 | 查看次数: 7099
发表评论
订阅
上一篇
|

文章来自:
标签: 





干洗连锁
干洗设备
干洗
美国ucc国际洗衣连锁
美国ucc干洗
干洗店
干洗机
水洗设备
洗鞋设备
洗涤价格
干洗机价格
干洗连锁
干洗设备
干洗
美国ucc国际洗衣连锁
美国ucc干洗
干洗店
干洗机
水洗设备
洗鞋设备
洗涤价格
干洗机价格
Fashion Brown Ceramic Ring jewelry
Gemstone Jewelry
Sterling Silver & Gemstone Wholesale Jewelry
Wholesale Tungsten & Ceramic Ring Jewelry
Wholesale Titanium Rings Jewelry
Laser Engraved Titanium Rings Jewelry
Wholesale Ceramic Ring
Tungsten Rings with Inlay Jewelry
Laser Engraved Tungsten Rings Wholesale Jewelry
925 SiIlver Wholesale Jewelry
Fashion Tungsten Pendant jewelry
Wholesale White Ceramic Rings Jewelry
Ring Wholesale Jewelry
Necklace Jewelry
Stud
Polished Ceramic Rings
Gemstone Jewelry
Faceted Ceramic Rings Jewelry
Acrylic Crystal Wholesale Jewelry
Wholesale Sterling Silver Jewelry
Fashion Silver & Brass jewelry
Special Ring Wholesale Jewelry
Wholesale Sterling Silver & Gemstone
Brooch Jewelry
Earring
Polished Tungsten Rings
Bracelet
Laser Engraved Ceramic Rings
Sterling Silver Wholesale Jewelry
Fashion Tungsten Ring with CZ Stone jewelry
Ceramic Wedding bands
Glass Wholesale Jewelry
Fashion Tungsten Engagement Rings jewelry
Grooved Titanium Rings Jewelry
Acrylic Crystal
Faceted Tungsten Rings Jewelry
Fashion Brushed Titanium Rings jewelry
Wholesale Eardrop
Wholesale Glass Jewelry
Alloy Wholesale Jewelry
Tous les serveurs (carto wow) 30% de réduction rapide satisfait à 100% et sécuritaire carte wow
Le moins cher carte wow , $ 2 = 1000G Prix spécial au sein de ce mois-ci!
美图
追月
笑话
搞笑
星座
测试
游戏
女性
诱惑
财经
美女
新闻
搞笑
星座
测试
游戏
诱惑
财经
新闻
搞笑
星座
测试
游戏
诱惑
财经
TCM
Diabeat
主要经营:[佳吉快运公司]-[上海佳吉快运]-[佳吉快运]-[wow gold]-[中铁快运]-[上海中铁快运]-[中铁物流]-[德邦物流]-[德邦物流公司]-[上海德邦物流]-[德邦物流电话]-[德邦物流网站]-[华宇物流]-[上海华宇物流]-[华宇物流公司]
sdsa
中医
TCM
起名公司
虚拟主机
网站建设
北京seo
网站优化
电脑维修
垃圾桶
垃圾箱
果皮箱
分类垃圾桶
分类垃圾箱
环卫用品
物业采购
北京租车
北京租车服务
网站优化
google优化
品牌搜索网
生物灭螂 网站建设
google优化
防水卷材
北京google优化
上海google优化
上海装饰建材网
网站优化
google优化
品牌搜索网
生物灭螂
网站建设
google优化
防水卷材
防水卷材
防水卷材
防水卷材
防水卷材
防水卷材
防水卷材
防水卷材
防水卷材
防水卷材
上海装饰建材网
网站优化
google优化
品牌搜索网
生物灭螂
网站建设
google优化
鸿阳装潢
上海装饰