KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > osgi > service > packageadmin > RequiredBundle


1 /*
2  * $Header: /cvshome/build/org.osgi.service.packageadmin/src/org/osgi/service/packageadmin/RequiredBundle.java,v 1.11 2006/06/16 16:31:49 hargrave Exp $
3  *
4  * Copyright (c) OSGi Alliance (2004, 2006). 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.service.packageadmin;
20
21 import org.osgi.framework.Bundle;
22 import org.osgi.framework.Version;
23
24 /**
25  * A required bundle.
26  *
27  * Objects implementing this interface are created by the Package Admin service.
28  *
29  * <p>
30  * The term <i>required bundle</i> refers to a resolved bundle that has a
31  * bundle symbolic name and is not a fragment. That is, a bundle that may be
32  * required by other bundles. This bundle may or may not be currently required
33  * by other bundles.
34  *
35  * <p>
36  * The information about a required bundle provided by this object may change. A
37  * <code>RequiredBundle</code> object becomes stale if an exported package of
38  * the bundle it references has been updated or removed as a result of calling
39  * <code>PackageAdmin.refreshPackages()</code>).
40  *
41  * If this object becomes stale, its <code>getSymbolicName()</code> and
42  * <code>getVersion()</code> methods continue to return their original values,
43  * <code>isRemovalPending()</code> returns true, and <code>getBundle()</code>
44  * and <code>getRequiringBundles()</code> return <code>null</code>.
45  *
46  * @since 1.2
47  * @version $Revision: 1.11 $
48  */

49 public interface RequiredBundle {
50     /**
51      * Returns the symbolic name of this required bundle.
52      *
53      * @return The symbolic name of this required bundle.
54      */

55     public String JavaDoc getSymbolicName();
56
57     /**
58      * Returns the bundle associated with this required bundle.
59      *
60      * @return The bundle, or <code>null</code> if this
61      * <code>RequiredBundle</code> object has become stale.
62      */

63     public Bundle getBundle();
64
65     /**
66      * Returns the bundles that currently require this required bundle.
67      *
68      * <p>
69      * If this required bundle is required and then re-exported by another
70      * bundle then all the requiring bundles of the re-exporting bundle are
71      * included in the returned array.
72      *
73      * @return An array of bundles currently requiring this required bundle, or
74      * <code>null</code> if this <code>RequiredBundle</code> object
75      * has become stale.
76      */

77     public Bundle[] getRequiringBundles();
78
79     /**
80      * Returns the version of this required bundle.
81      *
82      * @return The version of this required bundle, or
83      * {@link Version#emptyVersion} if no version information is
84      * available.
85      */

86     public Version getVersion();
87
88     /**
89      * Returns <code>true</code> if the bundle associated with this
90      * <code>RequiredBundle</code> object has been updated or uninstalled.
91      *
92      * @return <code>true</code> if the reqiured bundle has been updated or
93      * uninstalled, or if the <code>RequiredBundle</code> object has
94      * become stale; <code>false</code> otherwise.
95      */

96     public boolean isRemovalPending();
97 }
98
Popular Tags