- /*
- * @(#)BeanContextServiceAvailableEvent.java 1.4 01/11/29
- *
- * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
- * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
- */
-
- package java.beans.beancontext;
-
- import java.beans.beancontext.BeanContextChild;
- import java.beans.beancontext.BeanContextEvent;
-
- import java.beans.beancontext.BeanContextServices;
-
- import java.util.Iterator;
-
- /**
- * <p>
- * This event type is used by the BeanContextServicesListener in order to
- * identify the service being registered.
- * </p>
- */
-
- public class BeanContextServiceAvailableEvent extends BeanContextEvent {
-
- /**
- * construct a BeanContextServiceEvent
- */
-
- public BeanContextServiceAvailableEvent(BeanContextServices bcs, Class sc) {
- super((BeanContext)bcs);
-
- serviceClass = sc;
- }
-
- /**
- * get the source as a reference of type BeanContextServices
- */
-
- public BeanContextServices getSourceAsBeanContextServices() {
- return (BeanContextServices)getBeanContext();
- }
-
- /**
- * get the service class that is the subject of this notification
- */
-
- public Class getServiceClass() { return serviceClass; }
-
- /**
- * @return the current selectors available from the service
- */
-
- public Iterator getCurrentServiceSelectors() {
- return ((BeanContextServices)getSource()).getCurrentServiceSelectors(serviceClass);
- }
-
- /*
- * fields
- */
-
- protected Class serviceClass;
- }