< prev index next >

src/java.naming/share/classes/javax/naming/spi/ObjectFactoryBuilder.java

Print this page




  23  * questions.
  24  */
  25 
  26 package javax.naming.spi;
  27 
  28 import java.util.Hashtable;
  29 import javax.naming.NamingException;
  30 
  31  /**
  32   * This interface represents a builder that creates object factories.
  33   *<p>
  34   * The JNDI framework allows for object implementations to
  35   * be loaded in dynamically via <em>object factories</em>.
  36   * For example, when looking up a printer bound in the name space,
  37   * if the print service binds printer names to References, the printer
  38   * Reference could be used to create a printer object, so that
  39   * the caller of lookup can directly operate on the printer object
  40   * after the lookup.  An ObjectFactory is responsible for creating
  41   * objects of a specific type.  JNDI uses a default policy for using
  42   * and loading object factories.  You can override this default policy
  43   * by calling <tt>NamingManager.setObjectFactoryBuilder()</tt> with an ObjectFactoryBuilder,
  44   * which contains the program-defined way of creating/loading
  45   * object factories.
  46   * Any <tt>ObjectFactoryBuilder</tt> implementation must implement this
  47   * interface that for creating object factories.
  48   *
  49   * @author Rosanna Lee
  50   * @author Scott Seligman
  51   *
  52   * @see ObjectFactory
  53   * @see NamingManager#getObjectInstance
  54   * @see NamingManager#setObjectFactoryBuilder
  55   * @since 1.3
  56   */
  57 public interface ObjectFactoryBuilder {
  58     /**
  59       * Creates a new object factory using the environment supplied.
  60       *<p>
  61       * The environment parameter is owned by the caller.
  62       * The implementation will not modify the object or keep a reference
  63       * to it, although it may keep a reference to a clone or copy.
  64       *
  65       * @param obj The possibly null object for which to create a factory.
  66       * @param environment Environment to use when creating the factory.


  23  * questions.
  24  */
  25 
  26 package javax.naming.spi;
  27 
  28 import java.util.Hashtable;
  29 import javax.naming.NamingException;
  30 
  31  /**
  32   * This interface represents a builder that creates object factories.
  33   *<p>
  34   * The JNDI framework allows for object implementations to
  35   * be loaded in dynamically via <em>object factories</em>.
  36   * For example, when looking up a printer bound in the name space,
  37   * if the print service binds printer names to References, the printer
  38   * Reference could be used to create a printer object, so that
  39   * the caller of lookup can directly operate on the printer object
  40   * after the lookup.  An ObjectFactory is responsible for creating
  41   * objects of a specific type.  JNDI uses a default policy for using
  42   * and loading object factories.  You can override this default policy
  43   * by calling {@code NamingManager.setObjectFactoryBuilder()} with an ObjectFactoryBuilder,
  44   * which contains the program-defined way of creating/loading
  45   * object factories.
  46   * Any {@code ObjectFactoryBuilder} implementation must implement this
  47   * interface that for creating object factories.
  48   *
  49   * @author Rosanna Lee
  50   * @author Scott Seligman
  51   *
  52   * @see ObjectFactory
  53   * @see NamingManager#getObjectInstance
  54   * @see NamingManager#setObjectFactoryBuilder
  55   * @since 1.3
  56   */
  57 public interface ObjectFactoryBuilder {
  58     /**
  59       * Creates a new object factory using the environment supplied.
  60       *<p>
  61       * The environment parameter is owned by the caller.
  62       * The implementation will not modify the object or keep a reference
  63       * to it, although it may keep a reference to a clone or copy.
  64       *
  65       * @param obj The possibly null object for which to create a factory.
  66       * @param environment Environment to use when creating the factory.
< prev index next >