FileDocCategorySizeDatePackage
javaURLContextFactory.javaAPI DocGlassfish v2 API4828Fri May 04 22:33:00 BST 2007org.apache.naming.java

javaURLContextFactory

public class javaURLContextFactory extends Object implements ObjectFactory, InitialContextFactory
Context 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.catalina.util.naming property to the JNDI properties file
  • Setting an environment variable named Context.URL_PKG_PREFIXES with its value including the org.apache.catalina.util.naming package name. More detail about this can be found in the JNDI documentation : {@link javax.naming.spi.NamingManager#getURLContext(java.lang.String, java.util.Hashtable)}.
author
Remy Maucherat
version
$Revision: 1.3 $ $Date: 2007/05/05 05:33:00 $

Fields Summary
public static final String
MAIN
protected static Context
initialContext
Initial context.
Constructors Summary
Methods Summary
public javax.naming.ContextgetInitialContext(java.util.Hashtable environment)
Get a new (writable) initial context.

        if (ContextBindings.isThreadBound() || 
            (ContextBindings.isClassLoaderBound())) {
            // Redirect the request to the bound initial context
            return new SelectorContext(environment, true);
        } else {
            // If the thread is not bound, return a shared writable context
            if (initialContext == null)
                initialContext = new NamingContext(environment, MAIN);
            return initialContext;
        }
    
public java.lang.ObjectgetObjectInstance(java.lang.Object obj, javax.naming.Name name, javax.naming.Context nameCtx, java.util.Hashtable environment)
Crete a new Context's instance.



    // --------------------------------------------------------- Public Methods


    // -------------------------------------------------- ObjectFactory Methods


              
           
                                     
          
        if ((ContextBindings.isThreadBound()) || 
            (ContextBindings.isClassLoaderBound())) {
            return new SelectorContext(environment);
        } else {
            return null;
        }