The bundle wiring for a bundle is the current bundle
wiring if it is the most recent bundle wiring for the current bundle
revision. A bundle wiring is in use if it is the current
bundle wiring or if some other in use bundle wiring is dependent upon it. For
example, another bundle wiring is wired to a capability provided by the
bundle wiring. An in use bundle wiring for a non-fragment bundle has a class
loader. All bundles with non-current, in use bundle wirings are considered
removal pending. Once a bundle wiring is no longer in use, it is considered
stale and is discarded by the framework.
The current bundle wiring for a bundle can be obtained by calling
bundle.(BundleWiring.class). A bundle in the
INSTALLED or UNINSTALLED state does not have a current wiring, adapting such
a bundle returns null.
| Modifier and Type | Field and Description |
|---|---|
| public static final int | FINDENTRIES_RECURSE
The find entries operation must recurse into subdirectories. |
| public static final int | LISTRESOURCES_LOCAL
The list resource names operation must limit the result to the names of
matching resources contained in this bundle wiring's
|
| public static final int | LISTRESOURCES_RECURSE
The list resource names operation must recurse into subdirectories. |
| Modifier and Type | Method and Description |
|---|---|
| public List | Returns: An unmodifiable list of URL objects for each matching entry, or an empty list if no matching entry could be found, if this bundle wiring is for a fragment revision or if the caller does not have the appropriateAdminPermission[bundle,RESOURCE] and the
Java Runtime Environment supports permissions. The list is
ordered such that entries from the bundle
revision are returned first followed by the entries from
attached fragment revisions in attachment order. If this bundle
wiring is not in use, null must be
returned.The path name in which to look. The path is always relative
to the root of this bundle wiring and may begin with
"/". A path value of "/" indicates the root of
this bundle wiring. path, String The file name pattern for selecting entries in the
specified path. The pattern is only matched against the last
element of the entry path. If the entry is a directory then the
trailing "/" is not used for pattern matching. Substring
matching is supported, as specified in the Filter specification,
using the wildcard character ("*"). If filePattern, int null is
specified, this is equivalent to "*" and matches all
files.The options for listing resource names. See
options)FINDENTRIES_RECURSE. The method must ignore unrecognized
options.Returns entries in this bundle wiring's |
| public List | Returns: A list containing a snapshot of theBundleCapabilitys, or
an empty list if this bundle wiring provides no capabilities in
the specified namespace. If this bundle wiring is not
in use, null will be returned. For a
given namespace, the list contains the capabilities in the order
the capabilities were specified in the manifests of the
bundle revision and the attached
fragments† of this bundle wiring. There is no
ordering defined between capabilities in different namespaces.The namespace of the capabilities to return or
namespace)null to return the capabilities from all namespaces.Returns the capabilities provided by this bundle wiring. |
| public ClassLoader | Returns: The class loader for this bundle wiring. If this bundle wiring is notin use or this bundle wiring is for a
fragment revision, null will be returned.Returns the class loader for this bundle wiring. |
| public List | Returns: A list containing a snapshot of theWires for the
capabilities of this wiring, or an empty list
if this wiring has no capabilities in the specified namespace.
For a given namespace, the list contains the wires in the order
the capabilities were specified in the manifests of the
resource and the attached fragment
resources of this wiring. There is no ordering defined between
capabilities in different namespaces.The namespace of the capabilities for which to return
wires or namespace)null to return the wires for the capabilities in
all namespaces.Redeclares org. Returns the |
| public List | Returns: A list containing a snapshot of theBundleWires for the
capabilities of this bundle wiring, or
an empty list if this bundle wiring has no capabilities in the
specified namespace. If this bundle wiring is not
in use, null will be returned. For a
given namespace, the list contains the wires in the order the
capabilities were specified in the manifests of the
bundle revision and the attached fragments
of this bundle wiring. There is no ordering defined between
capabilities in different namespaces.The namespace of the capabilities for which to return
wires or namespace)null to return the wires for the capabilities in
all namespaces.Returns the |
| public List | Returns: A list containing a snapshot of theWires for the
requirements of this wiring, or an empty list
if this wiring has no requirements in the specified namespace.
For a given namespace, the list contains the wires in the order
the requirements were specified in the manifests of the
resource and the attached fragment
resources of this wiring. There is no ordering defined between
requirements in different namespaces.The namespace of the requirements for which to return
wires or namespace)null to return the wires for the requirements in
all namespaces.Redeclares org. Returns the |
| public List | Returns: A list containing a snapshot of theBundleWires for the
requirements of this bundle wiring, or
an empty list if this bundle wiring has no requirements in the
specified namespace. If this bundle wiring is not
in use, null will be returned. For a
given namespace, the list contains the wires in the order the
requirements were specified in the manifests of the
bundle revision and the attached fragments
of this bundle wiring followed by dynamically established wires,
if any, in the order they were established. There is no ordering
defined between requirements in different namespaces.The namespace of the requirements for which to return
wires or namespace)null to return the wires for the requirements in
all namespaces.Returns the |
| public List | Returns: A list containing a snapshot of theBundleRequirements,
or an empty list if this bundle wiring uses no requirements in
the specified namespace. If this bundle wiring is not
in use, null will be returned. For a
given namespace, the list contains the requirements in the order
the requirements were specified in the manifests of the
bundle revision and the attached fragments
of this bundle wiring. There is no ordering defined between
requirements in different namespaces.The namespace of the requirements to return or
namespace)null to return the requirements from all namespaces.Returns the requirements of this bundle wiring. |
| public BundleRevision | Returns: The resource associated with this wiring.Redeclares org. Returns the resource associated with this wiring. |
| public List | Returns: A list containing a snapshot of theCapabilitys, or an
empty list if this wiring provides no capabilities in the
specified namespace. For a given namespace, the list contains the
capabilities in the order the capabilities were specified in the
manifests of the resource and the attached
fragment resources† of this wiring. There is no
ordering defined between capabilities in different namespaces.The namespace of the capabilities to return or
namespace)null to return the capabilities from all namespaces.Redeclares org. Returns the capabilities provided by this wiring. |
| public List | Returns: A list containing a snapshot of theRequirements, or an
empty list if this wiring uses no requirements in the specified
namespace. For a given namespace, the list contains the
requirements in the order the requirements were specified in the
manifests of the resource and the attached
fragment resources of this wiring. There is no ordering defined
between requirements in different namespaces.The namespace of the requirements to return or
namespace)null to return the requirements from all namespaces.Redeclares org. Returns the requirements of this wiring. |
| public BundleRevision | Returns: The bundle revision for this bundle wiring.Returns the bundle revision for the bundle in this bundle wiring. |
| public boolean | Returns: true if this bundle wiring is the current bundle wiring;
false otherwise.Returns |
| public boolean | Returns: true if this bundle wiring is in use; false
otherwise.Returns |
| public Collection | Returns: An unmodifiable collection of resource names for each matching resource, or an empty collection if no matching resource could be found, if this bundle wiring is for a fragment revision or if the caller does not have the appropriateAdminPermission[bundle,RESOURCE] and the Java Runtime
Environment supports permissions. The collection is unordered and
must contain no duplicate resource names. If this bundle wiring
is not in use, null must be returned.The path name in which to look. The path is always relative
to the root of this bundle wiring's class loader and may begin
with "/". A path value of "/" indicates the
root of this bundle wiring's class loader. path, String The file name pattern for selecting resource names in
the specified path. The pattern is only matched against the last
element of the resource path. If the resource is a directory then
the trailing "/" is not used for pattern matching.
Substring matching is supported, as specified in the Filter
specification, using the wildcard character ("*"). If
filePattern, int null is specified, this is equivalent to "*" and
matches all files.The options for listing resource names. See
options)LISTRESOURCES_LOCAL and LISTRESOURCES_RECURSE.
This method must ignore unrecognized options.Returns the names of resources visible to this bundle wiring's
|
| FINDENTRIES_RECURSE | back to summary |
|---|---|
| public static final int FINDENTRIES_RECURSE The find entries operation must recurse into subdirectories.
This bit may be set when calling
| |
| LISTRESOURCES_LOCAL | back to summary |
|---|---|
| public static final int LISTRESOURCES_LOCAL The list resource names operation must limit the result to the names of
matching resources contained in this bundle wiring's
This bit may be set when calling
| |
| LISTRESOURCES_RECURSE | back to summary |
|---|---|
| public static final int LISTRESOURCES_RECURSE The list resource names operation must recurse into subdirectories.
This bit may be set when calling
| |
| findEntries | back to summary |
|---|---|
| public List Returns entries in this bundle wiring's This method takes into account that the "contents" of this bundle wiring can have attached fragments. This "bundle space" is not a namespace with unique members; the same entry name can be present multiple times. This method therefore returns a list of URL objects. These URLs can come from different JARs but have the same path name. This method can either return only entries in the specified path or recurse into subdirectories returning entries in the directory tree beginning at the specified path. URLs for directory entries must have their path end with "/". Note Jar and zip files are not required to include directory entries. URLs to directory entries will not be returned if the bundle contents do not contain directory entries.
| |
| getCapabilities | back to summary |
|---|---|
| public List Returns the capabilities provided by this bundle wiring.
Only capabilities considered by the resolver are returned. For example,
capabilities with
A capability may not be required by any bundle wiring and thus there may
be no A bundle wiring for a non-fragment revision provides a subset of the declared capabilities from the bundle revision and all attached fragment revisions†. Not all declared capabilities may be provided since some may be discarded. For example, if a package is declared to be both exported and imported, only one is selected and the other is discarded.
A bundle wiring for a fragment revision with a symbolic name must provide
exactly one
† The
| |
| getClassLoader | back to summary |
|---|---|
| public ClassLoader getClassLoader() Returns the class loader for this bundle wiring. Since a bundle refresh creates a new bundle wiring for a bundle, different bundle wirings for the same bundle will have different class loaders.
| |
| getProvidedResourceWires | back to summary |
|---|---|
| public List Redeclares org. Returns the
This method returns the same value as
| |
| getProvidedWires | back to summary |
|---|---|
| public List Returns the
| |
| getRequiredResourceWires | back to summary |
|---|---|
| public List Redeclares org. Returns the
This method returns the same value as
| |
| getRequiredWires | back to summary |
|---|---|
| public List Returns the This method may return different results if this bundle wiring establishes additional wires to more requirements. For example, dynamically importing a package will establish a new wire to the dynamically imported package.
| |
| getRequirements | back to summary |
|---|---|
| public List Returns the requirements of this bundle wiring.
Only requirements considered by the resolver are returned. For example,
requirements with A bundle wiring for a non-fragment revision has a subset of the declared requirements from the bundle revision and all attached fragment revisions. Not all declared requirements may be present since some may be discarded. For example, if a package is declared to be both exported and imported, only one is selected and the other is discarded.
| |
| getResource | back to summary |
|---|---|
| public BundleRevision getResource() Redeclares org. Returns the resource associated with this wiring.
This method returns the same value as
| |
| getResourceCapabilities | back to summary |
|---|---|
| public List Redeclares org. Returns the capabilities provided by this wiring.
Only capabilities considered by the resolver are returned. For example,
capabilities with
A capability may not be required by any wiring and thus there may be no
A wiring for a non-fragment resource provides a subset of the declared capabilities from the resource and all attached fragment resources†. Not all declared capabilities may be provided since some may be discarded. For example, if a package is declared to be both exported and imported, only one is selected and the other is discarded.
A wiring for a fragment resource with a symbolic name must provide
exactly one
† The
This method returns the same value as
| |
| getResourceRequirements | back to summary |
|---|---|
| public List Redeclares org. Returns the requirements of this wiring.
Only requirements considered by the resolver are returned. For example,
requirements with A wiring for a non-fragment resource has a subset of the declared requirements from the resource and all attached fragment resources. Not all declared requirements may be present since some may be discarded. For example, if a package is declared to be optionally imported and is not actually imported, the requirement must be discarded.
This method returns the same value as
| |
| getRevision | back to summary |
|---|---|
| public BundleRevision getRevision() Returns the bundle revision for the bundle in this bundle wiring. Since a bundle update can change the entries in a bundle, different bundle wirings for the same bundle can have different bundle revisions.
The bundle object
| |
| isCurrent | back to summary |
|---|---|
| public boolean isCurrent() Returns
| |
| isInUse | back to summary |
|---|---|
| public boolean isInUse() Returns
| |
| listResources | back to summary |
|---|---|
| public Collection Returns the names of resources visible to this bundle wiring's
| |