2013年1月30日
摘要: 在OSGi环境中,在Bundle内部代码中要得到自己Bundle的ClassLoader就很简单,在自己Bundle的代码中,直接写this.getClass().getClassLoader()就得到了自己Bundle的ClassLoader了。但怎么在其他Bundle或外部代码中得到任意一个Bundle的ClassLoader呢?Bundle和BundleContext都没有提供getClassLoader方法来获取,我就用了一种比较另类的方法来获取。突破口就在Bundle.loadClass(String className)方法,目前此方法已经在QuickWebFramework中应用了。 阅读全文
posted @ 2013-01-30 14:42 aaaSoft 阅读(3362) 评论(0) 推荐(0) 编辑