01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: package javax.naming.spi;
19:
20: import javax.naming.Name;
21: import javax.naming.NamingException;
22:
23: /**
24: * The <code>Resolver</code> interface describes an intermediate context which
25: * may be used in name resolution. In some context implementations, it is
26: * possible that subtypes of <code>Context</code> may not be supported; in
27: * such cases, a class implementing the <code>Resolver</code> interface
28: * becomes useful to obtain a context which is of a specified subtype of
29: * <code>Context</code>.
30: */
31: public interface Resolver {
32:
33: /**
34: * Partially resolves the name specified by name <code>n</code> stopping
35: * at the first context object which is of the <code>Context</code>
36: * subtype specified by class <code>c</code>.
37: *
38: * @param n
39: * a name
40: * @param c
41: * a context
42: * @return details of the resolved context object and the part of the name
43: * remaining to be resolved in a non-null <code>ResolveResult</code>
44: * object.
45: * @throws javax.naming.NotContextException
46: * if no context of the specified subtype is found.
47: * @throws NamingException
48: * if other naming errors occur
49: */
50: ResolveResult resolveToClass(Name n,
51: Class<? extends javax.naming.Context> c)
52: throws NamingException;
53:
54: /**
55: * Partially resolves the name specified by name <code>n</code> stopping
56: * at the first context object which is of the <code>Context</code>
57: * subtype specified by class <code>c</code>.
58: *
59: * @param n
60: * a name in string
61: * @param c
62: * a context
63: * @return details of the resolved context object and the part of the name
64: * remaining to be resolved in a non-null <code>ResolveResult</code>
65: * object.
66: * @throws javax.naming.NotContextException
67: * if no context of the specified subtype is found.
68: * @throws NamingException
69: * if other naming errors occur
70: */
71: ResolveResult resolveToClass(String n,
72: Class<? extends javax.naming.Context> c)
73: throws NamingException;
74:
75: }
|