Class genericURLContextFactory

  • java.lang.Object
  • All Implemented Interfaces:

    public class genericURLContextFactory
    extends java.lang.Object
    implements javax.naming.spi.ObjectFactory
    This class is part of a framework that enables applications to easily create a local name space associated with a given URL scheme. A local name space created with this framework is shared across a process. That is, all threads running in a JVM instance will use the same name space instance.

    This class serves as the base class for a local name space's object factory. When a JNDI Context method is invoked with a name URL having a local name space's URL scheme, the getObjectInstance method implemented by this class is invoked by the JNDI Naming Manager as a JNDI SPI. The method creates and returns an instance for the root context of the name space.

    The name space's object factory should subclass this class and should have the name some.package.scheme.schemeURLContextFactory, where scheme is the URL scheme. The package name for the class is arbitrary, but the last component of the package name must be scheme.

    For example, a local name space for the URL scheme, myscheme, should have an object factory with the class name, some.package.myscheme.myschemeURLContextFactory. The object factory implementation for URL scheme myscheme is shown below.

     package com.mycompany.myscheme;
     public class myschemeURLContextFactory
                     extends {
        public myschemeURLContextFactory() {

    Before an object factory can be used, the local name space for that URL scheme must be set up. To set up a local name space, you must obtain an initial context using the initial context factory, genericURLInitialContextFactory. Refer to the documententation for that class for usage details.

    See Also:
    • Constructor Summary

      Constructor and Description
      genericURLContextFactory(java.lang.String schemeId)
      This constructor is invoked by the subclass's empty constructor.
    • Method Summary

      Modifier and Type Method and Description
      java.lang.Object getObjectInstance(java.lang.Object obj, javax.naming.Name name, javax.naming.Context nameCtx, java.util.Hashtable env)
      This method is invoked as a JNDI SPI by the JNDI Naming Manager.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • genericURLContextFactory

        public genericURLContextFactory(java.lang.String schemeId)
        This constructor is invoked by the subclass's empty constructor. The subclass's empty constructor is invoked as a JNDI SPI by the JNDI Naming Manager. The subclass should not be instantiated directly by users.
        schemeID - The URL scheme associated with this name space. The subclass name must be some.package.schemeID.schemeIDURLContextFactory.
    • Method Detail

      • getObjectInstance

        public java.lang.Object getObjectInstance(java.lang.Object obj,
                                         javax.naming.Name name,
                                         javax.naming.Context nameCtx,
                                         java.util.Hashtable env)
                                           throws javax.naming.NamingException
        This method is invoked as a JNDI SPI by the JNDI Naming Manager. Neither JNDI users nor creators of local name spaces should invoke this method directly. For details on the interface of this method, refer to the documentation on the class javax.naming.spi.ObjectFactory.
        Specified by:
        getObjectInstance in interface javax.naming.spi.ObjectFactory
IBM WebSphere Application ServerTM
Release 9.0