1. /*
  2. * @(#)BeanContextEvent.java 1.5 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.util.EventObject;
  9. import java.beans.beancontext.BeanContext;
  10. /**
  11. * <p>
  12. * BeanContextEvent is the abstract root event class for all events emitted
  13. * from, and pertaining to the semantics of, a BeanContext.
  14. * </p>
  15. *
  16. * @author Laurence P. G. Cable
  17. * @version 1.2
  18. * @since JDK1.2
  19. * @see java.beans.beancontext.BeanContext
  20. */
  21. public abstract class BeanContextEvent extends EventObject {
  22. /**
  23. * Contruct a BeanContextEvent
  24. *
  25. * @param bc The BeanContext source
  26. */
  27. protected BeanContextEvent(BeanContext bc) {
  28. super(bc);
  29. }
  30. /**
  31. *
  32. */
  33. public BeanContext getBeanContext() { return (BeanContext)getSource(); }
  34. /**
  35. * @param bc Set the BeanContext that last propagated this BeanContextEvent
  36. */
  37. public synchronized void setPropagatedFrom(BeanContext bc) {
  38. propagatedFrom = bc;
  39. }
  40. /**
  41. * @param bc The BeanContext that last propagated this BeanContextEvent
  42. */
  43. public synchronized BeanContext getPropagatedFrom() {
  44. return propagatedFrom;
  45. }
  46. /**
  47. * @return is the BeanContextEvent propagated?
  48. */
  49. public synchronized boolean isPropagated() {
  50. return propagatedFrom != null;
  51. }
  52. /*
  53. * fields
  54. */
  55. protected BeanContext propagatedFrom;
  56. }