public final class StateHelperImpl extends Object implements StateHelper
ACCESS_DISCOURAGED, ACCESS_ENCOURAGED, VISIBLE_INCLUDE_ALL_HOST_WIRES, VISIBLE_INCLUDE_EE_PACKAGES| Constructor and Description |
|---|
StateHelperImpl() |
| 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.
|
static StateHelper |
getInstance() |
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 constraint)
Returns whether the given package specification constraint is resolvable.
|
Object[][] |
sortBundles(BundleDescription[] toSort)
Sorts the given array of resolved bundles in pre-requisite order.
|
public BundleDescription[] getDependentBundles(BundleDescription[] bundles)
StateHelpergetDependentBundles in interface StateHelperbundles - the initial set of bundlesStateHelperpublic BundleDescription[] getPrerequisites(BundleDescription[] bundles)
StateHelpergetPrerequisites in interface StateHelperbundles - the inital set of bundlespublic VersionConstraint[] getUnsatisfiedLeaves(BundleDescription[] bundles)
StateHelperThe 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.
getUnsatisfiedLeaves in interface StateHelperbundles - the bundles to examinepublic VersionConstraint[] getUnsatisfiedConstraints(BundleDescription bundle)
StateHelperNote that a bundle may have no unsatisfied constraints and still not be resolved.
getUnsatisfiedConstraints in interface StateHelperbundle - the bundle to examineStateHelperpublic boolean isResolvable(ImportPackageSpecification constraint)
StateHelperisResolvable in interface StateHelperconstraint - the package specification constraint to be examinedtrue if the constraint can be resolved,
false otherwiseStateHelperpublic boolean isResolvable(BundleSpecification specification)
StateHelperisResolvable in interface StateHelperspecification - the bundle specification constraint to be examinedtrue if the constraint can be resolved,
false otherwiseStateHelperpublic boolean isResolvable(HostSpecification specification)
StateHelperisResolvable in interface StateHelperspecification - the host specification constraint to be examinedtrue if the constraint can be resolved,
false otherwiseStateHelperpublic Object[][] sortBundles(BundleDescription[] toSort)
StateHelperUnresolved bundles are ignored.
sortBundles in interface StateHelpertoSort - an array of bundles to be sortedpublic ExportPackageDescription[] getVisiblePackages(BundleDescription bundle)
StateHelperSame as calling getVisiblePackages(bundle, 0)
getVisiblePackages in interface StateHelperbundle - a bundle to get the list of packages for.public ExportPackageDescription[] getVisiblePackages(BundleDescription bundle, int options)
StateHelpergetVisiblePackages in interface StateHelperbundle - a bundle to get the list of packages for.options - the options for selecting the visible packagesStateHelper.VISIBLE_INCLUDE_EE_PACKAGES,
StateHelper.VISIBLE_INCLUDE_ALL_HOST_WIRESpublic int getAccessCode(BundleDescription bundle, ExportPackageDescription export)
StateHelperBundleDescription has to the
specified ExportPackageDescription.getAccessCode in interface StateHelperbundle - the bundle to find the access code forexport - the export to find the access code forStateHelper.ACCESS_ENCOURAGED,
StateHelper.ACCESS_DISCOURAGEDpublic static StateHelper getInstance()
Copyright © 2007–2016 The Apache Software Foundation. All rights reserved.