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