KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > osgi > framework > AllServiceListener


1 /*
2  * $Header: /cvshome/build/org.osgi.framework/src/org/osgi/framework/AllServiceListener.java,v 1.10 2007/02/20 00:16:30 hargrave Exp $
3  *
4  * Copyright (c) OSGi Alliance (2005, 2007). All Rights Reserved.
5  *
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
19 package org.osgi.framework;
20
21 /**
22  * A <code>ServiceEvent</code> listener that does not filter based upon
23  * package wiring. <code>AllServiceListener</code> is a listener interface
24  * that may be implemented by a bundle developer. When a
25  * <code>ServiceEvent</code> is fired, it is synchronously delivered to an
26  * <code>AllServiceListener</code>. The Framework may deliver
27  * <code>ServiceEvent</code> objects to an <code>AllServiceListener</code>
28  * out of order and may concurrently call and/or reenter an
29  * <code>AllServiceListener</code>.
30  * <p>
31  * An <code>AllServiceListener</code> object is registered with the Framework
32  * using the <code>BundleContext.addServiceListener</code> method.
33  * <code>AllServiceListener</code> objects are called with a
34  * <code>ServiceEvent</code> object when a service is registered, modified, or
35  * is in the process of unregistering.
36  *
37  * <p>
38  * <code>ServiceEvent</code> object delivery to
39  * <code>AllServiceListener</code> objects is filtered by the filter specified
40  * when the listener was registered. If the Java Runtime Environment supports
41  * permissions, then additional filtering is done. <code>ServiceEvent</code>
42  * objects are only delivered to the listener if the bundle which defines the
43  * listener object's class has the appropriate <code>ServicePermission</code>
44  * to get the service using at least one of the named classes under which the
45  * service was registered.
46  *
47  * <p>
48  * Unlike normal <code>ServiceListener</code> objects,
49  * <code>AllServiceListener</code> objects receive all
50  * <code>ServiceEvent</code> objects regardless of whether the package source
51  * of the listening bundle is equal to the package source of the bundle that
52  * registered the service. This means that the listener may not be able to cast
53  * the service object to any of its corresponding service interfaces if the
54  * service object is retrieved.
55  *
56  * @see ServiceEvent
57  * @see ServicePermission
58  * @ThreadSafe
59  * @since 1.3
60  * @version $Revision: 1.10 $
61  */

62
63 public interface AllServiceListener extends ServiceListener {
64     // This is a marker interface
65
}
66
Popular Tags