OSGi™ Enterprise
Release 5

org.osgi.jmx.framework
Interface BundleStateMBean


public interface BundleStateMBean

This MBean represents the Bundle state of the framework. This MBean also emits events that clients can use to get notified of the changes in the bundle state of the framework.

ThreadSafe

Field Summary
static java.lang.String ACTIVATION_POLICY_USED
          The key ACTIVATION_POLICY_USED, used in ACTIVATION_POLICY_USED_ITEM.
static Item ACTIVATION_POLICY_USED_ITEM
          The item containing the indication whether the bundle activation policy must be used in BUNDLE_TYPE.
static java.lang.String ACTIVE
          Constant ACTIVE for the STATE
static javax.management.openmbean.CompositeType BUNDLE_EVENT_TYPE
          The Composite Type that represents a bundle event.
static javax.management.openmbean.CompositeType BUNDLE_TYPE
          The Composite Type that represents a bundle.
static javax.management.openmbean.TabularType BUNDLES_TYPE
          The Tabular Type for a list of bundles.
static java.lang.String EVENT
          The key EVENT, used in EVENT_ITEM.
static Item EVENT_ITEM
          The item containing the event type.
static java.lang.String EXPORTED_PACKAGES
          The key EXPORTED_PACKAGES, used in EXPORTED_PACKAGES_ITEM.
static Item EXPORTED_PACKAGES_ITEM
          The item containing the exported package names in BUNDLE_TYPE .The key is EXPORTED_PACKAGES and the the type is JmxConstants.STRING_ARRAY_TYPE.
static java.lang.String FRAGMENT
          The key FRAGMENT, used in FRAGMENT_ITEM.
static Item FRAGMENT_ITEM
          The item containing the fragment status in BUNDLE_TYPE.
static java.lang.String FRAGMENTS
          The key FRAGMENTS, used in FRAGMENTS_ITEM.
static Item FRAGMENTS_ITEM
          The item containing the list of fragments the bundle is host to in BUNDLE_TYPE.
static javax.management.openmbean.CompositeType HEADER_TYPE
          The Composite Type describing an entry in bundle headers.
static java.lang.String HEADERS
          The key HEADERS, used in HEADERS_ITEM.
static Item HEADERS_ITEM
          The item containing the bundle headers in BUNDLE_TYPE.
static javax.management.openmbean.TabularType HEADERS_TYPE
          The Tabular Type describing the type of the Tabular Data value that is returned from getHeaders(long) method.
static java.lang.String HOSTS
          The key HOSTS, used in HOSTS_ITEM.
static Item HOSTS_ITEM
          The item containing the bundle identifiers representing the hosts in BUNDLE_TYPE.
static java.lang.String IDENTIFIER
          The key IDENTIFIER, used in IDENTIFIER_ITEM.
static Item IDENTIFIER_ITEM
          The item containing the bundle identifier in BUNDLE_TYPE.
static java.lang.String IMPORTED_PACKAGES
          The key IMPORTED_PACKAGES, used in EXPORTED_PACKAGES_ITEM.
static Item IMPORTED_PACKAGES_ITEM
          The item containing the imported package names in BUNDLE_TYPE .The key is IMPORTED_PACKAGES and the the type is JmxConstants.STRING_ARRAY_TYPE.
static java.lang.String INSTALLED
          Constant INSTALLED for the STATE
static java.lang.String KEY
          The key KEY, used in KEY_ITEM.
static Item KEY_ITEM
          The item describing the key of a bundle header entry.
static java.lang.String LAST_MODIFIED
          The key LAST_MODIFIED, used in LAST_MODIFIED_ITEM.
static Item LAST_MODIFIED_ITEM
          The item containing the last modified time in the BUNDLE_TYPE.
static java.lang.String LOCATION
          The key LOCATION, used in LOCATION_ITEM.
static Item LOCATION_ITEM
          The item containing the bundle location in BUNDLE_TYPE.
static java.lang.String OBJECTNAME
          The Object Name prefix for this mbean.
static java.lang.String PERSISTENTLY_STARTED
          The key PERSISTENTLY_STARTED, used in PERSISTENTLY_STARTED_ITEM.
