Apache Commons JCI ReloadingClassLoader

故事扮演 提交于 2019-12-07 04:24:54

问题


Does anyone have any experience in using the ReloadingClassLoader of the Apache Commons JCI API?

The only usage example can found in the following page: http://commons.apache.org/jci/usage.html

I am assuming that whenever the directory or jar changes, it will automatically reload the classes within the classloader?

If so, you would have to load/instantiate a previously loaded/instantiated class (by calling loadClass()) again to use the newly modified class? Is that correct?

Hope this is clear.


回答1:


http://commons.apache.org/jci/apidocs/org/apache/commons/jci/ReloadingClassLoader.html - According to the minimal documentation here, you need to call loadClass explicitly and if the underlying Resource has changed, then it will give you the new image of the Class instead of the old one.

It will be useful to checkout the code since the documentation is not very extensive on this.



来源:https://stackoverflow.com/questions/2203383/apache-commons-jci-reloadingclassloader

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!