KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > osgi > service > resolver > BundleDescription


1 /*******************************************************************************
2  * Copyright (c) 2003, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.osgi.service.resolver;
12
13 /**
14  * This class represents a specific version of a bundle in the system.
15  * <p>
16  * Clients may implement this interface.
17  * </p>
18  * @since 3.1
19  */

20 public interface BundleDescription extends BaseDescription {
21
22     /**
23      * Gets the Bundle-SymbolicName of this BundleDescription.
24      * Same as calling {@link BaseDescription#getName()}.
25      * @return The bundle symbolic name or null if the bundle
26      * does not have a symbolic name.
27      */

28     public String JavaDoc getSymbolicName();
29
30     /**
31      * The location string for this bundle.
32      * @return The bundle location or null if the bundle description
33      * does not have a location
34      */

35     public String JavaDoc getLocation();
36
37     /**
38      * Returns an array of bundle specifications defined by the Require-Bundle
39      * clause in this bundle.
40      *
41      * @return an array of bundle specifications
42      */

43     public BundleSpecification[] getRequiredBundles();
44
45     /**
46      * Returns an array of export package descriptions defined by the Export-Package clauses.
47      * All export package descriptions are returned even if they have not been selected by
48      * the resolver as an exporter of the package.
49      *
50      * @return an array of export package descriptions
51      */

52     public ExportPackageDescription[] getExportPackages();
53
54     /**
55      * Returns an array of import package specifications defined by the Import-Package clause.
56      * @return an array of import package specifications
57      */

58     public ImportPackageSpecification[] getImportPackages();
59
60     /**
61      * Returns an array of generic specifications constraints required by this bundle.
62      * @return an array of generic specifications
63      * @since 3.2
64      */

65     public GenericSpecification[] getGenericRequires();
66
67     /**
68      * Returns an array of generic descriptions for the capabilities of this bundle.
69      * @return an array of generic descriptions
70      * @since 3.2
71      */

72     public GenericDescription[] getGenericCapabilities();
73
74     /**
75      * Returns true if this bundle has one or more dynamically imported packages.
76      * @return true if this bundle has one or more dynamically imported packages.
77      */

78     public boolean hasDynamicImports();
79
80     /**
81      * Returns all the exported packages from this bundle that have been selected by
82      * the resolver. The returned list will include the ExportPackageDescriptions
83      * returned by {@link #getExportPackages()} that have been selected by the resolver and
84      * packages which are propagated by this bundle.
85      * @return the selected list of packages that this bundle exports. If the bundle is
86      * unresolved or has no shared packages then an empty array is returned.
87      */

88     public ExportPackageDescription[] getSelectedExports();
89
90     /**
91      * Returns all the bundle descriptions that satisfy all the require bundles for this bundle.
92      * If the bundle is not resolved or the bundle does not require any bundles then an empty array is
93      * returned.
94      * @return the bundles descriptions that satisfy all the require bundles for this bundle.
95      */

96     public BundleDescription[] getResolvedRequires();
97
98     /**
99      * Returns all the export packages that satisfy all the imported packages for this bundle.
100      * If the bundle is not resolved or the bundle does not import any packages then an empty array is
101      * returned.
102      * @return the exported packages that satisfy all the imported packages for this bundle.
103      */

104     public ExportPackageDescription[] getResolvedImports();
105
106     /**
107      * Returns true if this bundle is resolved in its host state.
108      *
109      * @return true if this bundle is resolved in its host state.
110      */

111     public boolean isResolved();
112
113     /**
114      * Returns the state object which hosts this bundle. null is returned if
115      * this bundle is not currently in a state.
116      *
117      * @return the state object which hosts this bundle.
118      */

119     public State getContainingState();
120
121     /**
122      * Returns the string representation of this bundle.
123      *
124      * @return String representation of this bundle.
125      */

126     public String JavaDoc toString();
127
128     /**
129      * Returns the host for this bundle. null is returned if this bundle is not
130      * a fragment.
131      *
132      * @return the host for this bundle.
133      */

134     public HostSpecification getHost();
135
136     /**
137      * Returns the numeric id of this bundle. Typically a bundle description
138      * will only have a numeric id if it represents a bundle that is installed in a
139      * framework as the framework assigns the ids. -1 is returned if the id is not known.
140      *
141      * @return the numeric id of this bundle description
142      */

143     public long getBundleId();
144
145     /**
146      * Returns all fragments known to this bundle (regardless resolution status).
147      *
148      * @return an array of BundleDescriptions containing all known fragments
149      */

150     public BundleDescription[] getFragments();
151
152     /**
153      * Returns whether this bundle is a singleton. Singleton bundles require
154      * that at most one single version of the bundle can be resolved at a time.
155      * <p>
156      * The existence of a single bundle marked as singleton causes all bundles
157      * with the same symbolic name to be treated as singletons as well.
158      * </p>
159      *
160      * @return <code>true</code>, if this bundle is a singleton,
161      * <code>false</code> otherwise
162      */

163     public boolean isSingleton();
164
165     /**
166      * Returns whether this bundle is pending a removal. A bundle is pending
167      * removal if it has been removed from the state but other bundles in
168      * the state currently depend on it.
169      * @return <code>true</code>, if this bundle is pending a removal,
170      * <code>false</code> otherwise
171      */

172     public boolean isRemovalPending();
173
174     /**
175      * Returns all bundles which depend on this bundle. A bundle depends on
176      * another bundle if it requires the bundle, imports a package which is
177      * exported by the bundle, is a fragment to the bundle or is the host
178      * of the bundle.
179      * @return all bundles which depend on this bundle.
180      */

181     public BundleDescription[] getDependents();
182
183     /**
184      * Returns the user object associated to this bundle description, or
185      * <code>null</code> if none exists.
186      *
187      * @return the user object associated to this bundle description,
188      * or <code>null</code>
189      */

190     public Object JavaDoc getUserObject();
191
192     /**
193      * Associates a user-provided object to this bundle description, or
194      * removes an existing association, if <code>null</code> is provided. The
195      * provided object is not interpreted in any ways by this bundle
196      * description.
197      *
198      * @param userObject an arbitrary object provided by the user, or
199      * <code>null</code>
200      */

201     public void setUserObject(Object JavaDoc userObject);
202
203     /**
204      * Returns the platform filter in the form of an LDAP filter
205      * @return the platfomr filter in the form of an LDAP filter
206      */

207     public String JavaDoc getPlatformFilter();
208
209     /**
210      * Returns true if this bundle allows fragments to attach
211      * @return true if this bundle allows fragments to attach
212      */

213     public boolean attachFragments();
214
215     /**
216      * Returns true if this bundle allows fragments to attach dynamically
217      * after it has been resolved.
218      * @return true if this bundle allows fragments to attach dynamically
219      */

220     public boolean dynamicFragments();
221
222     /**
223      * Returns the list of execution environments that are required by
224      * this bundle. Any one of the listed execution environments will
225      * allow this bundle to be resolved.
226      * @since 3.2
227      * @return the list of execution environments that are required.
228      */

229     public String JavaDoc[] getExecutionEnvironments();
230 }
231
Popular Tags