Dynamically loadable and unloadable application modules in Java - how?

后端 未结 5 2016
醉酒成梦
醉酒成梦 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:44

    If you follow the ClassLoader route (is not that difficult, really), I suggest each module to be packaged in its own jar, and use a different ClassLoader to read each jar. that way, unloading a module is the same as "discarding" the ClassLoader.

提交回复
热议问题