Class ThreadLocalStorageImpl
java.lang.Object
org.apache.fulcrum.yaafi.framework.tls.ThreadLocalStorageImpl
- All Implemented Interfaces:
ThreadLocalStorage
Implementation of
ThreadLocalStorage
.
The code was pasted from the Hivemnind container written by
Howard Lewis Ship and Harish Krishnaswamy- Author:
- Siegfried Goeschl
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clears all keys.boolean
containsKey
(String key) Checks if the thread-local object for the given key existsReturns the thread-local object for the given key, or null if no such object exists.void
Stores the value object at the given key, overwriting any prior value that may have been stored at that key.
-
Constructor Details
-
ThreadLocalStorageImpl
public ThreadLocalStorageImpl()
-
-
Method Details
-
get
Description copied from interface:ThreadLocalStorage
Returns the thread-local object for the given key, or null if no such object exists.- Specified by:
get
in interfaceThreadLocalStorage
- Parameters:
key
- the key for the lookup- Returns:
- the object
-
put
Description copied from interface:ThreadLocalStorage
Stores the value object at the given key, overwriting any prior value that may have been stored at that key. Care should be taken in selecting keys to avoid naming conflicts; in general, prefixing a key with a module id is a good idea.- Specified by:
put
in interfaceThreadLocalStorage
- Parameters:
key
- the key of the object to storevalue
- the value of the object to store
-
containsKey
Description copied from interface:ThreadLocalStorage
Checks if the thread-local object for the given key exists- Specified by:
containsKey
in interfaceThreadLocalStorage
- Parameters:
key
- the key for the lookup- Returns:
- true the object exists
-
clear
public void clear()Description copied from interface:ThreadLocalStorage
Clears all keys.- Specified by:
clear
in interfaceThreadLocalStorage
-