标签:spring-loaded的使用 java热部署 hotswap 实现tomcat热部署
The redefinition may change method bodies, the constant pool and attributes. The redefinition must not add, remove or rename fields or methods, change the signatures of methods, or change inheritance. These restrictions maybe be lifted in future versions.
Spring Loaded is a JVM agent for reloading class file changes whilst a JVM is running. It transforms classes at loadtime to make them amenable to later reloading. Unlike 'hot code replace' which only allows simple changes once a JVM is running (e.g. changes to method bodies), Spring Loaded allows you to add/modify/delete methods/fields/constructors. The annotations on types/methods/fields/constructors can also be modified and it is possible to add/remove/change values in enum types.
package test; import demo.A; public class TestPreMain { // -javaagent:springloaded-1.2.0.RELEASE.jar -noverify public static void main(String[] args) throws Exception { A a = new A(); while (true) { a.say(); Thread.sleep(3000); } } }
-javaagent:springloaded-1.2.0.RELEASE.jar -noverify
set JAVA_OPTS=-javaagent:springloaded-1.2.0.RELEASE.jar -noverify
使用spring-loaded开源项目,实现java程序和web应用的热部署
标签:spring-loaded的使用 java热部署 hotswap 实现tomcat热部署
原文地址:http://blog.csdn.net/aitangyong/article/details/40746355