static Item PERSISTENTLY_STARTED_ITEM
          The item containing the indication of persistently started in BUNDLE_TYPE.
static java.lang.String REGISTERED_SERVICES
          The key REGISTERED_SERVICES, used in REGISTERED_SERVICES_ITEM.
static Item REGISTERED_SERVICES_ITEM
          The item containing the registered services of the bundle in BUNDLE_TYPE.
static java.lang.String REMOVAL_PENDING
          The key REMOVAL_PENDING, used in REMOVAL_PENDING_ITEM.
static Item REMOVAL_PENDING_ITEM
          The item containing the indication of removal pending in BUNDLE_TYPE.
static java.lang.String REQUIRED
          The key REQUIRED, used in REQUIRED_ITEM.
static java.lang.String REQUIRED_BUNDLES
          The key REQUIRED_BUNDLES, used in REQUIRED_BUNDLES_ITEM.
static Item REQUIRED_BUNDLES_ITEM
          The item containing the required bundles in BUNDLE_TYPE.
static Item REQUIRED_ITEM
          The item containing the required status in BUNDLE_TYPE.
static java.lang.String REQUIRING_BUNDLES
          The key REQUIRING_BUNDLES, used in REQUIRING_BUNDLES_ITEM.
static Item REQUIRING_BUNDLES_ITEM
          The item containing the bundles requiring this bundle in BUNDLE_TYPE.
static java.lang.String RESOLVED
          Constant RESOLVED for the STATE
static java.lang.String SERVICES_IN_USE
          The key SERVICES_IN_USE, used in SERVICES_IN_USE_ITEM.
static Item SERVICES_IN_USE_ITEM
          The item containing the services in use by this bundle in BUNDLE_TYPE.
static java.lang.String START_LEVEL
          The key START_LEVEL, used in START_LEVEL_ITEM.
static Item START_LEVEL_ITEM
          The item containing the start level in BUNDLE_TYPE.
static java.lang.String STARTING
          Constant STARTING for the STATE
static java.lang.String STATE
          The key STATE, used in STATE_ITEM.
static Item STATE_ITEM
          The item containing the bundle state in BUNDLE_TYPE.
static java.lang.String STOPPING
          Constant STOPPING for the STATE
static java.lang.String SYMBOLIC_NAME
          The key SYMBOLIC_NAME, used in SYMBOLIC_NAME_ITEM.
static Item SYMBOLIC_NAME_ITEM
          The item containing the symbolic name in BUNDLE_TYPE.
static java.lang.String UNINSTALLED
          Constant UNINSTALLED for the STATE
static java.lang.String UNKNOWN
          Constant UNKNOWN for the STATE
static java.lang.String VALUE
          The key VALUE, used in VALUE_ITEM.
static Item VALUE_ITEM
          The item describing the value of a bundle header entry.
static java.lang.String VERSION
          The key VERSION, used in VERSION_ITEM.
static Item VERSION_ITEM
          The item containing the symbolic name in BUNDLE_TYPE.
 
