KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > jms > serverless > jndi > GroupInitialContextFactory


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

7 package org.jboss.jms.serverless.jndi;
8
9 import org.jboss.logging.Logger;
10 import javax.naming.Context JavaDoc;
11 import java.util.Hashtable JavaDoc;
12 import javax.naming.NamingException JavaDoc;
13 import java.util.Enumeration JavaDoc;
14 import javax.naming.InitialContext JavaDoc;
15 import javax.naming.spi.InitialContextFactory JavaDoc;
16 import java.util.Iterator JavaDoc;
17 import java.net.URL JavaDoc;
18
19 /**
20  *
21  * A JNDI InitialContextFactory implementation. Produces InitalContext instances to be used to
22  * lookup JMS administered objects in a namespace associated with a JG group.
23  *
24  * @author Ovidiu Feodorov <ovidiu@jboss.org>
25  * @version $Revision: 1.1 $ $Date: 2004/04/15 22:54:21 $
26  *
27  **/

28 public class GroupInitialContextFactory implements InitialContextFactory JavaDoc {
29
30     private static final Logger log = Logger.getLogger(GroupInitialContextFactory.class);
31
32     public Context JavaDoc getInitialContext(Hashtable JavaDoc environment) throws NamingException JavaDoc {
33
34         //printEnvironment(environment);
35
return new GroupContext(environment);
36     }
37
38     static void printEnvironment(Hashtable JavaDoc env) {
39
40         if (env == null) {
41             log.info("Null environment");
42             return;
43         }
44         for(Iterator JavaDoc i = env.keySet().iterator(); i.hasNext(); ) {
45             Object JavaDoc o = i.next();
46             log.info(o+" -> "+env.get(o));
47         }
48     }
49 }
50
Popular Tags