java.lang.Object
org.apache.commons.beanutils.ContextClassLoaderLocal
- public class ContextClassLoaderLocal
- extends java.lang.Object
A value that is provided per (thread) context classloader.
Patterned after ThreadLocal.
There is a separate value used when Thread.getContextClassLoader() is null.
This mechanism provides isolation for web apps deployed in the same container.
Note: A WeakHashMap bug in several 1.3 JVMs results in a memory leak
for those JVMs.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
valueByClassLoader
private java.util.Map valueByClassLoader
globalValueInitialized
private boolean globalValueInitialized
globalValue
private java.lang.Object globalValue
ContextClassLoaderLocal
public ContextClassLoaderLocal()
initialValue
protected java.lang.Object initialValue()
- Returns the initial value for this ContextClassLoaderLocal
variable. This method will be called once per Context ClassLoader for
each ContextClassLoaderLocal, the first time it is accessed
with get or set. If the programmer desires ContextClassLoaderLocal variables
to be initialized to some value other than null, ContextClassLoaderLocal must
be subclassed, and this method overridden. Typically, an anonymous
inner class will be used. Typical implementations of initialValue
will call an appropriate constructor and return the newly constructed
object.
get
public java.lang.Object get()
- Gets the instance which provides the functionality for BeanUtils.
This is a pseudo-singleton - an single instance is provided per (thread) context classloader.
This mechanism provides isolation for web apps deployed in the same container.
set
public void set(java.lang.Object value)
- Sets the value - a value is provided per (thread) context classloader.
This mechanism provides isolation for web apps deployed in the same container.
unset
public void unset()
- Unsets the value associated with the current thread's context classloader
unset
public void unset(java.lang.ClassLoader classLoader)
- Unsets the value associated with the given classloader