Method Summary
 javax.management.openmbean.CompositeData getBundle(long bundleIdentifier)
          Obtain the information regarding a single bundle.
 long[] getBundleIds()
          List all bundle IDs in the framework.
 java.lang.String[] getExportedPackages(long bundleId)
          Answer the list of exported packages for this bundle.
 long[] getFragments(long bundleId)
          Answer the list of the bundle ids of the fragments associated with this bundle
 java.lang.String getHeader(long bundleId, java.lang.String key)
          Retrieve a single header from the bundle headers.
 java.lang.String getHeader(long bundleId, java.lang.String key, java.lang.String locale)
          Retrieve a single header from the bundle headers.
 javax.management.openmbean.TabularData getHeaders(long bundleId)
          Answer the headers for the bundle uniquely identified by the bundle id.
 javax.management.openmbean.TabularData getHeaders(long bundleId, java.lang.String locale)
          Answer the headers for the bundle uniquely identified by the bundle id.
 long[] getHosts(long fragment)
          Answer the list of bundle ids of the bundles which host a fragment
 java.lang.String[] getImportedPackages(long bundleId)
          Answer the array of the packages imported by this bundle
 long getLastModified(long bundleId)
          Answer the last modified time of a bundle
 java.lang.String getLocation(long bundleId)
          Answer the location of the bundle.
 long[] getRegisteredServices(long bundleId)
          Answer the list of service identifiers representing the services this bundle exports
 long[] getRequiredBundles(long bundleIdentifier)
          Answer an array of ids of bundles the given bundle depends on.
 long[] getRequiringBundles(long bundleIdentifier)
          Answer the list of identifiers of the bundles which require this bundle
 long[] getServicesInUse(long bundleIdentifier)
          Answer the list of service identifiers which refer to the the services this bundle is using
 int getStartLevel(long bundleId)
          Answer the start level of the bundle
 java.lang.String getState(long bundleId)
          Answer the symbolic name of the state of the bundle
 java.lang.String getSymbolicName(long bundleId)
          Answer the symbolic name of the bundle
 java.lang.String getVersion(long bundleId)
          Answer the location of the bundle.
 boolean isActivationPolicyUsed(long bundleId)
          Answer whether the specified bundle's autostart setting indicates that the activation policy declared in the bundle's manifest must be used.
 boolean isFragment(long bundleId)
          Answer whether the bundle is a fragment or not
 boolean isPersistentlyStarted(long bundleId)
          Answer if the bundle is persistently started when its start level is reached
 boolean isRemovalPending(long bundleId)
          Answer true if the bundle is pending removal
 boolean isRequired(long bundleId)
          Answer true if the bundle is required by another bundle
 javax.management.openmbean.TabularData listBundles()
          Answer the bundle state of the system in tabular form.
 javax.management.openmbean.TabularData listBundles(java.lang.String... items)
          Answer the bundle state of the system in tabular form.
 

Field Detail

OBJECTNAME

static final java.lang.String OBJECTNAME
The Object Name prefix for this mbean. The full object name also contains the framework name and uuid as properties.

See Also:
Constant Field Values

KEY

static final java.lang.String KEY
The key KEY, used in KEY_ITEM.

See Also:
Constant Field Values

KEY_ITEM

static final Item KEY_ITEM
The item describing the key of a bundle header entry. The key is KEY and the type is SimpleType.STRING.


VALUE

static final java.lang.String VALUE
The key VALUE, used in VALUE_ITEM.

See Also:
Constant Field Values

VALUE_ITEM

static final Item VALUE_ITEM
The item describing the value of a bundle header entry. The key is VALUE and the type is SimpleType.STRING.


HEADER_TYPE

static final javax.management.openmbean.CompositeType HEADER_TYPE
The Composite Type describing an entry in bundle headers. It consists of KEY_ITEM and VALUE_ITEM.


HEADERS_TYPE

static final javax.management.openmbean.TabularType HEADERS_TYPE
The Tabular Type describing the type of the Tabular Data value that is returned from getHeaders(long) method. The primary item is KEY_ITEM.


LOCATION

static final java.lang.String LOCATION
The key LOCATION, used in LOCATION_ITEM.

See Also:
Constant Field Values

LOCATION_ITEM

static final Item LOCATION_ITEM
The item containing the bundle location in BUNDLE_TYPE. The key is LOCATION and the the type is SimpleType.STRING.


IDENTIFIER

static final java.lang.String IDENTIFIER
The key IDENTIFIER, used in IDENTIFIER_ITEM.

See Also:
Constant Field Values

IDENTIFIER_ITEM

static final Item IDENTIFIER_ITEM
The item containing the bundle identifier in BUNDLE_TYPE. The key is IDENTIFIER and the the type is SimpleType.LONG.


SYMBOLIC_NAME

static final java.lang.String SYMBOLIC_NAME
The key SYMBOLIC_NAME, used in SYMBOLIC_NAME_ITEM.

See Also:
Constant Field Values

SYMBOLIC_NAME_ITEM

