OSGi™ Enterprise
Release 5

org.osgi.jmx.framework
Interface ServiceStateMBean


public interface ServiceStateMBean

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.

ThreadSafe

Field Summary
static java.lang.String BUNDLE_IDENTIFIER
          The key BUNDLE_IDENTIFIER, used in BUNDLE_IDENTIFIER_ITEM.
static Item BUNDLE_IDENTIFIER_ITEM
          The item containing the bundle identifier in SERVICE_TYPE.
static java.lang.String BUNDLE_LOCATION
          The key BUNDLE_LOCATION, used in SERVICE_EVENT_TYPE.
static Item BUNDLE_LOCATION_ITEM
          The item containing the bundle location in EVENT_ITEM.
static java.lang.String BUNDLE_SYMBOLIC_NAME
          The key BUNDLE_SYMBOLIC_NAME, used in SERVICE_EVENT_TYPE.
static Item BUNDLE_SYMBOLIC_NAME_ITEM
          The item containing the symbolic name in EVENT.
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 IDENTIFIER
          The key IDENTIFIER, used IDENTIFIER_ITEM.
static Item IDENTIFIER_ITEM
          The item containing the service identifier in SERVICE_TYPE.
static java.lang.String OBJECT_CLASS
          The key OBJECT_CLASS, used OBJECT_CLASS_ITEM.
static Item OBJECT_CLASS_ITEM
          The item containing the interfaces of the service in SERVICE_TYPE.
static java.lang.String OBJECTNAME
          The Object Name prefix for this mbean.
static java.lang.String PROPERTIES
          The key PROPERTIES, used in PROPERTIES_ITEM.
static Item PROPERTIES_ITEM
          The item containing service properties in SERVICE_TYPE.
static javax.management.openmbean.CompositeType SERVICE_EVENT_TYPE
          The Composite Type that represents a service event.
static javax.management.openmbean.CompositeType SERVICE_TYPE
          The Composite Type for a CompositeData representing a service.
static javax.management.openmbean.TabularType SERVICES_TYPE
          The Tabular Type for a Service table.
static java.lang.String USING_BUNDLES
          The key USING_BUNDLES, used in USING_BUNDLES_ITEM.
static Item USING_BUNDLES_ITEM
          The item containing the bundles using the service in SERVICE_TYPE.
 
Method Summary
 long getBundleIdentifier(long serviceId)
          Answer the bundle identifier of the bundle which registered the service
 java.lang.String[] getObjectClass(long serviceId)
          Answer the list of interfaces that this service implements
 javax.management.openmbean.TabularData getProperties(long serviceId)
          Answer the map of properties associated with this service.
 javax.management.openmbean.CompositeData getProperty(long serviceId, java.lang.String key)
          Return a single property from the specified service.
 javax.management.openmbean.CompositeData getService(long serviceId)
          Obtain information about a given service.
 long[] getServiceIds()
          List all service IDs in the framework.
 long[] getUsingBundles(long serviceId)
          Answer the list of identifiers of the bundles that use the service
 javax.management.openmbean.TabularData listServices()
          Answer the service state of the system in tabular form.
 javax.management.openmbean.TabularData listServices(java.lang.String clazz, java.lang.String filter)
          Answer the service state of the system in tabular form.
 javax.management.openmbean.TabularData listServices(java.lang.String clazz, java.lang.String filter, java.lang.String... serviceTypeItems)
          Answer the service 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

BUNDLE_IDENTIFIER

static final java.lang.String BUNDLE_IDENTIFIER
The key BUNDLE_IDENTIFIER, used in BUNDLE_IDENTIFIER_ITEM.

See Also:
Constant Field Values

BUNDLE_IDENTIFIER_ITEM

static final Item BUNDLE_IDENTIFIER_ITEM
The item containing the bundle identifier in SERVICE_TYPE. The key is BUNDLE_IDENTIFIER and the type is SimpleType.LONG .


OBJECT_CLASS

static final java.lang.String OBJECT_CLASS
The key OBJECT_CLASS, used OBJECT_CLASS_ITEM.

See Also:
Constant Field Values

OBJECT_CLASS_ITEM

static final Item 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.


IDENTIFIER

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

See Also:
Constant Field Values

IDENTIFIER_ITEM

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


PROPERTIES

static final java.lang.String PROPERTIES
The key PROPERTIES, used in PROPERTIES_ITEM.

See Also:
Constant Field Values

PROPERTIES_ITEM

static final Item PROPERTIES_ITEM
The item containing service properties in SERVICE_TYPE. The key is PROPERTIES and the type is JmxConstants.PROPERTIES_TYPE.


USING_BUNDLES

static final java.lang.String USING_BUNDLES
The key USING_BUNDLES, used in USING_BUNDLES_ITEM.

See Also:
Constant Field Values

