KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * $Header: /cvshome/build/org.osgi.service.packageadmin/src/org/osgi/service/packageadmin/ExportedPackage.java,v 1.14 2006/06/16 16:31:49 hargrave Exp $
3  *
4  * Copyright (c) OSGi Alliance (2001, 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  * An exported package.
26  *
27  * Objects implementing this interface are created by the Package Admin service.
28  *
29  * <p>
30  * The term <i>exported package</i> refers to a package that has been exported
31  * from a resolved bundle. This package may or may not be currently wired to
32  * other bundles.
33  *
34  * <p>
35  * The information about an exported package provided by this object may change.
36  * An <code>ExportedPackage</code> object becomes stale if the package it
37  * references has been updated or removed as a result of calling
38  * <code>PackageAdmin.refreshPackages()</code>.
39  *
40  * If this object becomes stale, its <code>getName()</code> and
41  * <code>getVersion()</code> methods continue to return their original values,
42  * <code>isRemovalPending()</code> returns <code>true</code>, and
43  * <code>getExportingBundle()</code> and <code>getImportingBundles()</code>
44  * return <code>null</code>.
45  *
46  * @version $Revision: 1.14 $
47  */

48 public interface ExportedPackage {
49     /**
50      * Returns the name of the package associated with this exported package.
51      *
52      * @return The name of this exported package.
53      */

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

63     public Bundle getExportingBundle();
64
65     /**
66      * Returns the resolved bundles that are currently wired to this exported
67      * package.
68      *
69      * <p>
70      * Bundles which require the exporting bundle associated with this exported
71      * package are considered to be wired to this exported package are included
72      * in the returned array. See {@link RequiredBundle#getRequiringBundles()}.
73      *
74      * @return The array of resolved bundles currently wired to this exported
75      * package, or <code>null</code> if this
76      * <code>ExportedPackage</code> object has become stale.
77      */

78     public Bundle[] getImportingBundles();
79
80     /**
81      * Returns the version of this exported package.
82      *
83      * @return The version of this exported package, or <code>null</code> if
84      * no version information is available.
85      * @deprecated As of 1.2, replaced by {@link #getVersion}.
86      */

87     public String JavaDoc getSpecificationVersion();
88
89     /**
90      * Returns the version of this exported package.
91      *
92      * @return The version of this exported package, or
93      * {@link Version#emptyVersion} if no version information is
94      * available.
95      * @since 1.2
96      */

97     public Version getVersion();
98
99     /**
100      * Returns <code>true</code> if the package associated with this
101      * <code>ExportedPackage</code> object has been exported by a bundle that
102      * has been updated or uninstalled.
103      *
104      * @return <code>true</code> if the associated package is being exported
105      * by a bundle that has been updated or uninstalled, or if this
106      * <code>ExportedPackage</code> object has become stale;
107      * <code>false</code> otherwise.
108      */

109     public boolean isRemovalPending();
110 }
111
Popular Tags