|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface StateHelper
A helper class that provides convenience methods for manipulating
state objects. PlatformAdmin
provides an access point
for a state helper.
This interface is not intended to be implemented by clients.
PlatformAdmin.getStateHelper()
Field Summary | |
---|---|
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_EE_PACKAGES
An option to include packages available from the execution environment when getting the visible packages of a bundle. |
Method Summary | |
---|---|
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. |
java.lang.Object[][] |
sortBundles(BundleDescription[] toSort)
Sorts the given array of resolved bundles in pre-requisite order. |
Field Detail |
---|
static final int ACCESS_ENCOURAGED
ExportPackageDescription
.
static final int ACCESS_DISCOURAGED
ExportPackageDescription
.
static final int VISIBLE_INCLUDE_EE_PACKAGES
getVisiblePackages(BundleDescription, int)
,
Constant Field ValuesMethod Detail |
---|
BundleDescription[] getDependentBundles(BundleDescription[] bundles)
bundles
- the initial set of bundles
BundleDescription[] getPrerequisites(BundleDescription[] bundles)
bundles
- the inital set of bundles
VersionConstraint[] getUnsatisfiedConstraints(BundleDescription bundle)
Note that a bundle may have no unsatisfied constraints and still not be resolved.
bundle
- the bundle to examine
VersionConstraint[] 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 examine
boolean isResolvable(ImportPackageSpecification specification)
specification
- the package specification constraint to be examined
true
if the constraint can be resolved,
false
otherwiseboolean isResolvable(BundleSpecification specification)
specification
- the bundle specification constraint to be examined
true
if the constraint can be resolved,
false
otherwiseboolean isResolvable(HostSpecification specification)
specification
- the host specification constraint to be examined
true
if the constraint can be resolved,
false
otherwisejava.lang.Object[][] sortBundles(BundleDescription[] toSort)
Unresolved bundles are ignored.
toSort
- an array of bundles to be sorted
ExportPackageDescription[] getVisiblePackages(BundleDescription bundle)
The returned list will not include any packages which are exported by the system bundle on the behave of the running execution environment. For example, when running on a 1.4.2 JRE the system bundle will export the javax.xml.parsers package. These types of system packages will are not included in the returned list.
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 packages
VISIBLE_INCLUDE_EE_PACKAGES
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 for
ACCESS_ENCOURAGED
,
ACCESS_DISCOURAGED
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |