|
|||||
FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This MetaBeanProperty will create a pseudo property whose value is bound to the current Thread using soft references. The values will go out of scope and be garabage collected when the Thread dies or when memory is required by the JVM
The property uses an InheritableThreadLocal instance internally so child threads will still be able to see the propertyField Summary | |
---|---|
ThreadLocal |
PROPERTY_INSTANCE_HOLDER
|
String |
PROPERTY_SET_PREFIX
|
def |
ZERO_ARGUMENT_LIST
|
Class |
declaringClass
|
ThreadBoundGetter |
getter
|
Object |
initialValue
|
Closure |
initialValueCreator
|
ThreadBoundSetter |
setter
|
Constructor Summary | |
ThreadManagedMetaBeanProperty(Class declaringClass, String name, Class type, Object iv)
Constructs a new ThreadManagedBeanProperty for the given arguments |
|
ThreadManagedMetaBeanProperty(Class declaringClass, String name, Class type, Closure initialValueCreator)
Constructs a new ThreadManagedBeanProperty for the given arguments |
Method Summary | |
---|---|
MetaMethod |
getGetter()
|
Object |
getInitialValue()
Retrieves the initial value of the ThreadBound property |
Object |
getInitialValue(Object object)
|
MetaMethod |
getSetter()
|
static Map |
getThreadBoundPropertMap()
|
static Object |
getThreadBoundPropertyValue(Object obj, String name, Object initialValue)
|
void |
setInitialValueCreator(Closure callable)
Closure responsible for creating the initial value of thread-managed bean properties |
static Object |
setThreadBoundPropertyValue(Object obj, String name, Object value)
|
Constructor Detail |
---|
public ThreadManagedMetaBeanProperty(Class declaringClass, String name, Class type, Object iv)
public ThreadManagedMetaBeanProperty(Class declaringClass, String name, Class type, Closure initialValueCreator)
Method Detail |
---|
public MetaMethod getGetter()
public Object getInitialValue()
public Object getInitialValue(Object object)
public MetaMethod getSetter()
static Map getThreadBoundPropertMap()
static Object getThreadBoundPropertyValue(Object obj, String name, Object initialValue)
public void setInitialValueCreator(Closure callable)
static Object setThreadBoundPropertyValue(Object obj, String name, Object value)