KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > naming > spi > InitialContextFactory


1 /*
2  * @(#)InitialContextFactory.java 1.10 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
8 package javax.naming.spi;
9
10 import java.util.Hashtable JavaDoc;
11 import javax.naming.*;
12
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.10 04/07/16
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
36 public interface InitialContextFactory {
37     /**
38       * Creates an Initial Context for beginning name resolution.
39       * Special requirements of this context are supplied
40       * using <code>environment</code>.
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 The possibly null environment
47           * specifying information to be used in the creation
48           * of the initial context.
49       * @return A non-null initial context object that implements the Context
50       * interface.
51           * @exception NamingException If cannot create an initial context.
52       */

53     public Context getInitialContext(Hashtable JavaDoc<?,?> environment)
54         throws NamingException;
55 }
56
Popular Tags