Dynamically loadable and unloadable application modules in Java - how?

后端 未结 5 2002
醉酒成梦
醉酒成梦 2021-02-10 17:47

I\'m writing a server application which makes use of external modules. I would like to make them to be upgradeable without requiring server restart. How do I do that? I\'ve foun

5条回答
  •  再見小時候
    2021-02-10 18:27

    What you're going for is definitely possible. I believe that you can unload classes from memory by loading them in a separate ClassLoader and then disposing that ClassLoader. If you're not wanting to go all out and use OSGI, I'd recommend something like JBoss Microcontainer (http://www.jboss.org/jbossmc) or ClassWorlds (http://classworlds.codehaus.org/). It's not too terribly difficult to write something like this from scratch if your needs are specialized enough.

    Hope this helps, Nate

提交回复
热议问题