static final Item SYMBOLIC_NAME_ITEM
The item containing the symbolic name in BUNDLE_TYPE. The key is SYMBOLIC_NAME and the the type is SimpleType.STRING.


VERSION

static final java.lang.String VERSION
The key VERSION, used in VERSION_ITEM.

See Also:
Constant Field Values

VERSION_ITEM

static final Item VERSION_ITEM
The item containing the symbolic name in BUNDLE_TYPE. The key is SYMBOLIC_NAME and the the type is SimpleType.STRING.


START_LEVEL

static final java.lang.String START_LEVEL
The key START_LEVEL, used in START_LEVEL_ITEM.

See Also:
Constant Field Values

START_LEVEL_ITEM

static final Item START_LEVEL_ITEM
The item containing the start level in BUNDLE_TYPE. The key is START_LEVEL and the the type is SimpleType.INTEGER.


STATE

static final java.lang.String STATE
The key STATE, used in STATE_ITEM.

See Also:
Constant Field Values

INSTALLED

static final java.lang.String INSTALLED
Constant INSTALLED for the STATE

See Also:
Constant Field Values

RESOLVED

static final java.lang.String RESOLVED
Constant RESOLVED for the STATE

See Also:
Constant Field Values

STARTING

static final java.lang.String STARTING
Constant STARTING for the STATE

See Also:
Constant Field Values

ACTIVE

static final java.lang.String ACTIVE
Constant ACTIVE for the STATE

See Also:
Constant Field Values

STOPPING

static final java.lang.String STOPPING
Constant STOPPING for the STATE

See Also:
Constant Field Values

UNINSTALLED

static final java.lang.String UNINSTALLED
Constant UNINSTALLED for the STATE

See Also:
Constant Field Values

UNKNOWN

static final java.lang.String UNKNOWN
Constant UNKNOWN for the STATE

See Also:
Constant Field Values

STATE_ITEM

static final Item STATE_ITEM
The item containing the bundle state in BUNDLE_TYPE. The key is STATE and the the type is SimpleType.STRING. The returned values must be one of the following strings:


LAST_MODIFIED

static final java.lang.String LAST_MODIFIED
The key LAST_MODIFIED, used in LAST_MODIFIED_ITEM.

See Also:
Constant Field Values

LAST_MODIFIED_ITEM

static final Item LAST_MODIFIED_ITEM
The item containing the last modified time in the BUNDLE_TYPE. The key is LAST_MODIFIED and the the type is SimpleType.LONG.


ACTIVATION_POLICY_USED

static final java.lang.String ACTIVATION_POLICY_USED
The key ACTIVATION_POLICY_USED, used in ACTIVATION_POLICY_USED_ITEM.

See Also:
Constant Field Values

ACTIVATION_POLICY_USED_ITEM

static final Item ACTIVATION_POLICY_USED_ITEM
The item containing the indication whether the bundle activation policy must be used in BUNDLE_TYPE. The key is ACTIVATION_POLICY_USED and the type is SimpleType.BOOLEAN.


PERSISTENTLY_STARTED

static final java.lang.String PERSISTENTLY_STARTED
The key PERSISTENTLY_STARTED, used in PERSISTENTLY_STARTED_ITEM.

See Also:
Constant Field Values

PERSISTENTLY_STARTED_ITEM

static final Item PERSISTENTLY_STARTED_ITEM
The item containing the indication of persistently started in BUNDLE_TYPE. The key is PERSISTENTLY_STARTED and the the type is SimpleType.BOOLEAN.


REMOVAL_PENDING

static final java.lang.String REMOVAL_PENDING
The key REMOVAL_PENDING, used in REMOVAL_PENDING_ITEM.

See Also:
Constant Field Values

REMOVAL_PENDING_ITEM

static final Item REMOVAL_PENDING_ITEM
The item containing the indication of removal pending in BUNDLE_TYPE. The key is REMOVAL_PENDING and the type is SimpleType.BOOLEAN.


REQUIRED

static final java.lang.String REQUIRED
The key REQUIRED, used in REQUIRED_ITEM.

See Also:
Constant Field Values

REQUIRED_ITEM

