public class ERXThreadStorage
extends java.lang.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 java.lang.String |
KEYS_ADDED_IN_CURRENT_THREAD_KEY |
static java.lang.String |
WAS_CLONED_MARKER |
| Constructor and Description |
|---|
ERXThreadStorage() |
| Modifier and Type | Method and Description |
|---|---|
static java.util.Map |
map()
Gets the storage map from the current thread.
|
static java.util.Set<java.lang.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 java.util.Set<java.lang.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 java.lang.Object |
removeValueForKey(java.lang.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(java.util.Set<java.lang.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<java.lang.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(java.lang.Object object,
java.lang.String key)
Sets a value for a particular key for a particular thread.
|
static java.lang.Object |
valueForKey(EOEditingContext ec,
java.lang.String key)
Gets the object associated with the key in the storage
map off of the current thread in the given editing context.
|
static java.lang.Object |
valueForKey(java.lang.String key)
Gets the object associated with the key in the storage
map off of the current thread.
|
static java.lang.Object |
valueForKeyPath(java.lang.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 java.lang.String KEYS_ADDED_IN_CURRENT_THREAD_KEY
public static final java.lang.String WAS_CLONED_MARKER
public static void takeValueForKey(java.lang.Object object,
java.lang.String key)
object - valuekey - keypublic static java.lang.Object removeValueForKey(java.lang.String key)
key - key to be removed from the map.public static java.lang.Object valueForKeyPath(java.lang.String keyPath)
keyPath - key path to be used to retrieve value from map.public static java.lang.Object valueForKey(java.lang.String key)
key - key to be used to retrieve value from map.public static java.lang.Object valueForKey(EOEditingContext ec, java.lang.String key)
ec - editing context to retrieve the value intokey - key to be used to retrieve value from map.public static java.util.Map map()
public static void reset()
public static boolean wasInheritedFromParentThread()
public static void setProblematicTypes(NSSet<java.lang.Class<?>> problematicTypes)
problematicTypes - a set of classes to checkpublic static java.util.Set<java.lang.Class<?>> problematicTypes()
public static void setProblematicKeys(java.util.Set<java.lang.String> problematicKeys)
problematicKeys - a set of keys to checkpublic static java.util.Set<java.lang.String> problematicKeys()
Copyright © 2002 – 2022 Project Wonder.