org.osgi.jmx.core
Interface PackageStateMBean


public interface PackageStateMBean

Author:
Hal Hildebrand Date: Sep 23, 2008 Time: 9:04:23 AM

This MBean represents the Package state of the framework.


Field Summary
static java.lang.String BUNDLE_IDENTIFIER
          The name of the item containing the bundle identifier in the CompositeData
static java.lang.String IMPORTING_BUNDLES
          The name of the item containing the importing bundles in the CompositeData
static java.lang.String[] PACKAGE
          The item names in the CompositeData representing the OSGi Package
static java.lang.String PACKAGE_NAME
          The name of the item containing the package name in the CompositeData
static java.lang.String PACKAGE_PENDING_REMOVAL
          The name of the item containing the pending removal status of the package in the CompositeData
static java.lang.String PACKAGE_VERSION
          The name of the item containing the package version in the CompositeData
 
Method Summary
 long getExportingBundle(java.lang.String packageName, java.lang.String version)
          Answer the identifier of the bundle exporting the package
 long[] getImportingBundles(java.lang.String packageName, java.lang.String version)
          Answer the list of identifiers of the bundles importing the package
 javax.management.openmbean.TabularData getPackages()
          Answer the package state of the system in tabular form
 boolean isRemovalPending(java.lang.String packageName, java.lang.String version)
          Answer if this package is exported by a bundle which has been updated or uninstalled
 

Field Detail

BUNDLE_IDENTIFIER

static final java.lang.String BUNDLE_IDENTIFIER
The name of the item containing the bundle identifier in the CompositeData

See Also:
Constant Field Values

IMPORTING_BUNDLES

static final java.lang.String IMPORTING_BUNDLES
The name of the item containing the importing bundles in the CompositeData

See Also:
Constant Field Values

PACKAGE_NAME

static final java.lang.String PACKAGE_NAME
The name of the item containing the package name in the CompositeData

See Also:
Constant Field Values

PACKAGE_PENDING_REMOVAL

static final java.lang.String PACKAGE_PENDING_REMOVAL
The name of the item containing the pending removal status of the package in the CompositeData

See Also:
Constant Field Values

PACKAGE_VERSION

static final java.lang.String PACKAGE_VERSION
The name of the item containing the package version in the CompositeData

See Also:
Constant Field Values

PACKAGE

static final java.lang.String[] PACKAGE
The item names in the CompositeData representing the OSGi Package

Method Detail

getExportingBundle

long getExportingBundle(java.lang.String packageName,
                        java.lang.String version)
                        throws java.io.IOException
Answer the identifier of the bundle exporting the package

Parameters:
packageName - - the package name
version - - the version of the package
Returns:
the bundle identifier or -1 if there is no bundle
Throws:
java.io.IOException - if the operation fails
java.lang.IllegalArgumentException - if the package indicated does not exist

getImportingBundles

long[] getImportingBundles(java.lang.String packageName,
                           java.lang.String version)
                           throws java.io.IOException
Answer the list of identifiers of the bundles importing the package

Parameters:
packageName - - the package name
version - - the version of the package
Returns:
the list of bundle identifiers
Throws:
java.io.IOException - if the operation fails
java.lang.IllegalArgumentException - if the package indicated does not exist

getPackages

javax.management.openmbean.TabularData getPackages()
Answer the package state of the system in tabular form

Returns:
the tabular respresentation of the package state
Throws:
java.io.IOException
See Also:
for the details of the TabularType.

Each row of the returned table represents a single package. For each package, the following row is returned

  • name - String
  • version - String
  • removal pending - boolean
  • exporting bundle - long
  • importing bundles - long[]

isRemovalPending

boolean isRemovalPending(java.lang.String packageName,
                         java.lang.String version)
                         throws java.io.IOException
Answer if this package is exported by a bundle which has been updated or uninstalled

Parameters:
packageName - - the package name
version - - the version of the package
Returns:
true if this package is being exported by a bundle that has been updated or uninstalled.
Throws:
java.io.IOException - if the operation fails
java.lang.IllegalArgumentException - if the package indicated does not exist


Copyright © 2009. All Rights Reserved.