static final Item REQUIRED_ITEM
The item containing the required status in BUNDLE_TYPE. The key is REQUIRED and the the type is SimpleType.BOOLEAN.


FRAGMENT

static final java.lang.String FRAGMENT
The key FRAGMENT, used in FRAGMENT_ITEM.

See Also:
Constant Field Values

FRAGMENT_ITEM

static final Item FRAGMENT_ITEM
The item containing the fragment status in BUNDLE_TYPE. The key is FRAGMENT and the the type is SimpleType.BOOLEAN.


REGISTERED_SERVICES

static final java.lang.String REGISTERED_SERVICES
The key REGISTERED_SERVICES, used in REGISTERED_SERVICES_ITEM.

See Also:
Constant Field Values

REGISTERED_SERVICES_ITEM

static final Item REGISTERED_SERVICES_ITEM
The item containing the registered services of the bundle in BUNDLE_TYPE. The key is REGISTERED_SERVICES and the the type is JmxConstants.LONG_ARRAY_TYPE.


SERVICES_IN_USE

static final java.lang.String SERVICES_IN_USE
The key SERVICES_IN_USE, used in SERVICES_IN_USE_ITEM.

See Also:
Constant Field Values

SERVICES_IN_USE_ITEM

static final Item SERVICES_IN_USE_ITEM
The item containing the services in use by this bundle in BUNDLE_TYPE. The key is SERVICES_IN_USE and the the type is JmxConstants.LONG_ARRAY_TYPE.


HEADERS

static final java.lang.String HEADERS
The key HEADERS, used in HEADERS_ITEM.

See Also:
Constant Field Values

HEADERS_ITEM

static final Item HEADERS_ITEM
The item containing the bundle headers in BUNDLE_TYPE. The key is HEADERS and the the type is HEADERS_TYPE.


EXPORTED_PACKAGES

static final java.lang.String EXPORTED_PACKAGES
The key EXPORTED_PACKAGES, used in EXPORTED_PACKAGES_ITEM.

See Also:
Constant Field Values

EXPORTED_PACKAGES_ITEM

static final Item EXPORTED_PACKAGES_ITEM
The item containing the exported package names in BUNDLE_TYPE .The key is EXPORTED_PACKAGES and the the type is JmxConstants.STRING_ARRAY_TYPE.


IMPORTED_PACKAGES

static final java.lang.String IMPORTED_PACKAGES
The key IMPORTED_PACKAGES, used in EXPORTED_PACKAGES_ITEM.

See Also:
Constant Field Values

IMPORTED_PACKAGES_ITEM

static final Item IMPORTED_PACKAGES_ITEM
The item containing the imported package names in BUNDLE_TYPE .The key is IMPORTED_PACKAGES and the the type is JmxConstants.STRING_ARRAY_TYPE.


FRAGMENTS

static final java.lang.String FRAGMENTS
The key FRAGMENTS, used in FRAGMENTS_ITEM.

See Also:
Constant Field Values

FRAGMENTS_ITEM

static final Item FRAGMENTS_ITEM
The item containing the list of fragments the bundle is host to in BUNDLE_TYPE. The key is FRAGMENTS and the type is JmxConstants.LONG_ARRAY_TYPE.


HOSTS

static final java.lang.String HOSTS
The key HOSTS, used in HOSTS_ITEM.

See Also:
Constant Field Values

HOSTS_ITEM

static final Item HOSTS_ITEM
The item containing the bundle identifiers representing the hosts in BUNDLE_TYPE. The key is HOSTS and the type is JmxConstants.LONG_ARRAY_TYPE


REQUIRED_BUNDLES

static final java.lang.String REQUIRED_BUNDLES
The key REQUIRED_BUNDLES, used in REQUIRED_BUNDLES_ITEM.

See Also:
Constant Field Values

REQUIRED_BUNDLES_ITEM

static final Item REQUIRED_BUNDLES_ITEM
The item containing the required bundles in BUNDLE_TYPE. The key is REQUIRED_BUNDLES and the type is JmxConstants.LONG_ARRAY_TYPE


REQUIRING_BUNDLES

