KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jfox > jndi > enc > AbstractEnterpriseContextContainer


1 /* JFox, the OpenSource J2EE Application Server
2  *
3  * Distributable under GNU LGPL license by gun.org
4  * more details please visit http://www.huihoo.org/jfox
5  */

6
7 package org.jfox.jndi.enc;
8
9 import javax.naming.Context JavaDoc;
10
11 /**
12  * @author <a HREF="mailto:young_yy@hotmail.com">Young Yang</a>
13  */

14
15 public abstract class AbstractEnterpriseContextContainer {
16
17     /**
18      * the thread local variable store current thread enc name
19      */

20     protected ThreadLocal JavaDoc currName = new ThreadLocal JavaDoc();
21
22     /**
23      * set the current enc name to a ThreadLocal variable, then can get the enc by the enc name
24      *
25      * @param encName
26      * @return origin ejb name, maybe null;
27      */

28     public String JavaDoc setCurrentEnterpriseContextName(String JavaDoc encName) {
29         String JavaDoc origin = (String JavaDoc) currName.get();
30         currName.set(encName);
31         return origin;
32     }
33
34     public abstract Context JavaDoc getCurrentEnterpriseContext();
35
36     public abstract EnterpriseContextInvocationHandler getEnterpriseContextInvocationHandler();
37
38
39     public static void main(String JavaDoc[] args) {
40
41     }
42 }
43
44
Popular Tags