Jhonney的专栏

   ----人见人爱
随笔 - 49, 文章 - 1, 评论 - 23, 引用 - 0
数据加载中……

classloader总结

项目时需要对外提供一些服务接口,写了接口及其实现发现报castClassException,当时newInstance时采用
Thread.currentContext.getClassLoader的形式,分析了一下发现平台采用了自己的classloader

1.java的classloader采用双亲委托的机制
2.当前类加载器和线程上下文的区别是,当前类加载器在加载caller类时已经确定,但thread's context classloader is modifiable
3.thread's classloader can break through the parent delegation mechanism of classloader
4.it is should keep the thread's classloader same as current class classloader
5.the default form of class.forname isn't recommend,because of exception of initializing static field if the classloader is not
destroied
6.banq comment about adoption thread's  classloader is not correctly

posted on 2008-04-04 16:45 Jhonney 阅读(254) 评论(0)  编辑  收藏 所属分类: 原创区


只有注册用户登录后才能发表评论。


网站导航: