Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/classes/java/beans/beancontext/BeanContextServiceAvailableEvent.java
38918 views
/*1* Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package java.beans.beancontext;2627import java.beans.beancontext.BeanContextChild;28import java.beans.beancontext.BeanContextEvent;2930import java.beans.beancontext.BeanContextServices;3132import java.util.Iterator;3334/**35* <p>36* This event type is used by the BeanContextServicesListener in order to37* identify the service being registered.38* </p>39*/4041public class BeanContextServiceAvailableEvent extends BeanContextEvent {42private static final long serialVersionUID = -5333985775656400778L;4344/**45* Construct a <code>BeanContextAvailableServiceEvent</code>.46* @param bcs The context in which the service has become available47* @param sc A <code>Class</code> reference to the newly available service48*/49public BeanContextServiceAvailableEvent(BeanContextServices bcs, Class sc) {50super((BeanContext)bcs);5152serviceClass = sc;53}5455/**56* Gets the source as a reference of type <code>BeanContextServices</code>.57* @return The context in which the service has become available58*/59public BeanContextServices getSourceAsBeanContextServices() {60return (BeanContextServices)getBeanContext();61}6263/**64* Gets the service class that is the subject of this notification.65* @return A <code>Class</code> reference to the newly available service66*/67public Class getServiceClass() { return serviceClass; }6869/**70* Gets the list of service dependent selectors.71* @return the current selectors available from the service72*/73public Iterator getCurrentServiceSelectors() {74return ((BeanContextServices)getSource()).getCurrentServiceSelectors(serviceClass);75}7677/*78* fields79*/8081/**82* A <code>Class</code> reference to the newly available service83*/84protected Class serviceClass;85}868788