public class ERXThreadStorage extends Object
The system property er.extensions.ERXThreadStorage.useInheritableThreadLocal
defines if the
thread storage can be either inherited by client threads (default) or get used only by the current thread.
The usage of some types of objects inherited from the parent thread can cause problems.
The system property er.extensions.ERXThreadStorage.logUsageOfProblematicInheritedValues
defines, if potential problems should be logged. This defaults to true
when running in development mode
and to false
when running a deployed application.
Modifier and Type | Class and Description |
---|---|
protected static class |
ERXThreadStorage.ERXThreadStorageCloneableThreadLocal |
Modifier and Type | Field and Description |
---|---|
static String |
KEYS_ADDED_IN_CURRENT_THREAD_KEY |
static String |
WAS_CLONED_MARKER |
Constructor and Description |
---|
ERXThreadStorage() |
Modifier and Type | Method and Description |
---|---|
static Map |
map()
Gets the storage map from the current thread.
|
static Set<String> |
problematicKeys()
Retrieve the Set of keys for which a warning is issued when the storageMap
was inherited from another Thread and the key is accessed.
|
static Set<Class<?>> |
problematicTypes()
Retrieve the Set of classes for which a warning is issued when the
storageMap was inherited from another Thread and the object retrieved
from the map is a subclass of one of the classes in the set.
|
static Object |
removeValueForKey(String key)
Removes the value in the map for a given key.
|
static void |
reset()
Removes all of the keys from the current Map.
|
static void |
setProblematicKeys(Set<String> problematicKeys)
Set the Set of keys for which a warning is issued when the storageMap
was inherited from another Thread and the key is accessed.
|
static void |
setProblematicTypes(NSSet<Class<?>> problematicTypes)
Set the Set of classes for which a warning is issued when the storageMap
was inherited from another Thread and the object retrieved from the map
is a subclass of one of the classes in the set.
|
static void |
takeValueForKey(Object object,
String key)
Sets a value for a particular key for a particular thread.
|
static Object |
valueForKey(com.webobjects.eocontrol.EOEditingContext ec,
String key)
Gets the object associated with the key in the storage
map off of the current thread in the given editing context.
|
static Object |
valueForKey(String key)
Gets the object associated with the key in the storage
map off of the current thread.
|
static Object |
valueForKeyPath(String keyPath)
Gets the object associated with the keypath in the storage
map off of the current thread.
|
static boolean |
wasInheritedFromParentThread()
Checks if the storageMap was inherited from the parent thread.
|
public static final String KEYS_ADDED_IN_CURRENT_THREAD_KEY
public static final String WAS_CLONED_MARKER
public static void takeValueForKey(Object object, String key)
object
- valuekey
- keypublic static Object removeValueForKey(String key)
key
- key to be removed from the map.public static Object valueForKeyPath(String keyPath)
keyPath
- key path to be used to retrieve value from map.public static Object valueForKey(String key)
key
- key to be used to retrieve value from map.public static Object valueForKey(com.webobjects.eocontrol.EOEditingContext ec, String key)
ec
- editing context to retrieve the value intokey
- key to be used to retrieve value from map.public static Map map()
public static void reset()
public static boolean wasInheritedFromParentThread()
public static void setProblematicTypes(NSSet<Class<?>> problematicTypes)
problematicTypes
- a set of classes to checkpublic static Set<Class<?>> problematicTypes()
public static void setProblematicKeys(Set<String> problematicKeys)
problematicKeys
- a set of keys to checkCopyright © 2002 – 2020 Project Wonder.