1. /*
  2. * @(#)InitialContextFactoryBuilder.java 1.5 00/02/02
  3. *
  4. * Copyright 1999, 2000 Sun Microsystems, Inc. All Rights Reserved.
  5. *
  6. * This software is the proprietary information of Sun Microsystems, Inc.
  7. * Use is subject to license terms.
  8. *
  9. */
  10. package javax.naming.spi;
  11. import java.util.Hashtable;
  12. import javax.naming.NamingException;
  13. /**
  14. * This interface represents a builder that creates initial context factories.
  15. *<p>
  16. * The JNDI framework allows for different initial context implementations
  17. * to be specified at runtime. An initial context is created using
  18. * an initial context factory. A program can install its own builder
  19. * that creates initial context factories, thereby overriding the
  20. * default policies used by the framework, by calling
  21. * NamingManager.setInitialContextFactoryBuilder().
  22. * The InitialContextFactoryBuilder interface must be implemented by
  23. * such a builder.
  24. *
  25. * @author Rosanna Lee
  26. * @author Scott Seligman
  27. * @version 1.5 00/02/02
  28. *
  29. * @see InitialContextFactory
  30. * @see NamingManager#getInitialContext
  31. * @see NamingManager#setInitialContextFactoryBuilder
  32. * @see NamingManager#hasInitialContextFactoryBuilder
  33. * @see javax.naming.InitialContext
  34. * @see javax.naming.directory.InitialDirContext
  35. * @since 1.3
  36. */
  37. public interface InitialContextFactoryBuilder {
  38. /**
  39. * Creates an initial context factory using the specified
  40. * environment.
  41. *<p>
  42. * The environment parameter is owned by the caller.
  43. * The implementation will not modify the object or keep a reference
  44. * to it, although it may keep a reference to a clone or copy.
  45. *
  46. * @param environment Environment used in creating an intial
  47. * context implementation. Can be null.
  48. * @return A non-null initial context factory.
  49. * @exception NamingException If an initial context factory could not be created.
  50. */
  51. public InitialContextFactory createInitialContextFactory(
  52. Hashtable environment) throws NamingException;
  53. }