org.apache.hivemind.service.impl
Class ThreadLocalStorageImpl

java.lang.Object
  extended by org.apache.hivemind.service.impl.ThreadLocalStorageImpl
All Implemented Interfaces:
ThreadLocalStorage

public class ThreadLocalStorageImpl
extends java.lang.Object
implements ThreadLocalStorage

Implementation of ThreadLocalStorage.

Starting with release 1.2, this implementation was simplified, and its service model changed to threaded.

Author:
Howard Lewis Ship, Harish Krishnaswamy

Constructor Summary
ThreadLocalStorageImpl()
           
 
Method Summary
 void clear()
          Clears all keys.
 java.lang.Object get(java.lang.String key)
          Returns the thread-local object for the given key, or null if no such object exists.
 void put(java.lang.String key, java.lang.Object value)
          Stores the value object at the given key, overwriting any prior value that may have been stored at that key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThreadLocalStorageImpl

public ThreadLocalStorageImpl()
Method Detail

get

public java.lang.Object get(java.lang.String key)
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 interface ThreadLocalStorage

put

public void put(java.lang.String key,
                java.lang.Object value)
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 interface ThreadLocalStorage

clear

public void clear()
Description copied from interface: ThreadLocalStorage
Clears all keys.

Specified by:
clear in interface ThreadLocalStorage