static final java.lang.String REQUIRING_BUNDLES
The key REQUIRING_BUNDLES, used in REQUIRING_BUNDLES_ITEM.

See Also:
Constant Field Values

REQUIRING_BUNDLES_ITEM

static final Item REQUIRING_BUNDLES_ITEM
The item containing the bundles requiring this bundle in BUNDLE_TYPE. The key is REQUIRING_BUNDLES and the type is JmxConstants.LONG_ARRAY_TYPE


EVENT

static final java.lang.String EVENT
The key EVENT, used in EVENT_ITEM.

See Also:
Constant Field Values

EVENT_ITEM

static final Item EVENT_ITEM
The item containing the event type. The key is EVENT and the type is SimpleType.INTEGER


BUNDLE_EVENT_TYPE

static final javax.management.openmbean.CompositeType BUNDLE_EVENT_TYPE
The Composite Type that represents a bundle event. This composite consists of:


BUNDLE_TYPE

static final javax.management.openmbean.CompositeType BUNDLE_TYPE
The Composite Type that represents a bundle. This composite consist of: It is used by BUNDLES_TYPE.


BUNDLES_TYPE

static final javax.management.openmbean.TabularType BUNDLES_TYPE
The Tabular Type for a list of bundles. The row type is BUNDLE_TYPE and the index is IDENTIFIER.

Method Detail

getBundle

javax.management.openmbean.CompositeData getBundle(long bundleIdentifier)
                                                   throws java.io.IOException
Obtain the information regarding a single bundle. The result is defined by the BUNDLE_TYPE CompositeType.

Parameters:
bundleIdentifier - the bundle identifier of the requested bundle
Returns:
A CompositeData object with the bundle information
Throws:
java.io.IOException - if the operation fails
java.lang.IllegalArgumentException - if the bundle indicated does not exist

getBundleIds

long[] getBundleIds()
                    throws java.io.IOException
List all bundle IDs in the framework.

Returns:
all the bundle ids in the framework.
Throws:
java.io.IOException - if the operation fails

getRequiredBundles

long[] getRequiredBundles(long bundleIdentifier)
                          throws java.io.IOException
Answer an array of ids of bundles the given bundle depends on.

Parameters:
bundleIdentifier - the bundle identifier to find the dependencies for
Returns:
the bundle identifiers of the dependencies
Throws:
java.io.IOException - if the operation fails
java.lang.IllegalArgumentException - if the bundle indicated does not exist

listBundles

javax.management.openmbean.TabularData listBundles()
                                                   throws java.io.IOException
Answer the bundle state of the system in tabular form. Each row of the returned table represents a single bundle. The Tabular Data consists of Composite Data that is type by BUNDLES_TYPE.

Returns:
the tabular representation of the bundle state
Throws:
java.io.IOException - if the operation fails

listBundles

javax.management.openmbean.TabularData listBundles(java.lang.String... items)
                                                   throws java.io.IOException
Answer the bundle state of the system in tabular form. Each row of the returned table represents a single bundle. The Tabular Data consists of Composite Data that is type by BUNDLES_TYPE. This method supports specifying the items that are included in the result. Note that the IDENTIFIER item is always returns as this the key in the TabularData structure.

Parameters:
items - The names of the items to include in the result.
Returns:
the tabular representation of the bundle state
Throws:
java.io.IOException - if the operation fails

getExportedPackages

java.lang.String[] getExportedPackages(long bundleId)
                                       throws java.io.IOException
Answer the list of exported packages for this bundle.

Parameters:
bundleId -
Returns:
the array of package names, combined with their version in the format <packageName;version>
Throws:
java.io.IOException - if the operation fails
java.lang.IllegalArgumentException - if the bundle indicated does not exist

getFragments

long[] getFragments(long bundleId)
                    throws java.io.IOException
Answer the list of the bundle ids of the fragments associated with this bundle

Parameters:
bundleId -
Returns:
the array of bundle identifiers
Throws:
java.io.IOException - if the operation fails
java.lang.IllegalArgumentException - if the bundle indicated does not exist

getHeaders

