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 / BeanContextServiceRevokedEvent.java < prev    next >
Encoding:
Java Source  |  1998-03-20  |  1.8 KB  |  76 lines

  1. /*
  2.  * @(#)BeanContextServiceRevokedEvent.java    1.3 98/03/18
  3.  *
  4.  * Copyright 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.beans.beancontext.BeanContextEvent;
  18.  
  19. import java.beans.beancontext.BeanContextServices;
  20.  
  21. /**
  22.  * <p>
  23.  * This event type is used by the BeanContextServicesListener in order to
  24.  * identify the service being revoked.
  25.  * </p>
  26.  */
  27.  
  28. public class BeanContextServiceRevokedEvent extends BeanContextEvent {
  29.  
  30.     /**
  31.      * construct a BeanContextServiceEvent
  32.      */
  33.  
  34.     public BeanContextServiceRevokedEvent(BeanContextServices bcs, Class sc, boolean invalidate) {
  35.     super((BeanContext)bcs);
  36.  
  37.     serviceClass    = sc;
  38.     invalidateRefs  = invalidate;
  39.     }
  40.  
  41.     /**
  42.      * get the source as a reference of type BeanContextServices
  43.      */
  44.  
  45.     public BeanContextServices getSourceAsBeanContextServices() {
  46.     return (BeanContextServices)getBeanContext();
  47.     }
  48.  
  49.     /**
  50.      * get the service class that is the subject of this notification
  51.      */
  52.  
  53.     public Class getServiceClass() { return serviceClass; }
  54.  
  55.     /**
  56.      * test service equality
  57.      */
  58.  
  59.     public boolean isServiceClass(Class service) {
  60.     return serviceClass.equals(service);
  61.     }
  62.  
  63.     /**
  64.      * true if current service references are now invalidated and unusable.
  65.      */
  66.  
  67.     public boolean isCurrentServiceInvalidNow() { return invalidateRefs; }
  68.  
  69.     /**
  70.      * fields
  71.      */
  72.  
  73.     protected Class             serviceClass;
  74.     private   boolean             invalidateRefs;
  75. }
  76.