Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apache Commons JCI ReloadingClassLoader

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.

like image 309
onejigtwojig Avatar asked Nov 06 '22 16:11

onejigtwojig


1 Answers

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.

like image 165
Pavan Avatar answered Nov 11 '22 14:11

Pavan