javax.management.openmbean.TabularData getHeaders(long bundleId)
                                                  throws java.io.IOException
Answer the headers for the bundle uniquely identified by the bundle id. The Tabular Data is typed by the HEADERS_TYPE.

Parameters:
bundleId - the unique identifier of the bundle
Returns:
the table of associated header key and values
Throws:
java.io.IOException - if the operation fails
java.lang.IllegalArgumentException - if the bundle indicated does not exist

getHeaders

javax.management.openmbean.TabularData getHeaders(long bundleId,
                                                  java.lang.String locale)
                                                  throws java.io.IOException
Answer the headers for the bundle uniquely identified by the bundle id. The Tabular Data is typed by the HEADERS_TYPE.

This method performs the same function as getHeaders(long bundleId) except the manifest header values are localized to the specified locale.

Parameters:
bundleId - the unique identifier of the bundle
locale - the locale name into which the header values are to be localized. The value of this parameter follows the same rules as the locale parameter in Bundle.getHeaders(String locale)
Returns:
the table of associated header key and values
Throws:
java.io.IOException - if the operation fails
java.lang.IllegalArgumentException - if the bundle indicated does not exist

getHeader

java.lang.String getHeader(long bundleId,
                           java.lang.String key)
                           throws java.io.IOException
Retrieve a single header from the bundle headers.

Parameters:
bundleId - the unique identifier of the bundle
key - the key of the header to look up
Returns:
the value of associated header
Throws:
java.io.IOException - if the operation fails
java.lang.IllegalArgumentException - if the bundle indicated does not exist

getHeader

java.lang.String getHeader(long bundleId,
                           java.lang.String key,
                           java.lang.String locale)
                           throws java.io.IOException
Retrieve a single header from the bundle headers.

This method performs the same function as getHeaders(long bundleId) except the manifest header values are localized to the specified locale.

Parameters:
bundleId - the unique identifier of the bundle
key - the key of the header to look up
locale - the locale name into which the header value is to be localized. The value of this parameter follows the same rules as the locale parameter in Bundle.getHeaders(String locale)
Returns:
the value of associated header
Throws:
java.io.IOException - if the operation fails
java.lang.IllegalArgumentException - if the bundle indicated does not exist

getHosts

long[] getHosts(long fragment)
                throws java.io.IOException
Answer the list of bundle ids of the bundles which host a fragment

Parameters:
fragment - the bundle id of the fragment
Returns:
the array of bundle identifiers
Throws:
java.io.IOException - if the operation fails
java.lang.IllegalArgumentException - if the bundle indicated does not exist

getImportedPackages

java.lang.String[] getImportedPackages(long bundleId)
                                       throws java.io.IOException
Answer the array of the packages imported by this bundle

Parameters:
bundleId - the bundle identifier
Returns:
the array of package names, combined with their version in the format <packageName;version>
Throws:
java.io.IOException - if the operation fails
java.lang.IllegalArgumentException - if the bundle indicated does not exist

getLastModified

long getLastModified(long bundleId)
                     throws java.io.IOException
Answer the last modified time of a bundle

Parameters:
bundleId - the unique identifier of a bundle
Returns:
the last modified time
Throws:
java.io.IOException - if the operation fails
java.lang.IllegalArgumentException - if the bundle indicated does not exist

getRegisteredServices

long[] getRegisteredServices(long bundleId)
                             throws java.io.IOException
Answer the list of service identifiers representing the services this bundle exports

Parameters:
bundleId - the bundle identifier
Returns:
the list of service identifiers
Throws:
java.io.IOException - if the operation fails
java.lang.IllegalArgumentException - if the bundle indicated does not exist

getRequiringBundles

long[] getRequiringBundles(long bundleIdentifier)
                           throws java.io.IOException
Answer the list of identifiers of the bundles which require this bundle

Parameters:
bundleIdentifier - the bundle identifier
Returns:
the list of bundle identifiers
Throws:
java.io.IOException - if the operation fails
java.lang.IllegalArgumentException - if the bundle indicated does not exist

getServicesInUse

long[] getServicesInUse(long bundleIdentifier)
                        throws java.io.IOException
