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 / BeanContextServiceAvailableEvent.java < prev    next >
Encoding:
Java Source  |  1998-03-20  |  1.7 KB  |  71 lines

  1. /*
  2.  * @(#)BeanContextServiceAvailableEvent.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.BeanContextChild;
  18. import java.beans.beancontext.BeanContextEvent;
  19.  
  20. import java.beans.beancontext.BeanContextServices;
  21.  
  22. import java.util.Iterator;
  23.  
  24. /**
  25.  * <p>
  26.  * This event type is used by the BeanContextServicesListener in order to
  27.  * identify the service being registered.
  28.  * </p>
  29.  */
  30.  
  31. public class BeanContextServiceAvailableEvent extends BeanContextEvent {
  32.  
  33.     /**
  34.      * construct a BeanContextServiceEvent
  35.      */
  36.  
  37.     public BeanContextServiceAvailableEvent(BeanContextServices bcs, Class sc) {
  38.     super((BeanContext)bcs);
  39.  
  40.     serviceClass = sc;
  41.     }
  42.  
  43.     /**
  44.      * get the source as a reference of type BeanContextServices
  45.      */
  46.  
  47.     public BeanContextServices getSourceAsBeanContextServices() {
  48.     return (BeanContextServices)getBeanContext();
  49.     }
  50.  
  51.     /**
  52.      * get the service class that is the subject of this notification
  53.      */
  54.  
  55.     public Class getServiceClass() { return serviceClass; }
  56.  
  57.     /**
  58.      * @return the current selectors available from the service
  59.      */
  60.  
  61.     public Iterator getCurrentServiceSelectors() {
  62.         return ((BeanContextServices)getSource()).getCurrentServiceSelectors(serviceClass);
  63.     }
  64.  
  65.     /*
  66.      * fields
  67.      */
  68.  
  69.     protected Class             serviceClass;
  70. }
  71.