1. /*
  2. * @(#)InitialContextFactory.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.*;
  13. /**
  14. * This interface represents a factory that creates an initial context.
  15. *<p>
  16. * The JNDI framework allows for different initial context implementations
  17. * to be specified at runtime. The initial context is created using
  18. * an <em>initial context factory</em>.
  19. * An initial context factory must implement the InitialContextFactory
  20. * interface, which provides a method for creating instances of initial
  21. * context that implement the Context interface.
  22. * In addition, the factory class must be public and must have a public
  23. * constructor that accepts no arguments.
  24. *
  25. * @author Rosanna Lee
  26. * @author Scott Seligman
  27. * @version 1.5 00/02/02
  28. *
  29. * @see InitialContextFactoryBuilder
  30. * @see NamingManager#getInitialContext
  31. * @see javax.naming.InitialContext
  32. * @see javax.naming.directory.InitialDirContext
  33. * @since 1.3
  34. */
  35. public interface InitialContextFactory {
  36. /**
  37. * Creates an Initial Context for beginning name resolution.
  38. * Special requirements of this context are supplied
  39. * using <code>environment</code>.
  40. *<p>
  41. * The environment parameter is owned by the caller.
  42. * The implementation will not modify the object or keep a reference
  43. * to it, although it may keep a reference to a clone or copy.
  44. *
  45. * @param environment The possibly null environment
  46. * specifying information to be used in the creation
  47. * of the initial context.
  48. * @return A non-null initial context object that implements the Context
  49. * interface.
  50. * @exception NamingException If cannot create an initial context.
  51. */
  52. public Context getInitialContext(Hashtable environment)
  53. throws NamingException;
  54. }