Richard S. Hall | 930fecc | 2005-08-16 18:33:34 +0000 | [diff] [blame] | 1 | /* |
| 2 | * $Header: /cvshome/build/org.osgi.framework/src/org/osgi/framework/ServiceListener.java,v 1.8 2005/05/13 20:32:55 hargrave Exp $ |
| 3 | * |
| 4 | * Copyright (c) OSGi Alliance (2000, 2005). All Rights Reserved. |
| 5 | * |
| 6 | * This program and the accompanying materials are made available under the |
| 7 | * terms of the Eclipse Public License v1.0 which accompanies this |
| 8 | * distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. |
| 9 | */ |
| 10 | |
| 11 | package org.osgi.framework; |
| 12 | |
| 13 | import java.util.EventListener; |
| 14 | |
| 15 | /** |
| 16 | * A <code>ServiceEvent</code> listener. |
| 17 | * |
| 18 | * <p><code>ServiceListener</code> is a listener interface that may be implemented by a bundle |
| 19 | * developer. |
| 20 | * <p>A <code>ServiceListener</code> object is registered with the Framework using the |
| 21 | * <code>BundleContext.addServiceListener</code> method. |
| 22 | * <code>ServiceListener</code> objects are called with a <code>ServiceEvent</code> object when |
| 23 | * a service is registered, modified, or is in the process of unregistering. |
| 24 | * |
| 25 | * <p><code>ServiceEvent</code> object delivery to <code>ServiceListener</code> objects is filtered by the |
| 26 | * filter specified when the listener was registered. If the Java Runtime Environment |
| 27 | * supports permissions, then additional filtering is done. |
| 28 | * <code>ServiceEvent</code> objects are only delivered to the listener if the bundle which defines |
| 29 | * the listener object's class has the appropriate <code>ServicePermission</code> to get the service |
| 30 | * using at least one of the named classes the service was registered under. |
| 31 | * |
| 32 | * <p><code>ServiceEvent</code> object delivery to <code>ServiceListener</code> objects is |
| 33 | * further filtered according to package sources as defined in |
| 34 | * {@link ServiceReference#isAssignableTo(Bundle, String)}. |
| 35 | * |
| 36 | * @version $Revision: 1.8 $ |
| 37 | * @see ServiceEvent |
| 38 | * @see ServicePermission |
| 39 | */ |
| 40 | |
| 41 | public abstract interface ServiceListener extends EventListener |
| 42 | { |
| 43 | /** |
| 44 | * Receives notification that a service has had a lifecycle change. |
| 45 | * |
| 46 | * @param event The <code>ServiceEvent</code> object. |
| 47 | */ |
| 48 | public abstract void serviceChanged(ServiceEvent event); |
| 49 | } |
| 50 | |
| 51 | |