java.lang.Object | |
↳ | com.atlassian.plugin.util.ClassLoaderStack |
This utility provides a thread local stack of ClassLoaders.
The current "top" of the stack is the thread's current context class loader.
This can be used when implementing delegating plugin java.util.logging.Filters or javax.servlet.Servlets
that need to set the ClassLoader
to the PluginClassLoader
the filter
or servlet is declared in.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Pops the current ContextClassLoader off the stack, setting the new ContextClassLoader to the previous one on the stack.
| |||||||||||
Makes the given classLoader the new ContextClassLoader for this thread, and pushes the current ContextClassLoader
onto a ThreadLocal stack so that we can do a
pop() operation later to return to that ContextClassLoader. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Pops the current ContextClassLoader off the stack, setting the new ContextClassLoader to the previous one on the stack.
Makes the given classLoader the new ContextClassLoader for this thread, and pushes the current ContextClassLoader
onto a ThreadLocal stack so that we can do a pop()
operation later to return to that ContextClassLoader.
Passing null is allowed and will act as a no-op. This means that you can safely pop()
a ClassLoader and push(ClassLoader)
it back in
and it will work safely whether the stack was empty at time of pop()
or not.
loader | The new ClassLoader to set as ContextClassLoader. |
---|