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