"adrian(a)jboss.org" wrote : You can getCallerClassLoader() using code similar to
the HACK class in the classloader project, although it is suble because you need to skip
reflection classes.
Probably there is no reflection invocation in classloading code?
| protected Class<?> getRequestingClass(Class[] stack)
| {
| for (Class clazz : stack)
| {
| if (Hack.class.isAssignableFrom(clazz) == false &&
| JDKChecker.class.isAssignableFrom(clazz) == false &&
| BaseClassLoaderDomain.class.isAssignableFrom(clazz) == false &&
| BaseClassLoaderPolicy.class.isAssignableFrom(clazz) == false &&
| ClassLoader.class.isAssignableFrom(clazz) == false &&
| Class.class.isAssignableFrom(clazz) == false)
| {
| return clazz;
| }
| }
| throw new RuntimeException("Should not be here!");
| }
|
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4087301#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...