Answer the list of service identifiers which refer to the the services this bundle is using

Parameters:
bundleIdentifier - the bundle identifier
Returns:
the list of service identifiers
Throws:
java.io.IOException - if the operation fails
java.lang.IllegalArgumentException - if the bundle indicated does not exist

getStartLevel

int getStartLevel(long bundleId)
                  throws java.io.IOException
Answer the start level of the bundle

Parameters:
bundleId - the identifier of the bundle
Returns:
the start level
Throws:
java.io.IOException - if the operation fails
java.lang.IllegalArgumentException - if the bundle indicated does not exist

getState

java.lang.String getState(long bundleId)
                          throws java.io.IOException
Answer the symbolic name of the state of the bundle

Parameters:
bundleId - the identifier of the bundle
Returns:
the string name of the bundle state
Throws:
java.io.IOException - if the operation fails
java.lang.IllegalArgumentException - if the bundle indicated does not exist

getSymbolicName

java.lang.String getSymbolicName(long bundleId)
                                 throws java.io.IOException
Answer the symbolic name of the bundle

Parameters:
bundleId - the identifier of the bundle
Returns:
the symbolic name
Throws:
java.io.IOException - if the operation fails
java.lang.IllegalArgumentException - if the bundle indicated does not exist

isActivationPolicyUsed

boolean isActivationPolicyUsed(long bundleId)
                               throws java.io.IOException
Answer whether the specified bundle's autostart setting indicates that the activation policy declared in the bundle's manifest must be used.

Parameters:
bundleId - the identifier of the bundle
Returns:
true if the bundle's autostart setting indicates the activation policy declared in the manifest must be used. false if the bundle must be eagerly activated.
Throws:
java.io.IOException - if the operation fails
java.lang.IllegalArgumentException - if the bundle indicated does not exist

isPersistentlyStarted

boolean isPersistentlyStarted(long bundleId)
                              throws java.io.IOException
Answer if the bundle is persistently started when its start level is reached

Parameters:
bundleId - the identifier of the bundle
Returns:
true if the bundle is persistently started
Throws:
java.io.IOException - if the operation fails
java.lang.IllegalArgumentException - if the bundle indicated does not exist

isFragment

boolean isFragment(long bundleId)
                   throws java.io.IOException
Answer whether the bundle is a fragment or not

Parameters:
bundleId - the identifier of the bundle
Returns:
true if the bundle is a fragment
Throws:
java.io.IOException - if the operation fails
java.lang.IllegalArgumentException - if the bundle indicated does not exist

isRemovalPending

boolean isRemovalPending(long bundleId)
                         throws java.io.IOException
Answer true if the bundle is pending removal

Parameters:
bundleId - the identifier of the bundle
Returns:
true if the bundle is pending removal
Throws:
java.io.IOException - if the operation fails
java.lang.IllegalArgumentException - if the bundle indicated does not exist

isRequired

boolean isRequired(long bundleId)
                   throws java.io.IOException
Answer true if the bundle is required by another bundle

Parameters:
bundleId - the identifier of the bundle
Returns:
true if the bundle is required by another bundle
Throws:
java.io.IOException - if the operation fails
java.lang.IllegalArgumentException - if the bundle indicated does not exist

getLocation

java.lang.String getLocation(long bundleId)
                             throws java.io.IOException
Answer the location of the bundle.

Parameters:
bundleId - the identifier of the bundle
Returns:
The location string of this bundle
Throws:
java.io.IOException - if the operation fails
java.lang.IllegalArgumentException - if the bundle indicated does not exist

getVersion

java.lang.String getVersion(long bundleId)
                            throws java.io.IOException
Answer the location of the bundle.

Parameters:
bundleId - the identifier of the bundle
Returns:
The location string of this bundle
Throws:
java.io.IOException - if the operation fails
java.lang.IllegalArgumentException - if the bundle indicated does not exist

OSGi™ Enterprise
Release 5

Copyright © OSGi Alliance (2000, 2012). All Rights Reserved. Licensed under the OSGi Specification License, Version 2.0