Package org.picocontainer.references
Class ThreadLocalMapObjectReference<T>
- java.lang.Object
-
- org.picocontainer.references.ThreadLocalMapObjectReference<T>
-
- All Implemented Interfaces:
ObjectReference<T>
public class ThreadLocalMapObjectReference<T> extends java.lang.Object implements ObjectReference<T>
Gets and sets references on a map stored in Thread Local- Author:
- Paul Hammant
-
-
Constructor Summary
Constructors Constructor Description ThreadLocalMapObjectReference(java.lang.ThreadLocal<java.util.Map<java.lang.Object,T>> threadLocal, java.lang.Object componentKey)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tget()Retrieve an actual reference to the object.voidset(T item)Assign an object to the reference.
-
-
-
Constructor Detail
-
ThreadLocalMapObjectReference
public ThreadLocalMapObjectReference(java.lang.ThreadLocal<java.util.Map<java.lang.Object,T>> threadLocal, java.lang.Object componentKey)
-
-
Method Detail
-
get
public T get()
Description copied from interface:ObjectReferenceRetrieve an actual reference to the object. Returns null if the reference is not available or has not been populated yet.- Specified by:
getin interfaceObjectReference<T>- Returns:
- an actual reference to the object.
-
set
public void set(T item)
Description copied from interface:ObjectReferenceAssign an object to the reference.- Specified by:
setin interfaceObjectReference<T>- Parameters:
item- the object to assign to the reference. May benull.
-
-