commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [discovery] How to get class context?
Date Fri, 28 Jun 2002 20:27:26 GMT
>>> 2. caller class loader ( i.e. up the stack, and find the class that
>>> called LogFactory.getLog() and use it's loader ). This will locate
>>> loggers in the same loader with the caller ( for example if an app
>>> creates it's own loader, which includes a particular logger )
>> Is this feasible in a pre-1.4 JVM?  I didn't think the necessary
>> was available earlier, so maybe this will have to be 1.4 specific.

> Throwable.getStackTrace() is 1.4 specific.

> SecurityManager.getClassContext() is there from 1.1. I never used
> it ( except in sandbox mode), but it does the same thing
> ( without the method names and line numbers - we only need the classes).

SecurityManager.getClassContext() is protected.  We could TRY to create a
wrapper class, but that's likely to break security in a J2EE environment.

Playing the Log4j game gives us the NAME of a class, but not the class
itself... if we resolve the name to obtain the class, then we've KNOW the
classloader used.. but we still don't know the class loader used by the

Other bright ideas?


Richard A. Sitze  
CORBA Interoperability & WebServices
IBM WebSphere Development
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message