edu.mit.ai.psg.utilities
Class InitializableThreadLocal

java.lang.Object
  |
  +--java.lang.ThreadLocal
        |
        +--edu.mit.ai.psg.utilities.InitializableThreadLocal

public class InitializableThreadLocal
extends ThreadLocal

Thread local which can be initialized, e.g., by creating thread; useful when thread local value needs to inherit value from creating thread.


Constructor Summary
InitializableThreadLocal()
           
 
Method Summary
 void initialize(Thread t, Object value)
          Initialize value for thread.
protected  Object initialValue()
          gets value, removes key entry to save space, and returns value, or null if none (ThreadLocal.initialValue() returns null)
 
Methods inherited from class java.lang.ThreadLocal
get, set
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InitializableThreadLocal

public InitializableThreadLocal()
Method Detail

initialize

public void initialize(Thread t,
                       Object value)
Initialize value for thread. Typically, creating thread will call this to initialize value for newly created thread before created thread is started.

initialValue

protected Object initialValue()
gets value, removes key entry to save space, and returns value, or null if none (ThreadLocal.initialValue() returns null)
Overrides:
initialValue in class ThreadLocal

Copyright (c) 1996-1999
Massachusetts Institute of Technology

Feedback: jeva-feedback@ai.mit.edu