KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > ca > commons > jndi > JndiAction


1 /*
2  * Created on Aug 9, 2004
3  *
4  * TODO To change the template for this generated file go to
5  * Window - Preferences - Java - Code Style - Code Templates
6  */

7 package com.ca.commons.jndi;
8
9 import java.security.PrivilegedAction JavaDoc;
10 import java.util.Hashtable JavaDoc;
11
12 import javax.naming.NamingException JavaDoc;
13 import javax.naming.directory.DirContext JavaDoc;
14 import javax.naming.directory.InitialDirContext JavaDoc;
15
16 /**
17  * @author vadim
18  *
19  * TODO To change the template for this generated type comment go to
20  * Window - Preferences - Java - Code Style - Code Templates
21  */

22 public class JndiAction implements PrivilegedAction JavaDoc {
23     
24     private Hashtable JavaDoc env;
25     
26     public JndiAction(Hashtable JavaDoc env){
27         this.env = env;
28     }
29
30     /* (non-Javadoc)
31      * @see java.security.PrivilegedAction#run()
32      */

33     public Object JavaDoc run() {
34         
35         DirContext JavaDoc result = null;
36         
37         try{
38             result = new InitialDirContext JavaDoc(env);
39         }catch(NamingException JavaDoc ex){
40             ex.printStackTrace();
41         }
42         
43         return result;
44     }
45
46 }
47
Popular Tags