[jboss-user] [JBoss Microcontainer Users] - Re: Getting to a ClassInfo's ClassLoader

alesj do-not-reply at jboss.com
Wed Oct 14 11:43:40 EDT 2009


How do we use it elsewhere/before?

Looking at the Javassist usage, it seems we need to change it a bit.


  |    public Class<? extends Object> getType()
  |    {
  |       if(clazz == null)
  |          clazz = JavassistUtil.ctClassToClass(ctClass);
  |       
  |       return clazz;
  |    }
  | 

This first delegates the loading to JavassistUtil.class.getClassLoader() and only then to CtClass::toClass.
Meaning we wouldn't use our new Classpool notion first, only after it would fail via first try.

Perhaps new getClassLoader method on TypeInfo?

btw: don't forget to check for security or add permission blocks on who can use it

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4260339#4260339

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4260339



More information about the jboss-user mailing list