The Java Management Extensions (JMX) is the standard API specification for providing a management interface to Java SE and Java EE applications. The JMX specification defines the design patterns, APIs, services and architecture for application management, network management and monitoring in the Java programming language. The need to administer, monitor and manage a container is today recognized as a prerequisite in the enterprise software domain.
While OSGi defines a rich API for controlling all aspects of the framework, this API is not suitable for direct usage in the JMX framework because it was not designed to be remoted. This specification provides an interface adaptation of the existing OSGi framework, which can be used to expose an OSGi Framework manipulation API to any JMX compliant implementation. Interfaces and system semantics for a monitoring system are specified for exposing the underlying artifacts of the OSGi framework such as services and bundles. Additionally, the management of a number of core and compendium services have been standardized in this document.
Finally, a standardized JMX object naming standard is proposed so that management objects are uniformly named across implementations such that any JMX compliant system can find, manipulate and interact with the framework and artifacts that it manages.
This specification requires version 1.2 or later of JMX, which implies the use of Java 5.
-
Life Cycle - Must allow support of full life cycle management of bundles.
-
Batch - Support batch oriented operations to minimize the influence of network capacity and latency.
-
Compatible - This specification must work naturally with JMX.
-
Efficient - Minimize the number of registered objects to not overload the MBean Server and communication channels.
-
Open MBean - Support the Open MBean layer of JMX instead of using domain specific objects.
-
Core - Supports all the Framework's operations.
-
Core Services - Support the framework services if registered, except for Conditional Permission Admin.
-
MBean - A Managed Bean. The core concept of JMX to manage an entity.
-
MBean Server - The MBean Server is the access point for registering MBeans.
-
Manager - The entity that implements the MBeans and registers them with the registered MBean servers.
-
Object Name - A name for an MBean registered with an MBean Server.
-
Bundle State MBean - Provides central access to the state of a bundle in a framework.
-
Framework MBean - Represents the general framework's state and can be used to manage the life cycle of bundles.
-
Bundle Wiring State MBean - Provides access to the wiring state of the framework.
-
Service State MBean - Provides access to the service information in the service registry. It provides both a general MBean interface as well as an Open Type description.
-
Configuration Admin MBean - Can be used to manipulate a Configuration Admin service.
-
Permission Admin MBean - Provides access to the Permission Admin service.
-
Provisioning Service MBean - Provides access to the Provisioning Service.
-
User Admin MBean - Provides access to the User Admin service.
-
Item - A helper class to create Open Types. This class is intended to make the Javadoc easier to navigate and keep definitions close together. This is otherwise hard to do with Open Type. This class has no utility for management applications.
-
Open Type - A JMX metadata standard to describe MBeans.
-
Remote Manager - The entity accessing a MBean Server remotely.
-
JConsole - The default Java Remote Manager.
This specification plays a part in both the OSGi framework as well as in a remote manager.
A JMX OSGi manager bundle obtains one or more MBean servers that are registered as services. The JMX OSGi manager then registers all its managed beans: Framework MBean, Bundle State MBean, Package State MBean, and the Service State MBean under their JMX object names. If a number of optional services are registered, then the JMX OSGi bundle must also register a corresponding MBean with the MBean server for each of the services that it can obtain.
A remote manager can access an MBean Server running in a (remote) VM. The remote manager can then discover any MBeans. These MBeans can be manipulated as dynamic types or as specific types as outlined in this specification.
JMX is a specification which defines how arbitrary remote communication protocols and mechanisms can be adapted to interact with the underlying management APIs exposed by JMX compliant implementations. JMX is not a remote communication standard, the actual protocols can vary. The JMX architecture is composed of three levels:
-
Instrumentation - The managed resources of the system are instrumented using managed beans (a.k.a. MBeans) which expose their management interfaces through a JMX agent for remote management and monitoring.
-
Agent - The JMX agent layer is mainly represented by the MBean server. This is the managed object server where the MBeans are registered. The JMX agent includes a set of functions for manipulating the registered MBeans, which directly expose and control the underlying resources, and then make them available to remote managers.
-
Remote Manager - The remote management layer provides the specification for the actual remote communication protocol adapters and defines standard connectors which make the JMX agent accessible to remote managers outside of the Java process that hosts the agent.
The JMX Architecture is depicted in Figure 124.2.
Connectors are used to connect an agent with a remote JMX-enabled managers. This form of communication involves a connector in the JMX agent and a connector client in the management application. Protocol adapters provide a management view of the JMX agent through a given protocol.
Remote managers that connect to a protocol adapter are usually specific to the given protocol. Remote Managers can be generic consoles (such as JConsole; see [8] Using JConsole to Monitor Applications), or domain-specific monitoring applications. External applications can interact with the MBeans through the use of JMX connectors and protocol adapters.
All managed objects in JMX are referenced via JMX Object Names. Object Names are strings which can be resolved within the context of a JMX MBean Server in order. An Object Name consists of two parts:
ObjectName ::= domain ':' properties
properties ::= property ( ',' property )*
To avoid collisions between MBeans supplied by different vendors,
a recommended convention is to begin the domain name with the reverse
DNS name of the organization that specifies the MBeans, followed by a
full stop ('.' \u002E
) and a string whose interpretation is
determined by that organization.
MBeans specified by the OSGi Alliance have domains that start with
osgi
.
Any object can be registered with an MBean Server and manipulated remotely over an MBean Server Connection. An MBean Server Connection can represent the a local MBean Server or a remote MBean Server. An MBean is always identified by an Object Name. The Object Name identifies a remote MBean uniquely within a specific MBean Server Connection.
Standard manipulations of a remote MBean are done through attributes and operations, which are similar to properties and methods for Java beans. Not all methods on the implementation class can be used, the registering party must specifically provide access to the methods that can be called remotely. The registrar can define the exposed operations with the following mechanisms:
-
Design Pattern - Let the registered object implement an MBean interface that has the fully qualified name of the implementation class suffixed with
MBean
. The MBean server will then limit access to attributes and properties defined in the MBean interface. For example, thecom.acme.Resource
class should implement thecom.acme.ResourceMBean
interface. Thecom.acme.ResourceMBean
interface would define the properties and operations. -
Dynamic MBean - Register a Dynamic MBean, which handles the access to the operations and attributes programmatically. The JMX specification provides the
DynamicMBean
interface for this purpose. If the MBean registered with an MBean Server implements this interface, then the MBean Server must get the MBean's metadata through theDynamicMBean
interface instead of using reflection. Therefore, Dynamic MBeans can provide more rich metadata that describes their operations and attributes. -
Standard MBean - Register a Standard MBean. A standard MBean works the same as the previous bullet but does not require the implementation class name to map to the MBean interface name.
Attributes map to properties on the registered MBean interface and operations allow the invocation of an arbitrary method on the remote MBean with arbitrary parameters. The following code example shows how to get a the size property of a remote MBean in this way:
void drop( MBeanServerConnection mbs, ObjectNameobjectName) {
Integer sizeI = (Integer)
mbs.getAttribute(objectName, "Size");
int size = sizeI.intValue();
if (size > desiredSize) {
mbs.invoke(objectName,"dropOldest",
new Integer[] {new Integer(size - desiredSize)},
new String[] {"int"});
}
}
In release 1.2 the JMX specification introduced the MBean Server Invocation Handler to simplify the manipulation of the remote MBeans by creating a proxy for an MBean interface that implements all the relevant methods. An MBean interface defines the methods and properties for an MBean. The proxy has a reference to an MBean Server Connection, it can therefore automate the invocation of the appropriate methods from the MBean interface. Therefore, by using an MBean interface, it is possible to simplify the remote manager:
MBeanServer mbs = ...;
CacheControlMBean cacheControl = (CacheControlMBean)
MbeanServerInvocationHandler.newProxyInstance(
mbs, objectName, CacheControlMBean.class, false);
int size = cacheControl.getSize();
if (size > desiredSize)
cacheControl.dropOldest(size - desiredSize);
The creation of the proxy is somewhat verbose, but once it is available, the MBean can be accessed like a local object. The proxy is much easier to use and read, and much less error-prone, than accessing the MBean Server method through invoking operations and getting attributes.
The MBean interface can also ensure a certain amount of type safety. The MBean implementation can implement the MBean interface and the remote manager uses the proxy implementing this interface. However, neither is required. The MBean can directly implement the methods without implementing the interface and the remote manager can directly manipulate the attributes and invocations.
The key advantage is therefore the documentation of the management interface. Using an MBean interface, this can be done very concisely and it allows the usage of standard tools for Java source code and Javadoc.
The distributed nature of remote management poses a number of problems for exchanging general objects.
-
Versioning - All participating parties require access to the same version of the object's class.
-
Serialization - Not all objects are easy to serialize.
-
Size - Arbitrary objects can transitively link to large amounts of data.
-
Descriptive - Classes provide little or no support for editing.
-
Limited - Classes are Java specific, making it harder to interact with non-Java environments.
An alternative is to limit the management types to be exchanged to small, well defined set. Open MBeans limit the used data types to small number of types called the basic types. These types are supported by all JMX 1.2 and later implementations. This basic set of types contains:
-
Primitives -
boolean, byte, char, short, int, long, float, double
. -
Primitive Arrays -
boolean[], byte[], char[], short[], int[], long[], float[], double[]
. -
Wrappers -
Boolean, Byte, Character, Short, Integer, Long, Float, Double
. -
Scalars -
String, BigDecimal, BigInteger, Date, ObjectName
. -
Complex -
CompositeData, TabularData
, and complex arrays. -
Return -
Void,
operation return only.
The Complex types are unique to JMX, they are used to provide access to complex data (like objects) without using classes. The complex types are self describing. The metadata associated with these complex types allow a remote manager to discover the structure and automatically construct a (graphic) user interface for these complex objects.
Open MBeans must be Dynamic MBeans when registered. Furthermore, they must provide Open MBean variations of the Info objects that describe the operations and attributes.
The OSGi JMX Management model is based on Open MBeans, see Open Types. This specification declares a number of MBeans for the core Framework, some of the core services, and a number of compendium services. Though Open MBeans are based on Dynamic MBeans, this specification uses the traditional MBean interface to define the management interaction patterns. The implementer of this specification must register an implementation of these interfaces as a Dynamic MBean. An implementation should provide the additional Open MBeans Info objects for the operations and attributes.
This specification defines the following Open MBeans:
-
Core Framework -
FrameworkMBean
,BundleStateMBean
,ServiceStateMBean
,BundleWiringStateMBean,
andPackageStateMBean
. -
Core Services -
PermissionAdminMBean
. The Conditional Permission Admin is not included in this specification. -
Compendium Services -
ConfigurationAdminMBean
,UserAdminMBean
,ProvisioningServiceMBean
The MBean interfaces have been named after the service they
manage. That is the ConfigurationAdminMBean
interface
manages the Configuration Admin service, which is modelled with the
ConfigurationAdmin
interface.
Package names are constructed from taking the corresponding
resource package and inserting jmx.
after
org.osgi
. For example
org.osgi.framework org.osgi.jmx.framework
org.osgi.service.cm org.osgi.jmx.service.cm
It is not possible to use the MBean interface design pattern because the MBean interfaces are in OSGi packages. The design pattern requires the fully qualified name of the implementation suffixed with MBean to match the MBean interface name. This would require that the implementation class resides in an OSGi package, which would extend these packages.
However, the StandardMBean
class allows the
association of one of the OSGi MBean interfaces with an arbitrary
class.
Object Names for OSGi managed MBeans must follow the following structure:
object-name ::= ( core | compendium )
',version=' version
',framework=' framework
',uuid=' uuid
(',' key '=' value )*
core ::= 'osgi.core:' framework-type
compendium ::= 'osgi.compendium:' service-type
framework-type ::= ( 'type=' token ) | service-type
service-type ::= 'service=' token
framework ::= <Bundle symbolic name of the system bundle>
uuid ::= <org.osgi.framework.uuid Framework property'svalue>
key ::= <any jmx supported key>
value ::= <any jmx supported value>
There are the following additional constraints:
-
Spaces - Spaces between any of the terminals are not permitted.
-
Version - The
version
must be limited to a major and minor version part. The given version must identify the package of the corresponding resource. For example, if the Configuration Admin service is on version1.3.2.200910101250
, then the version in the Object Name must be1.3
. -
Service - The
service-type
should use the package name of the corresponding service. For example, for Configuration Admin this would beservice=cm
.
The Object Name must contain the framework bundle symbolic name and its UUID so that multiple instances on the same VM can be discriminated. An example of an Object Name is:
osgi.core:type=framework,version=1.7,framework=org.apache.felix.framework, «
uuid=f81d4fae-7dec-11d0-a765-00a0c91e6bf6
The advantage of the framework property is that it can be used to
simplify the querying for the MBeans using Object Name
patterns. Patterns are names have an asterisk
('*' \u002A
). For instance, the following query allows a
client to find all Framework MBeans for an Apache Felix implementation
without having to rely on knowing the UUID:
ObjectName on = new ObjectName(
"osgi.core:type=framework,"
+ "version=1.7,framework=org.apache.felix.framework,*");
Set<ObjectInstance> instances = mserver.queryMBeans(on,null);
Furthermore, in many cases, a JMX client may appropriately assume that only a single instance of the OSGi framework exists in the managed system, as in the following example:
ObjectName on = new ObjectName("osgi.core:type=framework,version=1.7,*");
Set<ObjectInstance> instances = mserver.queryMBeans(on,null);
The uuid
and framework
property keys are
only applicable to OSGi JMX Management Model Specification Version 1.1
and above.
To maintain backward compatibility, a OSGi JMX Framework package
Version 1.7 may register the first instantiation of an OSGi framework
using both the Version 1.0 Object Names as well as the Object Names
outlined in this specification. In other words, a JMX client may not
specify the uuid
and/or framework properties, and still
retrieve the MBeans for a OSGi framework instance.
The actual object name prefixes are defined in the MBean interfaces. For example, the Object Name for the Configuration Admin MBean is:
osgi.compendium:service=cm,version=1.3
It is the responsibility of the party registering the MBean to suffix this with the framework and UUID.
In this specification, all management interfaces are specified to return opaque Strings or longs rather than Object Names so that the MBean interfaces contain no JMX specific artifacts and can be used with a variety of remote access protocols such as SNMP, etc. Non JMX use of these APIs can use these Strings as their own opaque identifiers without any change to the interfaces themselves.
An implementation of this specification must find all MBean Servers services that it has access to. It should then register all MBeans with each server found in the service registry.
A compliant implementation must register all the framework's
MBeans: FrameworkMBean, BundleStateMBean, ServiceStateMBean,
BundleWiringStateMBean and PackageStateMBean
. The registration of
the compendium services is optional. However, if they are registered
they must implement the behavior as defined in this
specification.
The OSGi MBeans are designed to minimize the notifications. That is, the objects model a command interface to access the required information. Their registration is not intended to signify anything else than the start of the manager bundle and the availability of the underlying resource.
Implementations must always register only one of each of the Framework MBean types (Framework MBean, Service State MBean, Bundle State MBean, Wiring State MBean, and Package State MBean). All other MBean types depend on the registered services they manage. Each service requires its unique MBean. If no corresponding service is present, then no MBean should be registered. Modified events must be ignored. If a manager supports a specific OSGi MBean for a compendium service then it must register an MBean for each instance of that service.
This specification defines MBean interfaces listed in the following table. The Object Name specified in this table is broken into a number of lines for readability, however, newlines and whitespace is not allowed in the Object Name.
Table 124.1 MBeans
MBean | Object Name | Description |
---|---|---|
|
Provides access to bundle life cycle methods of the framework including batch install and update operations. |
|
|
Provides detailed access to the state of one bundle and aggregated state of a group of bundles. |
|
|
Provides detailed access to the state of one service and aggregated state of a group of services. |
|
|
Provides detailed access to the state of one package and aggregated state of a group of packages. |
|
|
Based on the Permission Admin service. |
|
|
Manages a Configuration Admin service. |
|
|
Manages a Provisioning Service. |
|
|
Manages a User Admin service. |
|
|
Reflects the Framework's wiring state. |
The MBean interfaces do not only define the Java interface, they also define the Open Types. These types are defined with the Item class in this specification to simplify the definitions; the Item class has no role in a management application. The Item class is used to allow the items used in Composite Types to be encoded in the interface. This is not possible with the standard Open Types because they use exceptions and use parallel arrays. For example, the following code defines a static Open Type without the Item class:
static CompositeType HEADER;
static {
try {
HEADER = new CompositeType( "HEADER" "This is a header",
new String[] {"KEY", "VALUE"},
new String[] {"A key for a header", "A value for a header"},
new OpenType[] { SimpleType.STRING, SimpleType.STRING });
catch(OpenDataException e) {
...
}
}
This code can be replaced with the Item
class:
static Item KEY = new Item("KEY", "A key forheader", SimpleType.STRING );
static Item VALUE = new Item("VALUE", "A value for header",SimpleType.STRING );
static CompositeType HEADER = Item.composite( "HEADER", "Thisis a header",
KEY, VALUE );
The Item class also provides a number of convenience methods to construct the different Open Types. However, the intention is to simplify the specification definitions, not as an aid in management operations.
Exposing any system remotely opens up a, potentially, devastating security hole in a system. Remote entities should establish their identity and the management system should be able to control the access these entities have over the management system. JMX seamlessly inter operates with the Java Authentication and Authorization Service (JAAS) and Java 2 platform Standard Edition (Java SE) Security Architecture.
The JMX OSGi manager must have access to the services it manages and the operations it invokes. It is likely that this bundle requires All Permission because it needs to invoke operations on the Conditional Permission Admin. It is strongly advised that implementations limit the set of available permissions based on authenticating the remote manager.
OSGi JMX Package Version 1.1.
Bundles wishing to use this package must list the package in the Import-Package header of the bundle's manifest. This package has two types of users: the consumers that use the API in this package and the providers that implement the API in this package.
Example import for consumers using the API in this package:
Import-Package: org.osgi.jmx; version="[1.1,2.0)"
Example import for providers implementing the API in this package:
Import-Package: org.osgi.jmx; version="[1.1,1.2)"
-
Item
- The item class enables the definition of open types in the appropriate interfaces. -
JmxConstants
- Constants for OSGi JMX Specification.
The item class enables the definition of open types in the appropriate interfaces. This class contains a number of methods that make it possible to create open types for CompositeType, TabularType, and ArrayType. The normal creation throws a checked exception, making it impossible to use them in a static initializer. The constructors are also not very suitable for static construction. An Item instance describes an item in a Composite Type. It groups the triplet of name, description, and Open Type. These Item instances allows the definitions of an item to stay together.
Immutable
The name of the item.
The description of the item.
The Open Type of this item.
Ignored, contains list of restrictions
Create a triple of name, description, and type. This triplet is used in the creation of a Composite Type.
The dimension
The element type
Return a new Array Type.
A new Array Type
The name of the Tabular Type.
The description of the Tabular Type.
The items that describe the composite type.
Create a Composite Type
a new Composite Type
RuntimeException
– when the Tabular Type throws an
OpenDataException
The parent type, can be null
The name of the type
The description of the type
The items that should be added/override to the parent type
Extend a Composite Type by adding new items. Items can override items in the parent type.
A new Composite Type that extends the parent type
RuntimeException
– when an OpenDataException is thrown
The name of the Tabular Type.
The description of the Tabular Type.
The Open Type for a row
The names of the items that form the index .
Create a Tabular Type.
A new Tabular Type composed from the parameters.
RuntimeException
– when the Tabular Type throws an
OpenDataException
Constants for OSGi JMX Specification. Additionally, this class contains a number of utility types that are used in different places in the specification. These are LONG_ARRAY_TYPE, STRING_ARRAY_TYPE, and PROPERTIES_TYPE.
Immutable
For an encoded array we need to start with ARRAY_OF. This must be followed by one of the names in SCALAR.
Value for PROPERTY_TYPE value in the case of java.math.BigDecimal
Value for PROPERTY_TYPE value in the case of java.math.BigInteger
Value for PROPERTY_TYPE value in the case of java.lang.Boolean
Value for PROPERTY_TYPE value in the case of java.lang.Byte
Value for PROPERTY_TYPE value in the case of java.lang.Character
Value for PROPERTY_TYPE value in the case of java.lang.Double
Value for PROPERTY_TYPE value in the case of java.lang.Float
Value for PROPERTY_TYPE value in the case of java.lang.Integer
The key of a property. The key is KEY and the type is SimpleType.STRING.
Value for PROPERTY_TYPE value in the case of java.lang.Long
The domain name of the selected OSGi compendium MBeans
The domain name of the core OSGi MBeans
Value for PROPERTY_TYPE value in the case of the boolean
primitive type.
Value for PROPERTY_TYPE value in the case of the byte
primitive type.
Value for PROPERTY_TYPE value in the case of the char
primitive type.
Value for PROPERTY_TYPE value in the case of the double
primitive type.
Value for PROPERTY_TYPE value in the case of the float
primitive type.
Value for PROPERTY_TYPE value in the case of the int
primitive type.
Value for PROPERTY_TYPE value in the case of the long
primitive type.
Value for PROPERTY_TYPE value in the case of the short
primitive type.
Describes a map with properties. The row type is PROPERTY_TYPE. The index is defined to the KEY of the property.
A Composite Type describing a a single property. A property consists of the following items KEY_ITEM, VALUE_ITEM, and TYPE_ITEM.
A set of all scalars that can be used in the TYPE property of a PROPERTIES_TYPE. This contains the following names:
Value for PROPERTY_TYPE value in the case of java.lang.Short
Value for PROPERTY_TYPE value in the case of java.lang.String
The MBean Open type for an array of strings
The type of the property. The key is TYPE and the type is SimpleType.STRING. This string must follow the following syntax:
type ::= scalar | vector | array
vector ::= 'Vector of' scalar
array ::= 'Array of' (scalar | primitive)
scalar ::= 'String' | 'BigInteger' | 'BigDecimal'
| 'Byte' | 'Character' | 'Short'
| 'Integer' | 'Long' | 'Float'
| 'Double' | 'Version'
primitive ::= 'byte' | 'char' | 'short'
| 'int' | 'long' | 'float'
| 'double'
This encoding does not support arrays in vectors or arrays. Arrays and vectors can only contain scalars. List properties are encoded as arrays. Empty lists, arrays or vectors are not represented. Null is not an allowed value.
For example, the encoding of a byte array byte[] {1,2,3,5,7}
would look like:
type: 'Array of byte'
value: 1,2,3,5,7
Quoting can be used as follows:
type: 'Array of String'
value: 'abc', 'def', '\'quoted\'', "'quoted'", "\\"
The value of a property. The key is VALUE and the type is SimpleType.STRING. A value will be encoded by the string given in TYPE. The syntax for this type is given in TYPE_ITEM.
For an encoded vector we need to start with ARRAY_OF. This must be followed by one of the names in SCALAR.
Value for PROPERTY_TYPE value in the case of Version
1.1
OSGi JMX Framework Package Version 1.7.
Bundles wishing to use this package must list the package in the Import-Package header of the bundle's manifest. This package has two types of users: the consumers that use the API in this package and the providers that implement the API in this package.
Example import for consumers using the API in this package:
Import-Package: org.osgi.jmx.framework; version="[1.7,2.0)"
Example import for providers implementing the API in this package:
Import-Package: org.osgi.jmx.framework; version="[1.7,1.8)"
-
BundleStateMBean
- This MBean represents the Bundle state of the framework. -
FrameworkMBean
- The FrameworkMbean provides mechanisms to exert control over the framework. -
PackageStateMBean
- This MBean provides information about the package state of the framework. -
ServiceStateMBean
- This MBean represents the Service state of the framework.
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.
Thread-safe
The key ACTIVATION_POLICY_USED, used in 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.
Constant ACTIVE for the STATE
The Composite Type that represents a bundle event. This composite consists of:
The Tabular Type for a list of bundles. The row type is BUNDLE_TYPE and the index is IDENTIFIER.
The key EVENT, used in EVENT_ITEM.
The item containing the event type. The key is EVENT and the type is SimpleType.INTEGER
The key EXPORTED_PACKAGES, used in 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.
The key FRAGMENT, used in FRAGMENT_ITEM.
The item containing the fragment status in BUNDLE_TYPE. The key is FRAGMENT and the the type is SimpleType.BOOLEAN.
The key FRAGMENTS, used in 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.
The Composite Type describing an entry in bundle headers. It consists of KEY_ITEM and VALUE_ITEM.
The key HEADERS, used in HEADERS_ITEM.
The item containing the bundle headers in BUNDLE_TYPE. The key is HEADERS and the the type is 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.
The key HOSTS, used in 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
The key IDENTIFIER, used in IDENTIFIER_ITEM.
The item containing the bundle identifier in BUNDLE_TYPE. The key is IDENTIFIER and the the type is SimpleType.LONG.
The key IMPORTED_PACKAGES, used in EXPORTED_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.
Constant INSTALLED for the STATE
The key KEY, used in KEY_ITEM.
The item describing the key of a bundle header entry. The key is KEY and the type is SimpleType.STRING.
The key LAST_MODIFIED, used in 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.
The key LOCATION, used in LOCATION_ITEM.
The item containing the bundle location in BUNDLE_TYPE. The key is LOCATION and the the type is SimpleType.STRING.
The Object Name prefix for this mbean. The full object name also contains the framework name and uuid as properties.
The key PERSISTENTLY_STARTED, used in 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.
The key REGISTERED_SERVICES, used in 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.
The key REMOVAL_PENDING, used in 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.
The key REQUIRED, used in REQUIRED_ITEM.
The key REQUIRED_BUNDLES, used in 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
The item containing the required status in BUNDLE_TYPE. The key is REQUIRED and the the type is SimpleType.BOOLEAN.
The key REQUIRING_BUNDLES, used in 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
Constant RESOLVED for the STATE
The key SERVICES_IN_USE, used in 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.
The key START_LEVEL, used in START_LEVEL_ITEM.
The item containing the start level in BUNDLE_TYPE. The key is START_LEVEL and the the type is SimpleType.INTEGER.
Constant STARTING for the STATE
The key STATE, used in 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:
Constant STOPPING for the STATE
The key SYMBOLIC_NAME, used in SYMBOLIC_NAME_ITEM.
The item containing the symbolic name in BUNDLE_TYPE. The key is SYMBOLIC_NAME and the the type is SimpleType.STRING.
Constant UNINSTALLED for the STATE
Constant UNKNOWN for the STATE
The key VALUE, used in VALUE_ITEM.
The item describing the value of a bundle header entry. The key is VALUE and the type is SimpleType.STRING.
The key VERSION, used in VERSION_ITEM.
The item containing the symbolic name in BUNDLE_TYPE. The key is SYMBOLIC_NAME and the the type is SimpleType.STRING.
the bundle identifier of the requested bundle
Obtain the information regarding a single bundle. The result is defined by the BUNDLE_TYPE CompositeType.
A CompositeData object with the bundle information
IOException
– if the operation fails
IllegalArgumentException
– if the bundle indicated does not exist
List all bundle IDs in the framework.
all the bundle ids in the framework.
IOException
– if the operation fails
Answer the list of exported packages for this bundle.
the array of package names, combined with their version in the format <packageName;version>
IOException
– if the operation fails
IllegalArgumentException
– if the bundle indicated does not exist
Answer the list of the bundle ids of the fragments associated with this bundle
the array of bundle identifiers
IOException
– if the operation fails
IllegalArgumentException
– if the bundle indicated does not exist
the unique identifier of the bundle
the key of the header to look up
Retrieve a single header from the bundle headers.
the value of associated header
IOException
– if the operation fails
IllegalArgumentException
– if the bundle indicated does not exist
the unique identifier of the bundle
the key of the header to look up
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)
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.
the value of associated header
IOException
– if the operation fails
IllegalArgumentException
– if the bundle indicated does not exist
the unique identifier of the bundle
Answer the headers for the bundle uniquely identified by the bundle id. The Tabular Data is typed by the HEADERS_TYPE.
the table of associated header key and values
IOException
– if the operation fails
IllegalArgumentException
– if the bundle indicated does not exist
the unique identifier of the bundle
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)
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.
the table of associated header key and values
IOException
– if the operation fails
IllegalArgumentException
– if the bundle indicated does not exist
the bundle id of the fragment
Answer the list of bundle ids of the bundles which host a fragment
the array of bundle identifiers
IOException
– if the operation fails
IllegalArgumentException
– if the bundle indicated does not exist
the bundle identifier
Answer the array of the packages imported by this bundle
the array of package names, combined with their version in the format <packageName;version>
IOException
– if the operation fails
IllegalArgumentException
– if the bundle indicated does not exist
the unique identifier of a bundle
Answer the last modified time of a bundle
the last modified time
IOException
– if the operation fails
IllegalArgumentException
– if the bundle indicated does not exist
the identifier of the bundle
Answer the location of the bundle.
The location string of this bundle
IOException
– if the operation fails
IllegalArgumentException
– if the bundle indicated does not exist
the bundle identifier
Answer the list of service identifiers representing the services this bundle exports
the list of service identifiers
IOException
– if the operation fails
IllegalArgumentException
– if the bundle indicated does not exist
the bundle identifier to find the dependencies for
Answer an array of ids of bundles the given bundle depends on.
the bundle identifiers of the dependencies
IOException
– if the operation fails
IllegalArgumentException
– if the bundle indicated does not exist
the bundle identifier
Answer the list of identifiers of the bundles which require this bundle
the list of bundle identifiers
IOException
– if the operation fails
IllegalArgumentException
– if the bundle indicated does not exist
the bundle identifier
Answer the list of service identifiers which refer to the the services this bundle is using
the list of service identifiers
IOException
– if the operation fails
IllegalArgumentException
– if the bundle indicated does not exist
the identifier of the bundle
Answer the start level of the bundle
the start level
IOException
– if the operation fails
IllegalArgumentException
– if the bundle indicated does not exist
the identifier of the bundle
Answer the symbolic name of the state of the bundle
the string name of the bundle state
IOException
– if the operation fails
IllegalArgumentException
– if the bundle indicated does not exist
the identifier of the bundle
Answer the symbolic name of the bundle
the symbolic name
IOException
– if the operation fails
IllegalArgumentException
– if the bundle indicated does not exist
the identifier of the bundle
Answer the location of the bundle.
The location string of this bundle
IOException
– if the operation fails
IllegalArgumentException
– if the bundle indicated does not exist
the identifier of the bundle
Answer whether the specified bundle's autostart setting indicates that the activation policy declared in the bundle's manifest must be used.
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.
IOException
– if the operation fails
IllegalArgumentException
– if the bundle indicated does not exist
the identifier of the bundle
Answer whether the bundle is a fragment or not
true if the bundle is a fragment
IOException
– if the operation fails
IllegalArgumentException
– if the bundle indicated does not exist
the identifier of the bundle
Answer if the bundle is persistently started when its start level is reached
true if the bundle is persistently started
IOException
– if the operation fails
IllegalArgumentException
– if the bundle indicated does not exist
the identifier of the bundle
Answer true if the bundle is pending removal
true if the bundle is pending removal
IOException
– if the operation fails
IllegalArgumentException
– if the bundle indicated does not exist
the identifier of the bundle
Answer true if the bundle is required by another bundle
true if the bundle is required by another bundle
IOException
– if the operation fails
IllegalArgumentException
– if the bundle indicated does not exist
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.
the tabular representation of the bundle state
IOException
– if the operation fails
The names of the items to include in the result.
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.
the tabular representation of the bundle state
IOException
– if the operation fails
The FrameworkMbean provides mechanisms to exert control over the framework. For many operations, it provides a batch mechanism to avoid excessive message passing when interacting remotely.
Thread-safe
The Composite Type for a batch action result. refreshBundle(long) and refreshBundles(long[]). Notice that a batch action result returns uses an id for the BUNDLE_IN_ERROR while the BATCH_INSTALL_RESULT_TYPE uses a location. This Composite Type consists of the following items:
The Composite Type which represents the result of a batch install operation. It is used in installBundles(String[]) and installBundlesFromURL(String[], String[]). This Composite Type consists of the following items:
The Composite Type which represents the result of a batch resolve operation. It is used in refreshBundlesAndWait(long[]) and resolve(long[]). This Composite Type consists of the following items:
The key for BUNDLE_IN_ERROR. This key is used with two different items: BUNDLE_IN_ERROR_ID_ITEM and BUNDLE_IN_ERROR_LOCATION_ITEM that each have a different type for this key. It is used in BATCH_ACTION_RESULT_TYPE and BATCH_INSTALL_RESULT_TYPE.
The item containing the bundle which caused the error during the batch operation. This item describes the bundle in error as an id. The key is BUNDLE_IN_ERROR and the type is SimpleType.LONG. It is used in BATCH_ACTION_RESULT_TYPE.
BUNDLE_IN_ERROR_LOCATION_ITEM for the item that has a location for the bundle in error.
The item containing the bundle which caused the error during the batch operation. This item describes the bundle in error as a location. The key is BUNDLE_IN_ERROR and the type is SimpleType.STRING. It is used in BATCH_INSTALL_RESULT_TYPE.
BUNDLE_IN_ERROR_ID_ITEM for the item that has the id for the bundle in error.
The key COMPLETED, used in COMPLETED_ITEM.
The item containing the list of bundles completing the batch operation. The key is COMPLETED and the type is JmxConstants.LONG_ARRAY_TYPE. It is used in BATCH_ACTION_RESULT_TYPE and BATCH_INSTALL_RESULT_TYPE.
The key ERROR, used in ERROR_ITEM.
The item containing the error message of the batch operation. The key is ERROR and the type is SimpleType.STRING. It is used in BATCH_ACTION_RESULT_TYPE and BATCH_INSTALL_RESULT_TYPE.
The Object Name prefix for this mbean. The full object name also contains the framework name and uuid as properties.
The key REMAINING, used in REMAINING_ID_ITEM and REMAINING_LOCATION_ITEM.
The item containing the list of remaining bundles unprocessed by the failing batch operation. The key is REMAINING and the type is JmxConstants.LONG_ARRAY_TYPE. It is used in BATCH_ACTION_RESULT_TYPE and BATCH_INSTALL_RESULT_TYPE.
The item containing the list of remaining bundles unprocessed by the failing batch operation. The key is REMAINING and the type is JmxConstants.STRING_ARRAY_TYPE. It is used in BATCH_ACTION_RESULT_TYPE and BATCH_INSTALL_RESULT_TYPE.
The SUCCESS, used in SUCCESS_ITEM.
The item that indicates if this operation was successful. The key is SUCCESS and the type is SimpleType.BOOLEAN. It is used in BATCH_ACTION_RESULT_TYPE and BATCH_INSTALL_RESULT_TYPE.
The initial bundles IDs for which to generate the dependency closure.
Returns the dependency closure for the specified bundles.
A graph of bundles is computed starting with the specified bundles. The
graph is expanded by adding any bundle that is either wired to a package
that is currently exported by a bundle in the graph or requires a bundle
in the graph. The graph is fully constructed when there is no bundle
outside the graph that is wired to a bundle in the graph. The graph may
contain UNINSTALLED
bundles that are
removal pending.
A bundle ID array containing a snapshot of the dependency closure of the specified bundles, or an empty array if there were no specified bundles.
IOException
– if the operation failed
IllegalArgumentException
– if a bundle indicated does not exist
Retrieve the framework start level
the framework start level
IOException
– if the operation failed
Answer the initial start level assigned to a bundle when it is first started
the start level
IOException
– if the operation failed
The name of the requested property.
Returns the value of the specified property. If the key is not found in
the Framework properties, the system properties are then searched. The
method returns null
if the property is not found.
The value of the requested property, or null
if the
property is undefined.
IOException
– if the operation failed
Returns the bundles IDs that have non-current, in use bundle wirings. This is typically the bundles which have been updated or uninstalled since the last call to refreshBundles(long[]).
A bundle ID array containing a snapshot of the bundles which have non-current, in use bundle wirings, or an empty array if there are no such bundles.
IOException
– if the operation failed
the location of the bundle to install
Install the bundle indicated by the bundleLocations
the bundle id the installed bundle
IOException
– if the operation does not succeed
the location to assign to the bundle
the URL which will supply the bytes for the bundle
Install the bundle indicated by the bundleLocations
the bundle id the installed bundle
IOException
– if the operation does not succeed
the array of locations of the bundles to install
Batch install the bundles indicated by the list of bundleLocationUrls
the resulting state from executing the operation
IOException
– if the operation does not succeed
the array of locations to assign to the installed bundles
the array of urls which supply the bundle bytes
Batch install the bundles indicated by the list of bundleLocationUrls
the resulting state from executing the operation
IOException
– if the operation does not succeed
for the precise specification of the CompositeData type representing the returned result.
the bundle identifier
Force the update, replacement or removal of the packages identified by the specified bundle.
IOException
– if the operation failed
IllegalArgumentException
– if the bundle indicated does not exist
the bundle identifier
Force the update, replacement or removal of the packages identified by the specified bundle and wait until completed.
whether the bundle was successfully resolved after being refreshed.
IOException
– if the operation failed
IllegalArgumentException
– if the bundle indicated does not exist
The identifiers of the bundles to refresh, or
null
for all bundles with packages pending removal.
Force the update, replacement or removal of the packages identified by the list of bundles.
IOException
– if the operation failed
IllegalArgumentException
– if a bundle indicated does not exist
The identifiers of the bundles to refresh, or
null
for all bundles with packages pending removal.
Force the update, replacement or removal of the packages identified by the list of bundles and wait until completed.
the result of the refresh operation
IOException
– if the operation failed
IllegalArgumentException
– if a bundle indicated does not exist
for the precise specification of the CompositeData type representing the returned result.
The identifiers of the bundles to resolve, or
null
to resolve all unresolved bundles.
Same as resolveBundles(long[]) but with a more detailed return type.
the resulting state from executing the operation
IOException
– if the operation failed
IllegalArgumentException
– if a bundle indicated does not exist
for the precise specification of the CompositeData type representing the returned result.
the bundle identifier
Resolve the bundle indicated by the unique symbolic name and version
true
if the bundle was resolved, false otherwise
IOException
– if the operation does not succeed
IllegalArgumentException
– if the bundle indicated does not exist
The identifiers of the bundles to resolve, or
null
to resolve all unresolved bundles.
Batch resolve the bundles indicated by the list of bundle identifiers
true
if the bundles were resolved, false otherwise
IOException
– if the operation does not succeed
IllegalArgumentException
– if a bundle indicated does not exist
Restart the framework by updating the system bundle
IOException
– if the operation failed
the bundle identifier
the new start level for the bundle
Set the start level for the bundle identifier
IOException
– if the operation failed
the array of bundle identifiers
the array of new start level for the bundles
Set the start levels for the list of bundles.
the resulting state from executing the operation
IOException
– if the operation failed
for the precise specification of the CompositeData type representing the returned result.
the new start level
Set the start level for the framework
IOException
– if the operation failed
the new start level
Set the initial start level assigned to a bundle when it is first started
IOException
– if the operation failed
Shutdown the framework by stopping the system bundle
IOException
– if the operation failed
the bundle identifier
Start the bundle indicated by the bundle identifier
IOException
– if the operation does not succeed
IllegalArgumentException
– if the bundle indicated does not exist
the array of bundle identifiers
Batch start the bundles indicated by the list of bundle identifier
the resulting state from executing the operation
IOException
– if the operation does not succeed
for the precise specification of the CompositeData type representing the returned result.
the bundle identifier
Stop the bundle indicated by the bundle identifier
IOException
– if the operation does not succeed
IllegalArgumentException
– if the bundle indicated does not exist
the array of bundle identifiers
Batch stop the bundles indicated by the list of bundle identifier
the resulting state from executing the operation
IOException
– if the operation does not succeed
the bundle identifier
Uninstall the bundle indicated by the bundle identifier
IOException
– if the operation does not succeed
IllegalArgumentException
– if the bundle indicated does not exist
the array of bundle identifiers
Batch uninstall the bundles indicated by the list of bundle identifiers
the resulting state from executing the operation
IOException
– if the operation does not succeed
the bundle identifier
Update the bundle indicated by the bundle identifier
IOException
– if the operation does not succeed
IllegalArgumentException
– if the bundle indicated does not exist
the bundle identifier
the URL to use to update the bundle
Update the bundle identified by the bundle identifier
IOException
– if the operation does not succeed
IllegalArgumentException
– if the bundle indicated does not exist
the array of bundle identifiers
Batch update the bundles indicated by the list of bundle identifier.
the resulting state from executing the operation
IOException
– if the operation does not succeed
the array of bundle identifiers
the array of URLs to use to update the bundles
Update the bundle uniquely identified by the bundle symbolic name and version using the contents of the supplied urls.
the resulting state from executing the operation
IOException
– if the operation does not succeed
IllegalArgumentException
– if the bundle indicated does not exist
This MBean provides information about the package state of the framework.
Thread-safe
The key EXPORTING_BUNDLE, used in EXPORTING_BUNDLES_ITEM.
The item containing the bundle identifier in PACKAGE_TYPE. The key is EXPORTING_BUNDLES and the type is JmxConstants.LONG_ARRAY_TYPE.
The key IMPORTING_BUNDLES, used in IMPORTING_BUNDLES_ITEM.
The item containing the bundle identifier in PACKAGE_TYPE. The key is IMPORTING_BUNDLES and the type is JmxConstants.LONG_ARRAY_TYPE.
The key NAME, used in NAME_ITEM.
The item containing the name of the package in PACKAGE_TYPE. The key is NAME and the type is SimpleType.LONG.
The fully qualified object name of this MBean.
The Composite Type for a CompositeData representing a package. This type consists of:
The key is defined as NAME and EXPORTING_BUNDLES
The Tabular Type used in listPackages(). They key is NAME, VERSION, and EXPORTING_BUNDLES.
The name of the item containing the pending removal status of the package in the CompositeData. Used
The item representing the removal pending status of a package. The key is REMOVAL_PENDING and the type is SimpleType.BOOLEAN.
The name of the item containing the package version in the CompositeData. Used in VERSION_ITEM.
The item containing the version of the package in PACKAGE_TYPE. The key is VERSION and the type is SimpleType.STRING.
- the package name
- the version of the package
Answer the identifier of the bundle exporting the package
the bundle identifiers exporting such a package
IOException
– if the operation fails
IllegalArgumentException
– if the package indicated does not exist
The package name
The version of the package
The exporting bundle for the given package
Answer the list of identifiers of the bundles importing the package
the list of bundle identifiers
IOException
– if the operation fails
IllegalArgumentException
– if the package indicated does not exist
The package name
The version of the package
The bundle exporting the package
Answer if this package is exported by a bundle which has been updated or uninstalled
true if this package is being exported by a bundle that has been updated or uninstalled.
IOException
– if the operation fails
IllegalArgumentException
– if the package indicated does not exist
Answer the package state of the system in tabular form The Tabular Data is typed by PACKAGES_TYPE, which has PACKAGE_TYPE as its Composite Type.
the tabular representation of the package state
IOException
– When fails
This MBean represents the Service state of the framework. This MBean also emits events that clients can use to get notified of the changes in the service state of the framework.
Thread-safe
The key BUNDLE_IDENTIFIER, used in BUNDLE_IDENTIFIER_ITEM.
The item containing the bundle identifier in SERVICE_TYPE. The key is BUNDLE_IDENTIFIER and the type is SimpleType.LONG .
The key BUNDLE_LOCATION, used in SERVICE_EVENT_TYPE.
The item containing the bundle location in EVENT_ITEM. The key is BUNDLE_LOCATION and the the type is SimpleType.STRING .
The key BUNDLE_SYMBOLIC_NAME, used in SERVICE_EVENT_TYPE.
The item containing the symbolic name in EVENT. The key is BUNDLE_SYMBOLIC_NAME and the the type is SimpleType.STRING.
The key EVENT, used in EVENT_ITEM.
The item containing the event type. The key is EVENT and the type is SimpleType.INTEGER
The key IDENTIFIER, used IDENTIFIER_ITEM.
The item containing the service identifier in SERVICE_TYPE. The key is IDENTIFIER and the type is SimpleType.LONG.
The key OBJECT_CLASS, used OBJECT_CLASS_ITEM.
The item containing the interfaces of the service in SERVICE_TYPE. The key is OBJECT_CLASS and the type is JmxConstants.STRING_ARRAY_TYPE.
The Object Name prefix for this mbean. The full object name also contains the framework name and uuid as properties.
The key PROPERTIES, used in PROPERTIES_ITEM.
The item containing service properties in SERVICE_TYPE. The key is PROPERTIES and the type is JmxConstants.PROPERTIES_TYPE.
The Composite Type that represents a service event. This composite consists of:
The Composite Type for a CompositeData representing a service. This type consists of:
The Tabular Type for a Service table. The rows consists of SERVICE_TYPE Composite Data and the index is IDENTIFIER .
The key USING_BUNDLES, used in USING_BUNDLES_ITEM.
The item containing the bundles using the service in SERVICE_TYPE. The key is USING_BUNDLES and the type is JmxConstants.LONG_ARRAY_TYPE.
the identifier of the service
Answer the bundle identifier of the bundle which registered the service
the identifier for the bundle
IOException
– if the operation fails
IllegalArgumentException
– if the service indicated does not exist
the identifier of the service
Answer the list of interfaces that this service implements
the list of interfaces
IOException
– if the operation fails
IllegalArgumentException
– if the service indicated does not exist
the identifier of the service
Answer the map of properties associated with this service.
the table of properties. These include the standard mandatory
service.id and objectClass properties as defined in the
org.osgi.framework.Constants
interface
IOException
– if the operation fails
IllegalArgumentException
– if the service indicated does not exist
the identifier of the service
the property key
Return a single property from the specified service.
a CompositeData object holding the value and data type of the property.
IOException
– if the operation fails
the ID of the service to look up
Obtain information about a given service. The result is defined by the CompositeType SERVICE_TYPE.
A CompositeData object with the service information
IOException
– if the operation fails
IllegalArgumentException
– if the service indicated does not exist
List all service IDs in the framework.
all the service ids in the framework.
IOException
– if the operation fails
the identifier of the service
Answer the list of identifiers of the bundles that use the service
the list of bundle identifiers
IOException
– if the operation fails
IllegalArgumentException
– if the service indicated does not exist
Answer the service state of the system in tabular form.
the tabular representation of the service state
IOException
– If the operation fails
IllegalArgumentException
– if the service indicated does not exist
The class name with which the services were registered or
null
for any class name.
A filter expression to match the services or null
for no additional filter.
Answer the service state of the system in tabular form. This method allows the specification of a class name and a filter to select services to be provided.
the tabular representation of the service state
IOException
– If the operation fails
IllegalArgumentException
– if the service indicated does not exist
The class name with which the services were registered or
null
for any class name.
A filter expression to match the services or null
for no additional filter.
The names of the SERVICE_TYPE items to include in the result. For example "objectClass" or "Properties". Note that the result always returns the "Identifier" item since this serves as the key in the resulting table.
Answer the service state of the system in tabular form. Apart from class name and filter, this method allows the specification of a subset of the SERVICE_TYPE items to be included in the result. Selecting only the relevant Service Type items may save bandwidth and improve performance over a remote connection.
the tabular representation of the service state
IOException
– If the operation fails
IllegalArgumentException
– if the service indicated does not exist
OSGi JMX Configuration Admin Package Version 1.3.
Bundles wishing to use this package must list the package in the Import-Package header of the bundle's manifest. This package has two types of users: the consumers that use the API in this package and the providers that implement the API in this package.
Example import for consumers using the API in this package:
Import-Package: org.osgi.jmx.service.cm; version="[1.3,2.0)"
Example import for providers implementing the API in this package:
Import-Package: org.osgi.jmx.service.cm; version="[1.3,1.4)"
-
ConfigurationAdminMBean
- This MBean provides the management interface to the OSGi Configuration Administration Service.
This MBean provides the management interface to the OSGi Configuration Administration Service.
Thread-safe
The object name for this mbean.
the persistent id of the factory
Create a new configuration instance for the supplied persistent id of the factory, answering the PID of the created configuration
the PID of the created configuration
IOException
– if the operation failed
the persistent id of the factory
the bundle location
Create a factory configuration for the supplied persistent id of the factory and the bundle location bound to bind the created configuration to, answering the PID of the created configuration
the pid of the created configuation
IOException
– if the operation failed
the persistent identifier of the configuration
Delete the configuration
IOException
– if the operation fails
the string representation of the
org.osgi.framework.Filter
Delete the configurations matching the filter specification.
IOException
– if the operation failed
IllegalArgumentException
– if the filter is invalid
the persistent identifier of the configuration
the bundle location
Delete the configuration
IOException
– if the operation fails
the persistent identifier of the configuration
Answer the bundle location the configuration is bound to
the bundle location
IOException
– if the operation fails
the string representation of the
org.osgi.framework.Filter
Answer the list of PID/Location pairs of the configurations managed by this service
the list of configuration PID/Location pairs
IOException
– if the operation failed
IllegalArgumentException
– if the filter is invalid
the persistent identifier of the configuration
Answer the factory PID if the configuration is a factory configuration, null otherwise.
the factory PID
IOException
– if the operation fails
the persistent identifier of the configuration
the bundle location
Answer the factory PID if the configuration is a factory configuration, null otherwise.
the factory PID
IOException
– if the operation fails
the persistent identifier of the configuration
Answer the contents of the configuration.
the table of contents
IOException
– if the operation fails
JmxConstants.PROPERTIES_TYPE for the details of the TabularType
the persistent identifier of the configuration
the bundle location
Answer the contents of the configuration.
the table of contents
IOException
– if the operation fails
JmxConstants.PROPERTIES_TYPE for the details of the TabularType
the persistent identifier of the configuration
the bundle location
Set the bundle location the configuration is bound to
IOException
– if the operation fails
the persistent identifier of the configuration
the table of properties
Update the configuration with the supplied properties For each property entry, the following row is supplied.
IOException
– if the operation fails
JmxConstants.PROPERTIES_TYPE for the details of the TabularType
the persistent identifier of the configuration
the bundle location
the table of properties
Update the configuration with the supplied properties For each property entry, the following row is supplied.
IOException
– if the operation fails
JmxConstants.PROPERTIES_TYPE for the details of the TabularType
OSGi JMX Permission Admin Package Version 1.2.
Bundles wishing to use this package must list the package in the Import-Package header of the bundle's manifest. This package has two types of users: the consumers that use the API in this package and the providers that implement the API in this package.
Example import for consumers using the API in this package:
Import-Package: org.osgi.jmx.service.permissionadmin; version="[1.2,2.0)"
Example import for providers implementing the API in this package:
Import-Package: org.osgi.jmx.service.permissionadmin; version="[1.2,1.3)"
-
PermissionAdminMBean
- This MBean represents the OSGi Permission Manager Service
This MBean represents the OSGi Permission Manager Service
Thread-safe
Permission Admin MBean object name.
location identifying the bundle
Answer the list of encoded permissions of the bundle specified by the bundle location
the array of String encoded permissions
IOException
– if the operation fails
Answer the list of encoded permissions representing the default permissions assigned to bundle locations that have no assigned permissions
the array of String encoded permissions
IOException
– if the operation fails
Answer the bundle locations that have permissions assigned to them
the bundle locations
IOException
– if the operation fails
the string encoded permissions
Set the default permissions assigned to bundle locations that have no assigned permissions
IOException
– if the operation fails
OSGi JMX Initial Provisioning Package Version 1.2.
Bundles wishing to use this package must list the package in the Import-Package header of the bundle's manifest. This package has two types of users: the consumers that use the API in this package and the providers that implement the API in this package.
Example import for consumers using the API in this package:
Import-Package: org.osgi.jmx.service.provisioning; version="[1.2,2.0)"
Example import for providers implementing the API in this package:
Import-Package: org.osgi.jmx.service.provisioning; version="[1.2,1.3)"
-
ProvisioningServiceMBean
- This MBean represents the management interface to the OSGi Initial Provisioning Service
This MBean represents the management interface to the OSGi Initial Provisioning Service
Thread-safe
Provisioning MBean object name.
the set of Provisioning Information key/value pairs to add to the Provisioning Information dictionary. Any keys are values that are of an invalid type will be silently ignored.
Adds the key/value pairs contained in info
to the Provisioning
Information dictionary. This method causes the
PROVISIONING_UPDATE_COUNT
to be incremented.
IOException
– if the operation fails
JmxConstants.PROPERTIES_TYPE for details of the Tabular Data
the String form of the URL that will be resolved into a
ZipInputStream
which will be used to add key/value pairs
to the Provisioning Information dictionary and install and start
bundles. If a ZipEntry
does not have an Extra
field that corresponds to one of the four defined MIME types (
MIME_STRING
, MIME_BYTE_ARRAY
,MIME_BUNDLE
,
and MIME_BUNDLE_URL
) in will be silently ignored.
Processes the ZipInputStream
contents of the provided zipURL and
extracts information to add to the Provisioning Information dictionary,
as well as, install/update and start bundles. This method causes the
PROVISIONING_UPDATE_COUNT
to be incremented.
IOException
– if an error occurs while processing the
ZipInputStream of the URL. No additions will be made to the
Provisioning Information dictionary and no bundles must be
started or installed.
Returns a table representing the Provisioning Information Dictionary.
The table representing the manager dictionary.
IOException
– if the operation fails
JmxConstants.PROPERTIES_TYPE for details of the Tabular Data
the new set of Provisioning Information key/value pairs. Any keys are values that are of an invalid type will be silently ignored.
Replaces the Provisioning Information dictionary with the entries of the
supplied table. This method causes the PROVISIONING_UPDATE_COUNT
to be incremented.
IOException
– if the operation fails
JmxConstants.PROPERTIES_TYPE for details of the Tabular Data
OSGi JMX User Admin Package Version 1.1.
Bundles wishing to use this package must list the package in the Import-Package header of the bundle's manifest. This package has two types of users: the consumers that use the API in this package and the providers that implement the API in this package.
Example import for consumers using the API in this package:
Import-Package: org.osgi.jmx.service.useradmin; version="[1.1,2.0)"
Example import for providers implementing the API in this package:
Import-Package: org.osgi.jmx.service.useradmin; version="[1.1,1.2)"
-
UserAdminMBean
- This MBean provides the management interface to the OSGi User Manager Service
This MBean provides the management interface to the OSGi User Manager Service
Thread-safe
The Composite Type for an Authorization object. It consists of the NAME_ITEM and ROLES_ITEM items.
The CREDENTIALS key, used in CREDENTIALS_ITEM.
The item containing the credentials of a user. The key is CREDENTIALS and the type is JmxConstants.PROPERTIES_TYPE .
The Composite Type for a Group. It extends USER_TYPE and adds MEMBERS_ITEM, and REQUIRED_MEMBERS_ITEM. This type extends the USER_TYPE. It adds:
If there are no members or required members an empty array is returned in the respective items.
The MEMBERS key, used in MEMBERS_ITEM.
The item containing the members of a group. The key is MEMBERS and the type is JmxConstants.STRING_ARRAY_TYPE. It is used in GROUP_TYPE.
The key NAME, used in NAME_ITEM.
The item for the user name for an authorization object. The key is NAME and the type is SimpleType.STRING.
User Admin MBean object name.
The PROPERTIES key, used in PROPERTIES_ITEM.
The item containing the properties of a Role. The key is PROPERTIES and the type is JmxConstants.PROPERTIES_TYPE.
The REQUIRED_MEMBERS key, used in REQUIRED_MEMBERS_ITEM.
The item containing the required members of a group. The key is REQUIRED_MEMBERS and the type is JmxConstants.STRING_ARRAY_TYPE. It is used in GROUP_TYPE .
The Composite Type for a Role. It contains the following items:
The key ROLES, used in ROLES_ITEM.
The item containing the roles for this authorization object. The key is ROLES. and the type is JmxConstants.STRING_ARRAY_TYPE.
The Role TYPE key, used in TYPE_ITEM.
The item containing the type of the roles encapsulated by this authorization object. The key is TYPE and the type is SimpleType.INTEGER.
A Composite Type for a User. A User contains its Role description and adds the credentials. It extends ROLE_TYPE and adds CREDENTIALS_ITEM. This type extends the ROLE_TYPE. It adds:
The key of the credential to add
The value of the credential to add
The name of the user that gets the credential.
Add credentials to a user, associated with the supplied key
IOException
– if the operation fails
IllegalArgumentException
– if the username is not a User
The key of the credential to add
The value of the credential to add
The name of the user that gets the credential.
Add credentials to a user, associated with the supplied key
IOException
– if the operation fails
IllegalArgumentException
– if the username is not a User
The group name that receives the rolename
as
member.
The rolename
(User or Group) that must be added.
Add a member to the group.
true
if the role was added to the group
IOException
– if the operation fails
IllegalArgumentException
– if an invalid group name or role name is
specified
The added property key
The added byte[] property value
The role name that receives the property
Add or update a property on a role.
IOException
– if the operation fails
IllegalArgumentException
– if an invalid role name is specified
The key of the property to add
The value of the property to add (String
)
The role name
Add or update a property on a role
IOException
– if the operation fails
IllegalArgumentException
– if an invalid role name is specified
The group name that is addded
The role that
Add a required member to the group
true if the role was added to the group
IOException
– if the operation fails
IllegalArgumentException
– if an invalid group name or role name is
specified
Name of the group to create
Create a Group
IOException
– if the operation fails
Ignored.
This method was specified in error and must not be used.
IOException
– This method will throw an exception if called.
This method was specified in error. It does not function and must not be used. Use either createUser(String) or createGroup(String).
Name of the user to create
Create a User
IOException
– if the operation fails
The user name
Answer the authorization for the user name. The Composite Data is typed by AUTORIZATION_TYPE.
the Authorization typed by AUTORIZATION_TYPE.
IOException
– if the operation fails
IllegalArgumentException
– if the user name is not a User
The user name
Answer the credentials associated with a user. The returned Tabular Data is typed by JmxConstants.PROPERTIES_TYPE.
the credentials associated with the user, see JmxConstants.PROPERTIES_TYPE
IOException
– if the operation fails
IllegalArgumentException
– if the user name is not a User
The group name
Answer the Group associated with the group name. The returned Composite Data is typed by GROUP_TYPE
the Group, see GROUP_TYPE
IOException
– if the operation fails
IllegalArgumentException
– if the group name is not a Group
The filter to apply
Answer the list of group names
The list of group names
IOException
– if the operation fails
The name of the user that has the implied roles
Answer the list of implied roles for a user
The list of role names
IOException
– if the operation fails
IllegalArgumentException
– if the username is not a User
The name of the group to get the members from
Answer the the user names which are members of the group
The list of user names
IOException
– if the operation fails
IllegalArgumentException
– if the groupname is not a Group
The name of the role to get properties from
Answer the properties associated with a role. The returned Tabular Data is typed by JmxConstants.PROPERTIES_TYPE.
the properties associated with the role, see JmxConstants.PROPERTIES_TYPE
IOException
– if the operation fails
IllegalArgumentException
– if the rolename is not a role
The name of the group to get the required members from
Answer the list of user names which are required members of this group
The list of user names
IOException
– if the operation fails
IllegalArgumentException
– if the group name is not a Group
The name of the role to get the data from
Answer the role associated with a name. The returned Composite Data is typed by ROLE_TYPE.
the Role, see ROLE_TYPE
IOException
– if the operation fails
IllegalArgumentException
– if the name is not a role
The string representation of the
org.osgi.framework.Filter
that is used to filter the roles
by applying to the properties, if null
all roles are
returned.
Answer the list of role names which match the supplied filter
The list the role names
IOException
– if the operation fails
The name of the requested user
Answer the User associated with the user name. The returned Composite Data is typed by USER_TYPE.
The User, see USER_TYPE
IOException
– if the operation fails
IllegalArgumentException
– if the username is not a User
The filter to apply
Answer the list of user names in the User Admin database
The list of user names
IOException
– if the operation fails
The key to compare
The value to compare
Answer the user name with the given property key-value pair from the User Admin service database.
The User
IOException
– if the operation fails
Answer the list of group names
The list of group names
IOException
– if the operation fails
Answer the list of role names in the User Admin database
The list of role names
IOException
– if the operation fails
Answer the list of user names in the User Admin database
The list of user names
IOException
– if the operation fails
The key of the credential to remove
The name of the user for which the credential must be removed
Remove the credential associated with the given user
IOException
– if the operation fails
IllegalArgumentException
– if the username is not a User
Remove the Group associated with the name
true if the remove succeeded
IOException
– if the operation fails
IllegalArgumentException
– if the name is not a Group
The group name
Remove a role from the group
true if the role was removed from the group
IOException
– if the operation fails
IllegalArgumentException
– if the groupname is not a Group
Remove a property from a role
IOException
– if the operation fails
IllegalArgumentException
– if the rolename is not a role
Remove the Role associated with the name
true if the remove succeeded
IOException
– if the operation fails
IllegalArgumentException
– if the name is not a role
OSGi JMX Framework Wiring Package Version 1.1.
Bundles wishing to use this package must list the package in the Import-Package header of the bundle's manifest. This package has two types of users: the consumers that use the API in this package and the providers that implement the API in this package.
Example import for consumers using the API in this package:
Import-Package: org.osgi.jmx.framework.wiring; version="[1.1,2.0)"
Example import for providers implementing the API in this package:
Import-Package: org.osgi.jmx.framework.wiring; version="[1.1,1.2)"
-
BundleWiringStateMBean
- This MBean represents the bundle wiring state.
This MBean represents the bundle wiring state.
It can be used to retrieve the declared capabilities, declared requirements, and wiring for the current and past revisions of bundles.
Thread-safe
The key of ATTRIBUTES_ITEM.
The item containing the attributes of a capability or requirement. Used in BUNDLE_REQUIREMENT_TYPE and BUNDLE_CAPABILITY_TYPE. The key is ATTRIBUTES and the type is ATTRIBUTES_TYPE.
The Tabular Type that holds the attributes for a capability or requirements. The row type is JmxConstants.PROPERTY_TYPE and the index is JmxConstants.KEY.
The key of BUNDLE_CAPABILITY_ITEM.
The item containing a capability for a bundle in BUNDLE_WIRE_TYPE. The key is BUNDLE_CAPABILITY and the type is BUNDLE_CAPABILITY_TYPE.
The Composite Type that represents the capability of a bundle. The composite consists of:
The key of BUNDLE_ID_ITEM.
The item containing a bundle ID. They key is BUNDLE_ID and the type is a long.
The key of BUNDLE_REQUIREMENT_ITEM.
The item containing a requirement for a bundle in BUNDLE_WIRE_TYPE. The key is BUNDLE_REQUIREMENT and the type is BUNDLE_REQUIREMENT_TYPE.
The Composite Type that represents the requirement of a bundle. The composite consists of:
The key of BUNDLE_REVISION_ID_ITEM.
The item containing a bundle revision ID. A bundle revision ID is always local to the result of a JMX invocation and do not have a defined meaning across invocation calls. They are used where a result can potentially contain multiple revisions of the same bundle. The key is BUNDLE_REVISION_ID and the type is an integer.
The Composite type that represents a bundle wire describing the live association between a provider of a capability and a requirer of the corresponding requirement.
The composite consists of:
An array of BUNDLE_WIRE_TYPEs.
The Composite Type that represents a bundle wiring. The composite consists of:
The Tabular Type to hold the wiring of a number of bundles. The row type is BUNDLE_WIRING_TYPE and the index is the combination of the BUNDLE_ID and the BUNDLE_REVISION_ID.
The key of CAPABILITIES_ITEM.
The item containing the capabilities in REVISION_CAPABILITIES_TYPE and BUNDLE_WIRING_TYPE. The key is CAPABILITIES and the type is CAPABILITY_TYPE_ARRAY.
An array of BUNDLE_CAPABILITY_TYPEs.
The Composite Type that represents a directive for a capability or requirement. The composite consists of:
The key of DIRECTIVES_ITEM.
The item containing the directives of a capability or requirement. Used in BUNDLE_REQUIREMENT_TYPE and BUNDLE_CAPABILITY_TYPE. The key is DIRECTIVES and the type is DIRECTIVES_TYPE.
The Tabular Type that holds the directives for a capability or requirement. The row type is DIRECTIVE_TYPE and the index is KEY.
The key of KEY_ITEM.
The item containing the key of a capability or requirement directive. Used in DIRECTIVE_TYPE. The key is KEY and the type is a String.
The key of NAMESPACE_ITEM.
The item containing the namespace for a capability or requirement. Used in BUNDLE_REQUIREMENT_TYPE and BUNDLE_CAPABILITY_TYPE. The key is NAMESPACE and the type is a String.
The Object Name prefix for this mbean. The full object name also contains the framework name and uuid as properties.
The key of PROVIDED_WIRES_ITEM.
The item containing the provided wires in BUNDLE_WIRING_TYPE. The key is PROVIDED_WIRES and the type is BUNDLE_WIRES_TYPE_ARRAY.
The key of PROVIDER_BUNDLE_ID_ITEM.
The item containing the provider bundle ID in BUNDLE_WIRE_TYPE. The key is PROVIDER_BUNDLE_ID and the type is a long.
The key of PROVIDER_BUNDLE_REVISION_ID_ITEM.
The local ID of a provider revision in BUNDLE_WIRE_TYPE. This ID is local to the result where it resides and has no defined meaning across multiple invocations. The key is PROVIDER_BUNDLE_REVISION_ID and the type is an int.
The key of REQUIRED_WIRES_ITEM.
The item containing the required wires in BUNDLE_WIRING_TYPE. The key is REQUIRED_WIRES and the type is BUNDLE_WIRES_TYPE_ARRAY.
An array of BUNDLE_REQUIREMENT_TYPEs.
The key of REQUIREMENTS_ITEM.
The item containing the requirements in REVISION_REQUIREMENTS_TYPE and BUNDLE_WIRING_TYPE. The key is REQUIREMENTS and the type is REQUIREMENT_TYPE_ARRAY.
The key of REQUIRER_BUNDLE_ID_ITEM.
The item containing the requirer bundle ID in BUNDLE_WIRE_TYPE. The key is REQUIRER_BUNDLE_ID and the type is long.
The key of REQUIRER_BUNDLE_REVISION_ID_ITEM.
The local ID of a requirer revision in BUNDLE_WIRE_TYPE. This ID is local to the result where it resides and has no defined meaning across multiple invocations. The key is REQUIRER_BUNDLE_REVISION_ID and the type is an int.
The Composite Type that represents the capabilities for a revision. The composite consists of:
The Composite Type that represents the requirements of a revision. The composite consists of:
The Tabular Type that holds the capabilities of a revision. The row type is REVISION_CAPABILITIES_TYPE and the index is BUNDLE_REVISION_ID.
The Tabular Type that hold the requirements of a revision. The row type is REVISION_REQUIREMENTS_TYPE and the index is BUNDLE_REVISION_ID.
The key of VALUE.
The item containing the value of a capability or requirement directive. Used in DIRECTIVE_TYPE. They key is VALUE and the type is a String.
The bundle ID.
The namespace of the capabilities to be returned by this operation.
Returns the capabilities for the current bundle revision.
the declared capabilities for the current revision of
bundleId
and namespace
.
JMException
– if there is a JMX problem.
IOException
– if the connection could not be made because of a
communication problem.
The bundle ID.
The namespace of the requirements to be returned by this operation.
Returns the requirements for the current bundle revision.
the declared requirements for the current revision of
bundleId
and namespace
.
JMException
– if there is a JMX problem.
IOException
– if the connection could not be made because of a
communication problem.
The bundle ID.
The namespace of the requirements and capabilities for which to return information.
Returns the bundle wiring for the current bundle revision.
the wiring information for the current revision of
bundleId
and namespace
.
JMException
– if there is a JMX problem.
IOException
– if the connection could not be made because of a
communication problem.
the root bundle of the closure.
The namespace of the requirements and capabilities for which to return information.
Returns the bundle wiring closure for the current revision of the specified bundle. The wiring closure contains all the wirings from the root bundle revision to all bundle revisions it is wired to and all their transitive wirings.
a tabular representation of all the wirings in the closure. The bundle revision IDs only have meaning in the context of the current result. The revision of the rootBundle is set to 0. Therefore the root bundle of the closure can be looked up in the table by its bundle ID and revision 0.
JMException
– if there is a JMX problem.
IOException
– if the connection could not be made because of a
communication problem.
The bundle ID.
The namespace of the capabilities to be returned by this operation.
Returns the capabilities for all revisions of the bundle.
the declared capabilities for all revisions of bundleId
JMException
– if there is a JMX problem.
IOException
– if the connection could not be made because of a
communication problem.
The bundle ID.
The namespace of the requirements to be returned by this operation.
Returns the requirements for all revisions of the bundle.
the declared requirements for all revisions of bundleId
.
JMException
– if there is a JMX problem.
IOException
– if the connection could not be made because of a
communication problem.
The bundle ID.
The namespace of the requirements and capabilities for which to return information.
Returns the bundle wirings for all revisions of the bundle.
the wiring information for all revisions of bundleId
and
namespace
.
JMException
– if there is a JMX problem.
IOException
– if the connection could not be made because of a
communication problem.
The root bundle ID.
The namespace of the requirements and capabilities for which to return information.
Returns the bundle wiring closure for all revisions of the specified bundle. The wiring closure contains all the wirings from the root bundle revision to all bundle revisions it is wired to and all their transitive wirings.
a tabular representation of all the wirings in the closure. The bundle revision IDs only have meaning in the context of the current result.
JMException
– if there is a JMX problem.
IOException
– if the connection could not be made because of a
communication problem.
[2]Java Management Extensions (JMX) Technology Overviewhttp://docs.oracle.com/javase/1.5.0/docs/guide/jmx/overview/JMXoverviewTOC.html
[3]JSR 3: Java Management Extensions (JMX) Specificationhttp://www.jcp.org/en/jsr/detailid=3
[4]JSR 255: Java Management Extensions (JMX) Specification, version 2.0http://www.jcp.org/en/jsr/detailid=255
[5]JSR 160: JavaTM Management Extensions (JMX) Remote APIhttp://www.jcp.org/en/jsr/detailid=160
[6]JSR 262: Web Services Connector for Java Management Extensions (JMX) Agentshttp://www.jcp.org/en/jsr/detailid=262
[7]JavaTM Management Extensions (JMXTM)API Specificationhttp://docs.oracle.com/javase/1.5.0/docs/guide/jmx/spec.html
[8]Using JConsole to Monitor Applicationshttp://java.sun.com/developer/technicalArticles/J2SE/jconsole.html