|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.util.loading.ContextClassLoader (src)
org.jboss.util.loading.ContextClassLoaderSwitcher
A helper for context classloading switching.
When a security manager is installed, the constructor checks for the runtime permissions "getClassLoader" and "setContextClassLoader". This allows the methods of this class to be used later without having to run in privileged blocks. There are optimized methods to perform the operations within a switch context. This avoids retrieving the current thread on every operation.
Nested Class Summary | |
class |
ContextClassLoaderSwitcher.SwitchContext (src)
A helper class to remember the original classloader and avoid continually retrieveing the current thread. |
Field Summary | |
static org.jboss.util.loading.ContextClassLoaderSwitcher.NewInstance |
INSTANTIATOR
Instantiate a new context class loader switcher |
static java.lang.RuntimePermission |
SETCONTEXTCLASSLOADER
Set the context classloader permission |
Fields inherited from class org.jboss.util.loading.ContextClassLoader (src) |
GETCLASSLOADER |
Method Summary | |
ContextClassLoaderSwitcher.SwitchContext (src) |
getSwitchContext()
Retrieve a switch context |
ContextClassLoaderSwitcher.SwitchContext (src) |
getSwitchContext(java.lang.Class clazz)
Deprecated. using a class to determine the classloader is a bad idea, it has the same problems as Class.forName() |
ContextClassLoaderSwitcher.SwitchContext (src) |
getSwitchContext(java.lang.ClassLoader cl)
Retrieve a switch context and set the new context classloader |
void |
setContextClassLoader(java.lang.ClassLoader cl)
Set the context classloader |
void |
setContextClassLoader(java.lang.Thread thread,
java.lang.ClassLoader cl)
Set the context classloader for the given thread |
Methods inherited from class org.jboss.util.loading.ContextClassLoader (src) |
getContextClassLoader, getContextClassLoader |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.RuntimePermission SETCONTEXTCLASSLOADER
public static final org.jboss.util.loading.ContextClassLoaderSwitcher.NewInstance INSTANTIATOR
Method Detail |
public void setContextClassLoader(java.lang.ClassLoader cl)
public void setContextClassLoader(java.lang.Thread thread, java.lang.ClassLoader cl)
thread
- the threadpublic ContextClassLoaderSwitcher.SwitchContext (src) getSwitchContext()
public ContextClassLoaderSwitcher.SwitchContext (src) getSwitchContext(java.lang.ClassLoader cl)
cl
- the new classloader
public ContextClassLoaderSwitcher.SwitchContext (src) getSwitchContext(java.lang.Class clazz)
clazz
- the class whose classloader should be set
as the context classloader
|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |