org.apache.hivemind.service
Interface ThreadLocalStorage

All Known Implementing Classes:
ThreadLocalStorageImpl

public interface ThreadLocalStorage

Provides a service which can temporarily store thread-local data. This is useful in a multithreaded environment, such as a servlet or Tapestry application. ThreadLocalStorage acts like a map around thread local data.

Author:
Howard Lewis Ship

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.
 

Method Detail

get

java.lang.Object get(java.lang.String key)
Returns the thread-local object for the given key, or null if no such object exists.


put

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. Care should be taken in selecting keys to avoid naming conflicts; in general, prefixing a key with a module id is a good idea.


clear

void clear()
Clears all keys.



Copyright © 2003-2007 Apache Software Foundation. All Rights Reserved.