KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jfox > jndi > InitialContextHelper


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;
8
9 import javax.naming.Context JavaDoc;
10 import javax.naming.InitialContext JavaDoc;
11 import javax.naming.NamingException JavaDoc;
12
13 /**
14  * @author <a HREF="mailto:young_yy@hotmail.com">Young Yang</a>
15  */

16
17 public class InitialContextHelper {
18     private static volatile Context JavaDoc initCtx;
19
20     public static Context JavaDoc getInitialContext() {
21         if(initCtx == null) {
22             try {
23                 initCtx = new InitialContext JavaDoc();
24             }
25             catch(NamingException JavaDoc e) {
26                 e.printStackTrace();
27             }
28         }
29         return initCtx;
30     }
31
32     public static void main(String JavaDoc[] args) {
33
34     }
35 }
36
Popular Tags