public interface StateHelper
PlatformAdmin
provides an access point
for a state helper.
This interface is not intended to be implemented by clients.
PlatformAdmin.getStateHelper()
Modifier and Type | Field and Description |
---|---|
static int |
ACCESS_DISCOURAGED
Indicates that access is discouraged to an
ExportPackageDescription . |
static int |
ACCESS_ENCOURAGED
Indicates that access is encouraged to an
ExportPackageDescription . |
static int |
VISIBLE_INCLUDE_ALL_HOST_WIRES
An option to get all visible packages that a host bundle is currently wired to.
|
static int |
VISIBLE_INCLUDE_EE_PACKAGES
An option to include packages available from the execution environment when
getting the visible packages of a bundle.
|
Modifier and Type | Method and Description |
---|---|
int |
getAccessCode(BundleDescription bundle,
ExportPackageDescription export)
Returns the access code that the specified
BundleDescription has to the
specified ExportPackageDescription . |
BundleDescription[] |
getDependentBundles(BundleDescription[] bundles)
Returns all bundles in the state depending on the given bundles.
|
BundleDescription[] |
getPrerequisites(BundleDescription[] bundles)
Returns all the prerequisite bundles in the state for the given bundles.
|
VersionConstraint[] |
getUnsatisfiedConstraints(BundleDescription bundle)
Returns all unsatisfied constraints in the given bundle.
|
VersionConstraint[] |
getUnsatisfiedLeaves(BundleDescription[] bundles)
Returns all unsatisfied constraints in the given bundles that have no possible supplier.
|
ExportPackageDescription[] |
getVisiblePackages(BundleDescription bundle)
Returns a list of all packages that the specified bundle has access to which are
exported by other bundles.
|
ExportPackageDescription[] |
getVisiblePackages(BundleDescription bundle,
int options)
Returns a list of all packages that the specified bundle has access to which are
exported by other bundles.
|
boolean |
isResolvable(BundleSpecification specification)
Returns whether the given bundle specification constraint is resolvable.
|
boolean |
isResolvable(HostSpecification specification)
Returns whether the given host specification constraint is resolvable.
|
boolean |
isResolvable(ImportPackageSpecification specification)
Returns whether the given package specification constraint is resolvable.
|
Object[][] |
sortBundles(BundleDescription[] toSort)
Sorts the given array of resolved bundles in pre-requisite order.
|
static final int ACCESS_ENCOURAGED
ExportPackageDescription
.static final int ACCESS_DISCOURAGED
ExportPackageDescription
.static final int VISIBLE_INCLUDE_EE_PACKAGES
static final int VISIBLE_INCLUDE_ALL_HOST_WIRES
getVisiblePackages(BundleDescription, int)
,
Constant Field ValuesBundleDescription[] getDependentBundles(BundleDescription[] bundles)
bundles
- the initial set of bundlesBundleDescription[] getPrerequisites(BundleDescription[] bundles)
bundles
- the inital set of bundlesVersionConstraint[] getUnsatisfiedConstraints(BundleDescription bundle)
Note that a bundle may have no unsatisfied constraints and still not be resolved.
bundle
- the bundle to examineVersionConstraint[] getUnsatisfiedLeaves(BundleDescription[] bundles)
The returned constraints include only the unsatisfied constraints in the given state that have no possible supplier (leaf constraints). There may be additional unsatisfied constraints in the given bundles but these will have at least one possible supplier. In this case the possible supplier of the constraint is not resolved for some reason. For example, a given state only has Bundles X and Y installed and Bundles X and Y have the following constraints:
Bundle X requires Bundle Y Bundle Y requires Bundle Z
In this case Bundle Y has an unsatisfied constraint leaf on Bundle Z. This will cause Bundle X's constraint on Bundle Y to be unsatisfied as well because the bundles are involved in a dependency chain. Bundle X's constraint on Bundle Y is not considered a leaf because there is a possible supplier Y in the given state.
Note that a bundle may have no unsatisfied constraints and still not be resolved.
bundles
- the bundles to examineboolean isResolvable(ImportPackageSpecification specification)
specification
- the package specification constraint to be examinedtrue
if the constraint can be resolved,
false
otherwiseboolean isResolvable(BundleSpecification specification)
specification
- the bundle specification constraint to be examinedtrue
if the constraint can be resolved,
false
otherwiseboolean isResolvable(HostSpecification specification)
specification
- the host specification constraint to be examinedtrue
if the constraint can be resolved,
false
otherwiseObject[][] sortBundles(BundleDescription[] toSort)
Unresolved bundles are ignored.
toSort
- an array of bundles to be sortedExportPackageDescription[] getVisiblePackages(BundleDescription bundle)
Same as calling getVisiblePackages(bundle, 0)
bundle
- a bundle to get the list of packages for.ExportPackageDescription[] getVisiblePackages(BundleDescription bundle, int options)
bundle
- a bundle to get the list of packages for.options
- the options for selecting the visible packagesVISIBLE_INCLUDE_EE_PACKAGES
,
VISIBLE_INCLUDE_ALL_HOST_WIRES
int getAccessCode(BundleDescription bundle, ExportPackageDescription export)
BundleDescription
has to the
specified ExportPackageDescription
.bundle
- the bundle to find the access code forexport
- the export to find the access code forACCESS_ENCOURAGED
,
ACCESS_DISCOURAGED
Copyright © 2007–2018 The Apache Software Foundation. All rights reserved.