Path: blob/master/src/java.naming/share/classes/javax/naming/spi/Resolver.java
41159 views
/*1* Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/242526package javax.naming.spi;2728import javax.naming.Context;29import javax.naming.Name;30import javax.naming.NamingException;3132/**33* This interface represents an "intermediate context" for name resolution.34*<p>35* The Resolver interface contains methods that are implemented by contexts36* that do not support subtypes of Context, but which can act as37* intermediate contexts for resolution purposes.38*<p>39* A {@code Name} parameter passed to any method is owned40* by the caller. The service provider will not modify the object41* or keep a reference to it.42* A {@code ResolveResult} object returned by any43* method is owned by the caller. The caller may subsequently modify it;44* the service provider may not.45*46* @author Rosanna Lee47* @author Scott Seligman48* @since 1.349*/5051public interface Resolver {5253/**54* Partially resolves a name. Stops at the first55* context that is an instance of a given subtype of56* <code>Context</code>.57*58* @param name59* the name to resolve60* @param contextType61* the type of object to resolve. This should62* be a subtype of <code>Context</code>.63* @return the object that was found, along with the unresolved64* suffix of <code>name</code>. Cannot be null.65*66* @throws javax.naming.NotContextException67* if no context of the appropriate type is found68* @throws NamingException if a naming exception was encountered69*70* @see #resolveToClass(String, Class)71*/72public ResolveResult resolveToClass(Name name,73Class<? extends Context> contextType)74throws NamingException;7576/**77* Partially resolves a name.78* See {@link #resolveToClass(Name, Class)} for details.79*80* @param name81* the name to resolve82* @param contextType83* the type of object to resolve. This should84* be a subtype of <code>Context</code>.85* @return the object that was found, along with the unresolved86* suffix of <code>name</code>. Cannot be null.87*88* @throws javax.naming.NotContextException89* if no context of the appropriate type is found90* @throws NamingException if a naming exception was encountered91*/92public ResolveResult resolveToClass(String name,93Class<? extends Context> contextType)94throws NamingException;95};969798