1. /*
  2. * @(#)BeanContext.java 1.14 01/11/29
  3. *
  4. * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package java.beans.beancontext;
  8. import java.beans.DesignMode;
  9. import java.beans.Visibility;
  10. import java.io.InputStream;
  11. import java.io.IOException;
  12. import java.net.URL;
  13. import java.util.Collection;
  14. import java.util.Locale;
  15. /**
  16. * <p>
  17. * The BeanContext acts a logical heirarchical container for JavaBeans.
  18. * </p>
  19. *
  20. * @author Laurence P. G. Cable
  21. * @version 1.9
  22. * @since JDK1.2
  23. *
  24. * @seealso java.beans.Beans
  25. * @seealso java.beans.beancontext.BeanContextChild
  26. * @seealso java.beans.beancontext.BeanContextListener
  27. * @seealso java.beans.PropertyChangeEvent
  28. * @seealso java.beans.VetoableChangeEvent
  29. * @seealso java.beans.DesignMode
  30. * @seealso java.beans.Visibility
  31. * @seealso java.util.Collection
  32. */
  33. public interface BeanContext extends BeanContextChild, Collection, DesignMode, Visibility {
  34. /**
  35. * Instantiate the javaBean named as a child of this BeanContext
  36. *
  37. * @param beanName The name of the JavaBean to instantiate as a child of this BeanContext
  38. */
  39. Object instantiateChild(String beanName) throws IOException, ClassNotFoundException;
  40. /**
  41. * @return an InputStream to the named resource for the specified child
  42. *
  43. * @throw IllegalArgumentException
  44. */
  45. InputStream getResourceAsStream(String name, BeanContextChild bcc) throws IllegalArgumentException;
  46. /**
  47. * @return a URL for the named resource for the specified child
  48. *
  49. * @throw IllegalArgumentException
  50. */
  51. URL getResource(String name, BeanContextChild bcc) throws IllegalArgumentException;
  52. /**
  53. * add a BeanContextMembershipListener
  54. */
  55. void addBeanContextMembershipListener(BeanContextMembershipListener bcml);
  56. /**
  57. * remove a BeanContextMembershipListener
  58. */
  59. void removeBeanContextMembershipListener(BeanContextMembershipListener bcml);
  60. /**
  61. * this global lock is used by both BeanContext and BeanContextServices
  62. * implementors to serialize changes in a BeanContext hierarchy and
  63. * any service requests etc.
  64. */
  65. public static final Object globalHierarchyLock = new Object();
  66. }