KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > spi > webxml > WebXmlInitialContextFactory


1 package org.enhydra.spi.webxml;
2
3 import java.util.Hashtable JavaDoc;
4 import javax.naming.Context JavaDoc;
5 import javax.naming.Name JavaDoc;
6 import javax.naming.NamingException JavaDoc;
7 import javax.naming.spi.InitialContextFactory JavaDoc;
8 import javax.naming.spi.ObjectFactory JavaDoc;
9 import org.objectweb.carol.util.configuration.TraceCarol;
10
11 /**
12  * Class <code>WebXmlInitialContextFactory</code> is the JNDI SPI Context Factory
13  * for multi Context management.
14  */

15 public class WebXmlInitialContextFactory implements ObjectFactory JavaDoc, InitialContextFactory JavaDoc {
16
17     /**
18      * Gets a new multi initial context.
19      * @param env Context environment.
20      * @return New Multi Initial Context.
21      * @exception NamingException If a naming error occures.
22      */

23     public Context JavaDoc getInitialContext(Hashtable JavaDoc env) throws NamingException JavaDoc {
24       if (TraceCarol.isDebugJndiCarol()) {
25         TraceCarol.debugJndiCarol(
26             "MultiOrbInitialContextFactory.getInitialContext(Hashtable env)");
27       }
28       return new WebXmlInitialContext(env);
29     }
30
31     /**
32      * Never used for the moment.
33      * @param ref Object.
34      * @param name Name.
35      * @param nameCtx Context.
36      * @param env Context environment.
37      * @return New Multi Initial Context.
38      * @exception NamingException If a naming error occures.
39      */

40     public Object JavaDoc getObjectInstance(Object JavaDoc ref, Name JavaDoc name, Context JavaDoc nameCtx, Hashtable JavaDoc env) throws NamingException JavaDoc {
41       if (TraceCarol.isDebugJndiCarol()) {
42         TraceCarol.debugJndiCarol("MultiOrbInitialContextFactory.getObjectInstance(Object ref, Name name, Context nameCtx, Hashtable env)");
43       }
44       // never used
45
return null;
46     }
47 }
48
Popular Tags