ice.util.alg
Class ThreadVar

java.lang.Object
  extended byice.util.alg.ThreadVar

public class ThreadVar
extends Object

Access to java.lang.ThreadLocal and its get/set methods from jdk 1.2 or its emulation under jdk 1.1 You always use push/restore methods like that:

        private static final ThreadVar MY_KEY = ThreadVar.create();
        ...
        Object saved = MY_KEY.push(new_value);
        try {
                ...
        } finally {
                MY_KEY.restore(saved);
        }
Violation of this strict rule will lead to memory leaks under JDK 1.1. The usage of the get method is unrestricted.


Constructor Summary
protected ThreadVar()
           
 
Method Summary
static ThreadVar create()
           
 Object get()
           
protected  ThreadVar newInstance()
           
 Object push(Object new_value)
           
 void restore(Object old_value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThreadVar

protected ThreadVar()
Method Detail

create

public static ThreadVar create()

get

public Object get()

push

public Object push(Object new_value)

restore

public void restore(Object old_value)

newInstance

protected ThreadVar newInstance()