1. /*
  2. * @(#)Resolver.java 1.7 03/01/23
  3. *
  4. * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package javax.naming.spi;
  8. import javax.naming.Name;
  9. import javax.naming.NamingException;
  10. /**
  11. * This interface represents an "intermediate context" for name resolution.
  12. *<p>
  13. * The Resolver interface contains methods that are implemented by contexts
  14. * that do not support subtypes of Context, but which can act as
  15. * intermediate contexts for resolution purposes.
  16. *<p>
  17. * A <tt>Name</tt> parameter passed to any method is owned
  18. * by the caller. The service provider will not modify the object
  19. * or keep a reference to it.
  20. * A <tt>ResolveResult</tt> object returned by any
  21. * method is owned by the caller. The caller may subsequently modify it;
  22. * the service provider may not.
  23. *
  24. * @author Rosanna Lee
  25. * @author Scott Seligman
  26. * @version 1.7 03/01/23
  27. * @since 1.3
  28. */
  29. public interface Resolver {
  30. /**
  31. * Partially resolves a name. Stops at the first
  32. * context that is an instance of a given subtype of
  33. * <code>Context</code>.
  34. *
  35. * @param name
  36. * the name to resolve
  37. * @param contextType
  38. * the type of object to resolve. This should
  39. * be a subtype of <code>Context</code>.
  40. * @return the object that was found, along with the unresolved
  41. * suffix of <code>name</code>. Cannot be null.
  42. *
  43. * @throws javax.naming.NotContextException
  44. * if no context of the appropriate type is found
  45. * @throws NamingException if a naming exception was encountered
  46. *
  47. * @see #resolveToClass(String, Class)
  48. */
  49. public ResolveResult resolveToClass(Name name, Class contextType)
  50. throws NamingException;
  51. /**
  52. * Partially resolves a name.
  53. * See {@link #resolveToClass(Name, Class)} for details.
  54. *
  55. * @param name
  56. * the name to resolve
  57. * @param contextType
  58. * the type of object to resolve. This should
  59. * be a subtype of <code>Context</code>.
  60. * @return the object that was found, along with the unresolved
  61. * suffix of <code>name</code>. Cannot be null.
  62. *
  63. * @throws javax.naming.NotContextException
  64. * if no context of the appropriate type is found
  65. * @throws NamingException if a naming exception was encountered
  66. */
  67. public ResolveResult resolveToClass(String name, Class contextType)
  68. throws NamingException;
  69. };