org.apache.fulcrum.yaafi.framework.tls
Class ThreadLocalStorageImpl

java.lang.Object
  extended by org.apache.fulcrum.yaafi.framework.tls.ThreadLocalStorageImpl
All Implemented Interfaces:
ThreadLocalStorage

public class ThreadLocalStorageImpl
extends java.lang.Object
implements 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
ThreadLocalStorageImpl()
           
 
Method Summary
 void clear()
          Clears all keys.
 boolean containsKey(java.lang.String key)
          Checks if the thread-local object for the given key exists
 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
Parameters:
key - the key for the lookup
Returns:
the object

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
Parameters:
key - the key of the object to store
value - the value of the object to store

containsKey

public boolean containsKey(java.lang.String key)
Description copied from interface: ThreadLocalStorage
Checks if the thread-local object for the given key exists

Specified by:
containsKey in interface ThreadLocalStorage
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 interface ThreadLocalStorage


Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.