1. /*
  2. * @(#)BeanContextProxy.java 1.7 00/02/02
  3. *
  4. * Copyright 1998-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 java.beans.beancontext;
  11. /**
  12. * <p>
  13. * This interface is implemented by a JavaBean that does
  14. * not directly have a BeanContext(Child) associated with
  15. * it (via implementing that interface or a subinterface thereof),
  16. * but has a public BeanContext(Child) delegated from it.
  17. * For example, a subclass of java.awt.Container may have a BeanContext
  18. * associated with it that all Component children of that Container shall
  19. * be contained within.
  20. * </p>
  21. * <p>
  22. * An Object may not implement this interface and the
  23. * BeanContextChild interface
  24. * (or any subinterfaces thereof) they are mutually exclusive.
  25. * </p>
  26. * <p>
  27. * Callers of this interface shall examine the return type in order to
  28. * obtain a particular subinterface of BeanContextChild as follows:
  29. * <code>
  30. * BeanContextChild bcc = o.getBeanContextProxy();
  31. *
  32. * if (bcc instanceof BeanContext) {
  33. * // ...
  34. * }
  35. * </code>
  36. * or
  37. * <code>
  38. * BeanContextChild bcc = o.getBeanContextProxy();
  39. * BeanContext bc = null;
  40. *
  41. * try {
  42. * bc = (BeanContext)bcc;
  43. * } catch (ClassCastException cce) {
  44. * // cast failed, bcc is not an instanceof BeanContext
  45. * }
  46. * </code>
  47. * </p>
  48. * <p>
  49. * The return value is a constant for the lifetime of the implementing
  50. * instance
  51. * </p>
  52. * @author Laurence P. G. Cable
  53. * @version 1.7, 02/02/00
  54. * @since 1.2
  55. *
  56. * @seealso java.beans.beancontext.BeanContextChild
  57. * @seealso java.beans.beancontext.BeanContextChildSupport
  58. */
  59. public interface BeanContextProxy {
  60. /**
  61. * Gets the <code>BeanContextChild</code> (or subinterface)
  62. * associated with this object.
  63. * @return the <code>BeanContextChild</code> (or subinterface)
  64. * associated with this object
  65. */
  66. BeanContextChild getBeanContextProxy();
  67. }