home *** CD-ROM | disk | FTP | other *** search
/ Java 1.2 How-To / JavaHowTo.iso / 3rdParty / jbuilder / unsupported / JDK1.2beta3 / SOURCE / SRC.ZIP / java / beans / beancontext / BeanContextEvent.java < prev    next >
Encoding:
Java Source  |  1998-03-20  |  1.8 KB  |  81 lines

  1. /*
  2.  * @(#)BeanContextEvent.java    1.4 98/03/18
  3.  *
  4.  * Copyright 1997, 1998 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  *
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14.  
  15. package java.beans.beancontext;
  16.  
  17. import java.util.EventObject;
  18.  
  19. import java.beans.beancontext.BeanContext;
  20.  
  21. /**
  22.  * <p>
  23.  * BeanContextEvent is the abstract root event class for all events emitted
  24.  * from, and pertaining to the semantics of, a BeanContext.
  25.  * </p>
  26.  *
  27.  * @author    Laurence P. G. Cable
  28.  * @version    1.2
  29.  * @since    JDK1.2
  30.  * @see        java.beans.beancontext.BeanContext
  31.  */
  32.  
  33. public abstract class BeanContextEvent extends EventObject {
  34.  
  35.     /**
  36.      * Contruct a BeanContextEvent
  37.      *
  38.      * @param bc    The BeanContext source
  39.      */
  40.  
  41.     protected BeanContextEvent(BeanContext bc) {
  42.     super(bc);
  43.     }
  44.  
  45.     /**
  46.      *
  47.      */
  48.  
  49.     public BeanContext getBeanContext() { return (BeanContext)getSource(); }
  50.  
  51.     /**
  52.      * @param bc Set the BeanContext that last propagated this BeanContextEvent
  53.      */
  54.  
  55.     public synchronized void setPropagatedFrom(BeanContext bc) {
  56.     propagatedFrom = bc;
  57.     }
  58.  
  59.     /**
  60.      * @param bc The BeanContext that last propagated this BeanContextEvent
  61.      */
  62.  
  63.     public synchronized BeanContext getPropagatedFrom() {
  64.     return propagatedFrom;
  65.     }
  66.  
  67.     /**
  68.      * @return is the BeanContextEvent propagated?
  69.      */
  70.  
  71.     public synchronized boolean isPropagated() {
  72.     return propagatedFrom != null;
  73.     }
  74.  
  75.     /*
  76.      * fields
  77.      */
  78.  
  79.     protected BeanContext propagatedFrom;
  80. }
  81.