KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * @(#)Resolver.java 1.9 04/05/05
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8
9 package javax.naming.spi;
10
11 import javax.naming.Context JavaDoc;
12 import javax.naming.Name JavaDoc;
13 import javax.naming.NamingException JavaDoc;
14
15 /**
16   * This interface represents an "intermediate context" for name resolution.
17   *<p>
18   * The Resolver interface contains methods that are implemented by contexts
19   * that do not support subtypes of Context, but which can act as
20   * intermediate contexts for resolution purposes.
21   *<p>
22   * A <tt>Name</tt> parameter passed to any method is owned
23   * by the caller. The service provider will not modify the object
24   * or keep a reference to it.
25   * A <tt>ResolveResult</tt> object returned by any
26   * method is owned by the caller. The caller may subsequently modify it;
27   * the service provider may not.
28   *
29   * @author Rosanna Lee
30   * @author Scott Seligman
31   * @version 1.9 04/05/05
32   * @since 1.3
33   */

34
35 public interface Resolver {
36
37     /**
38      * Partially resolves a name. Stops at the first
39      * context that is an instance of a given subtype of
40      * <code>Context</code>.
41      *
42      * @param name
43      * the name to resolve
44      * @param contextType
45      * the type of object to resolve. This should
46      * be a subtype of <code>Context</code>.
47      * @return the object that was found, along with the unresolved
48      * suffix of <code>name</code>. Cannot be null.
49      *
50      * @throws javax.naming.NotContextException
51      * if no context of the appropriate type is found
52      * @throws NamingException if a naming exception was encountered
53      *
54      * @see #resolveToClass(String, Class)
55      */

56     public ResolveResult JavaDoc resolveToClass(Name JavaDoc name,
57                     Class JavaDoc<? extends Context JavaDoc> contextType)
58         throws NamingException JavaDoc;
59
60     /**
61      * Partially resolves a name.
62      * See {@link #resolveToClass(Name, Class)} for details.
63      *
64      * @param name
65      * the name to resolve
66      * @param contextType
67      * the type of object to resolve. This should
68      * be a subtype of <code>Context</code>.
69      * @return the object that was found, along with the unresolved
70      * suffix of <code>name</code>. Cannot be null.
71      *
72      * @throws javax.naming.NotContextException
73      * if no context of the appropriate type is found
74      * @throws NamingException if a naming exception was encountered
75      */

76     public ResolveResult JavaDoc resolveToClass(String JavaDoc name,
77                     Class JavaDoc<? extends Context JavaDoc> contextType)
78         throws NamingException JavaDoc;
79 };
80
Popular Tags