USING_BUNDLES_ITEM

static final Item 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.


SERVICE_TYPE

static final javax.management.openmbean.CompositeType SERVICE_TYPE
The Composite Type for a CompositeData representing a service. This type consists of:


SERVICES_TYPE

static final javax.management.openmbean.TabularType SERVICES_TYPE
The Tabular Type for a Service table. The rows consists of SERVICE_TYPE Composite Data and the index is IDENTIFIER .


BUNDLE_LOCATION

static final java.lang.String BUNDLE_LOCATION
The key BUNDLE_LOCATION, used in SERVICE_EVENT_TYPE.

See Also:
Constant Field Values

BUNDLE_LOCATION_ITEM

static final Item BUNDLE_LOCATION_ITEM
The item containing the bundle location in EVENT_ITEM. The key is BUNDLE_LOCATION and the the type is SimpleType.STRING .


BUNDLE_SYMBOLIC_NAME

static final java.lang.String BUNDLE_SYMBOLIC_NAME
The key BUNDLE_SYMBOLIC_NAME, used in SERVICE_EVENT_TYPE.

See Also:
Constant Field Values

BUNDLE_SYMBOLIC_NAME_ITEM

static final Item BUNDLE_SYMBOLIC_NAME_ITEM
The item containing the symbolic name in EVENT. The key is BUNDLE_SYMBOLIC_NAME and the the type is SimpleType.STRING.


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


SERVICE_EVENT_TYPE

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

Method Detail

getObjectClass

java.lang.String[] getObjectClass(long serviceId)
                                  throws java.io.IOException
Answer the list of interfaces that this service implements

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

getBundleIdentifier

long getBundleIdentifier(long serviceId)
                         throws java.io.IOException
Answer the bundle identifier of the bundle which registered the service

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

getService

javax.management.openmbean.CompositeData getService(long serviceId)
                                                    throws java.io.IOException
Obtain information about a given service. The result is defined by the CompositeType SERVICE_TYPE.

Parameters:
serviceId - the ID of the service to look up
Returns:
A CompositeData object with the service information
Throws:
java.io.IOException - if the operation fails
java.lang.IllegalArgumentException - if the service indicated does not exist

getProperties

javax.management.openmbean.TabularData getProperties(long serviceId)
                                                     throws java.io.IOException
Answer the map of properties associated with this service.

Parameters:
serviceId - the identifier of the service
Returns:
the table of properties. These include the standard mandatory service.id and objectClass properties as defined in the org.osgi.framework.Constants interface
Throws:
java.io.IOException - if the operation fails
java.lang.IllegalArgumentException - if the service indicated does not exist
See Also:
for the details of the TabularType

getProperty

javax.management.openmbean.CompositeData getProperty(long serviceId,
                                                     java.lang.String key)
                                                     throws java.io.IOException
Return a single property from the specified service.

Parameters:
serviceId - the identifier of the service
key - the property key
Returns:
a CompositeData object holding the value and data type of the property.
Throws:
java.io.IOException - if the operation fails
See Also:
for the details of the CompositeType.

getServiceIds

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

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

listServices

javax.management.openmbean.TabularData listServices()
                                                    throws java.io.IOException
Answer the service state of the system in tabular form.

Returns:
the tabular representation of the service state
Throws:
java.io.IOException - If the operation fails
java.lang.IllegalArgumentException - if the service indicated does not exist
See Also:
for the details of the TabularType

listServices

javax.management.openmbean.TabularData listServices(java.lang.String clazz,
                                                    java.lang.String filter)
                                                    throws java.io.IOException
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.

Parameters:
clazz - The class name with which the services were registered or null for any class name.
filter - A filter expression to match the services or null for no additional filter.
Returns:
the tabular representation of the service state
Throws:
java.io.IOException - If the operation fails
java.lang.IllegalArgumentException - if the service indicated does not exist
See Also:
for the details of the TabularType

listServices

javax.management.openmbean.TabularData listServices(java.lang.String clazz,
                                                    java.lang.String filter,
                                                    java.lang.String... serviceTypeItems)
                                                    throws java.io.IOException
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.

Parameters:
clazz - The class name with which the services were registered or null for any class name.
filter - A filter expression to match the services or null for no additional filter.
serviceTypeItems - 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.
Returns:
the tabular representation of the service state
Throws:
java.io.IOException - If the operation fails
java.lang.IllegalArgumentException - if the service indicated does not exist
See Also:
for the details of the TabularType

getUsingBundles

long[] getUsingBundles(long serviceId)
                       throws java.io.IOException
Answer the list of identifiers of the bundles that use the service

Parameters:
serviceId - the identifier of the service
Returns:
the list of bundle identifiers
Throws:
java.io.IOException - if the operation fails
java.lang.IllegalArgumentException - if the service 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