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