86
|
1 /*
|
|
2 * $Header: /cvshome/build/org.osgi.framework/src/org/osgi/framework/ServiceListener.java,v 1.15 2007/02/20 00:16:30 hargrave Exp $
|
105
|
3 *
|
86
|
4 * Copyright (c) OSGi Alliance (2000, 2007). All Rights Reserved.
|
105
|
5 *
|
86
|
6 * Licensed under the Apache License, Version 2.0 (the "License");
|
|
7 * you may not use this file except in compliance with the License.
|
|
8 * You may obtain a copy of the License at
|
|
9 *
|
|
10 * http://www.apache.org/licenses/LICENSE-2.0
|
|
11 *
|
|
12 * Unless required by applicable law or agreed to in writing, software
|
|
13 * distributed under the License is distributed on an "AS IS" BASIS,
|
|
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15 * See the License for the specific language governing permissions and
|
|
16 * limitations under the License.
|
|
17 */
|
|
18
|
105
|
19 // Port to the D programming language:
|
|
20 // Frank Benoit <benoit@tionex.de>
|
86
|
21 module org.osgi.framework.ServiceListener;
|
|
22
|
|
23 import java.lang.all;
|
105
|
24
|
|
25 import org.osgi.framework.ServiceEvent; // packageimport
|
|
26
|
86
|
27 import java.util.EventListener;
|
|
28
|
|
29 /**
|
|
30 * A <code>ServiceEvent</code> listener. <code>ServiceListener</code> is a
|
|
31 * listener interface that may be implemented by a bundle developer. When a
|
|
32 * <code>ServiceEvent</code> is fired, it is synchronously delivered to a
|
|
33 * <code>ServiceListener</code>. The Framework may deliver
|
|
34 * <code>ServiceEvent</code> objects to a <code>ServiceListener</code> out
|
|
35 * of order and may concurrently call and/or reenter a
|
|
36 * <code>ServiceListener</code>.
|
105
|
37 *
|
86
|
38 * <p>
|
|
39 * A <code>ServiceListener</code> object is registered with the Framework
|
|
40 * using the <code>BundleContext.addServiceListener</code> method.
|
|
41 * <code>ServiceListener</code> objects are called with a
|
|
42 * <code>ServiceEvent</code> object when a service is registered, modified, or
|
|
43 * is in the process of unregistering.
|
105
|
44 *
|
86
|
45 * <p>
|
|
46 * <code>ServiceEvent</code> object delivery to <code>ServiceListener</code>
|
|
47 * objects is filtered by the filter specified when the listener was registered.
|
|
48 * If the Java Runtime Environment supports permissions, then additional
|
|
49 * filtering is done. <code>ServiceEvent</code> objects are only delivered to
|
|
50 * the listener if the bundle which defines the listener object's class has the
|
|
51 * appropriate <code>ServicePermission</code> to get the service using at
|
|
52 * least one of the named classes under which the service was registered.
|
105
|
53 *
|
86
|
54 * <p>
|
|
55 * <code>ServiceEvent</code> object delivery to <code>ServiceListener</code>
|
|
56 * objects is further filtered according to package sources as defined in
|
|
57 * {@link ServiceReference#isAssignableTo(Bundle, String)}.
|
105
|
58 *
|
86
|
59 * @see ServiceEvent
|
|
60 * @see ServicePermission
|
|
61 * @ThreadSafe
|
|
62 * @version $Revision: 1.15 $
|
|
63 */
|
|
64
|
|
65 public interface ServiceListener : EventListener {
|
|
66 /**
|
|
67 * Receives notification that a service has had a lifecycle change.
|
105
|
68 *
|
86
|
69 * @param event The <code>ServiceEvent</code> object.
|
|
70 */
|
|
71 public void serviceChanged(ServiceEvent event);
|
|
72 }
|