All Packages Class Hierarchy This Package Previous Next Index
Class sun.server.util.ThreadLocal
java.lang.Object
|
+----sun.server.util.ThreadLocal
- public class ThreadLocal
- extends Object
A simple class that implements thread local variables.
-
ThreadLocal()
-
-
get(String)
- Get the thread local object that has been associated with the key
specified for this thread.
-
put(String, Object)
- Store a thread local object for this thread.
ThreadLocal
public ThreadLocal()
put
public static void put(String key,
Object local)
- Store a thread local object for this thread. The thread local
object is stored based on a String key for the local storage. So
a thread can have many different thread local objects associated
with different keys.
- Parameters:
- key - - an application specified string key for the object.
It is strongly advised that the key be the package name followed
by the class name followed by the application specific string. This way,
name space collisions are avoided.
- local - - a thread local object.
get
public static Object get(String key)
- Get the thread local object that has been associated with the key
specified for this thread.
- Parameters:
- key - - a string identified for the object.
- Returns:
- - the object that was stored together with this key for this thread.
All Packages Class Hierarchy This Package Previous Next Index