Package org.apache.naming.java
Class javaURLContextFactory
- java.lang.Object
-
- org.apache.naming.java.javaURLContextFactory
-
- All Implemented Interfaces:
javax.naming.spi.InitialContextFactory,javax.naming.spi.ObjectFactory
public class javaURLContextFactory extends java.lang.Object implements javax.naming.spi.ObjectFactory, javax.naming.spi.InitialContextFactoryContext factory for the "java:" namespace.Important note : This factory MUST be associated with the "java" URL prefix, which can be done by either :
- Adding a java.naming.factory.url.pkgs=org.apache.naming property to the JNDI properties file
- Setting an environment variable named Context.URL_PKG_PREFIXES with its value including the org.apache.naming
package name. More detail about this can be found in the JNDI documentation :
NamingManager.getURLContext(String, java.util.Hashtable).
-
-
Field Summary
Fields Modifier and Type Field Description protected static javax.naming.ContextinitialContextInitial context.static java.lang.StringMAIN
-
Constructor Summary
Constructors Constructor Description javaURLContextFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.naming.ContextgetInitialContext(java.util.Hashtable<?,?> environment)Get a new (writable) initial context.java.lang.ObjectgetObjectInstance(java.lang.Object obj, javax.naming.Name name, javax.naming.Context nameCtx, java.util.Hashtable<?,?> environment)Create a new Context's instance.
-
-
-
Field Detail
-
MAIN
public static final java.lang.String MAIN
- See Also:
- Constant Field Values
-
initialContext
protected static volatile javax.naming.Context initialContext
Initial context.
-
-
Method Detail
-
getObjectInstance
public java.lang.Object getObjectInstance(java.lang.Object obj, javax.naming.Name name, javax.naming.Context nameCtx, java.util.Hashtable<?,?> environment) throws javax.naming.NamingExceptionCreate a new Context's instance.- Specified by:
getObjectInstancein interfacejavax.naming.spi.ObjectFactory- Parameters:
obj- unusedname- unusednameCtx- unusedenvironment- the environment used- Returns:
- a selector context if the thread or classloader are bound, and null otherwise
- Throws:
javax.naming.NamingException- not thrown by this implementationm
-
getInitialContext
public javax.naming.Context getInitialContext(java.util.Hashtable<?,?> environment) throws javax.naming.NamingExceptionGet a new (writable) initial context.- Specified by:
getInitialContextin interfacejavax.naming.spi.InitialContextFactory- Parameters:
environment- the environment used- Returns:
- a selector context if the thread or classloader are bound, and a shared writable context otherwise
- Throws:
javax.naming.NamingException- not thrown by this implementationm
-
-