Traditional way is to use custom classloader. However, it's not an ideal solution, such as incompatibility of old and new version classes... You can get detailed info on how to write custom classloader in application server in book "Server-Based Java Programming" or by google. There are some interesting talking on how to support it in JVM in following posts. Currently JVM doesn't support class hotswap at 'run' time. http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4910812 http://forum.java.sun.com/thread.jspa?threadID=572396&tstart=0 However, JVM alreay supports
hotswap at 'debug' time. An interesting project
HotSwapTool leverages the feature and enables hot swap for applications. The tool can hot swap class for an application which runs at debug mode, just as WPS runs in debug mode. I tried it for a simple Java application, and it works! So at least we can hot deploy new class to WPS in debug mode...
Class Hotswap
最新推荐文章于 2022-09-02 10:37:35 发布