FileDocCategorySizeDatePackage
ExecutionContext.javaAPI DocGlassfish v2 API3604Fri May 04 22:33:14 BST 2007com.sun.enterprise

ExecutionContext

public class ExecutionContext extends Object
This class that implements ExecutionContext that gets stored in Thread Local Storage. If the current thread creates child threads, the context info that is stored in the current thread is automatically propogated to the child threads. Two class methods serve as a convinient way to set/get the Context information within the current thread. Thread Local Storage is a concept introduced in JDK1.2. So, it will not work on earlier releases of JDK.
see
java.lang.ThreadLocal
see
java.lang.InheritableThreadLocal

Fields Summary
private static InheritableThreadLocal
current
Constructors Summary
Methods Summary
public static java.util.HashtablegetContext()
This method returns the hashtable that stores the thread specific Context information.

return
The Context object stored in the current TLS. It always returns a non null value;

	 if (current.get() == null) {
	     setContext(null); // Create a new one...
	 } 
	 return (Hashtable) current.get();
    
public static voidsetContext(java.util.Hashtable ctxTable)
This method can be used to add a new hashtable for storing the Thread specific context information. This method is useful to add a deserialized Context information that arrived over the wire.

param
A hashtable that stores the current thread's context information.


                                                      
         
	if (ctxTable != null) {
	    current.set(ctxTable);
	} else {
	    current.set(new Hashtable());
	}