|
Project Wonder 5.0 | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecter.extensions.foundation.ERXThreadStorage
public class ERXThreadStorage
ERXThreadStorage
provides a way to store objects for
a particular thread. This can be especially handy for storing objects
like the current actor or the current form name within the scope of
a thread handling a particular request.
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 app.
Nested Class Summary | |
---|---|
protected static class |
ERXThreadStorage.ERXThreadStorageCloneableThreadLocal
|
Field Summary | |
---|---|
static java.lang.String |
KEYS_ADDED_IN_CURRENT_THREAD_KEY
|
static java.lang.String |
WAS_CLONED_MARKER
|
Constructor Summary | |
---|---|
ERXThreadStorage()
|
Method Summary | |
---|---|
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(com.webobjects.foundation.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(com.webobjects.eocontrol.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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String KEYS_ADDED_IN_CURRENT_THREAD_KEY
public static final java.lang.String WAS_CLONED_MARKER
Constructor Detail |
---|
public ERXThreadStorage()
Method Detail |
---|
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(com.webobjects.eocontrol.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(com.webobjects.foundation.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()
|
Last updated: Tue, Feb 21, 2017 05:45 PM CET | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |