Apache Commons JCI ReloadingClassLoader [英] Apache Commons JCI ReloadingClassLoader

查看:230
本文介绍了Apache Commons JCI ReloadingClassLoader的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人有使用Apache Commons JCI API的ReloadingClassLoader的经验?

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

唯一的用法示例可以在以下页面中找到: http://commons.apache.org/jci/usage.html

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

我假设每当目录或jar改变时,它会自动重新加载类加载器中的类吗?

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

如果是这样,你必须再次加载/实例化一个先前加载/实例化的类(通过调用loadClass())来使用新修改的类?这是正确的吗?

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?

希望这是明确的。

推荐答案

< a href =http://commons.apache.org/jci/apidocs/org/apache/commons/jci/ReloadingClassLoader.html =nofollow> http://commons.apache.org/jci/apidocs/ org / apache / commons / jci / ReloadingClassLoader.html - 根据这里的最小文档,您需要显式调用loadClass,如果底层资源已更改,那么它将为您提供Class的新图像而不是旧的。

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.

这篇关于Apache Commons JCI ReloadingClassLoader的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