org.osgi.jmx.core
Interface ServiceStateMBean


public interface ServiceStateMBean

Author:
Hal Hildebrand Date: Sep 23, 2008 Time: 8:57:33 AM

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.

See OSGiBundleEvent for the precise definition of the CompositeData for the notification sent.


Field Summary
static java.lang.String BUNDLE_IDENTIFIER
          The name of the item containing the bundle identifier in the CompositeData
static java.lang.String BUNDLE_LOCATION
          The name of the item containing the bundle location in the CompositeData
static java.lang.String EVENT_TYPE
          The name of the item containing the event type in the CompositeData
static java.lang.String OBJECT_CLASS
          The name of the item containing the interfaces of the service in the CompositeData
static java.lang.String[] SERVICE
          The item names in the CompositeData representing the service
static java.lang.String[] SERVICE_EVENT
          The item names in the CompositeData representing the ServiceEvent
static java.lang.String SERVICE_EVENT_TYPE
          The type of the JMX event raised in response to ServiceEvent in the underlying OSGi container
static java.lang.String SERVICE_ID
          The name of the item containing the service identifier in the CompositeData
static java.lang.String USING_BUNDLES
          The name of the item containing the bundles using the service in the CompositeData
 
Method Summary
 long getBundle(long serviceId)
          Answer the bundle identifier of the bundle which registered the service
 javax.management.openmbean.TabularData getProperties(long serviceId)
          Answer the map of credentials associated with this service
 java.lang.String[] getServiceInterfaces(long serviceId)
          Answer the list of interfaces that this service implements
 javax.management.openmbean.TabularData getServices()
          Answer the service state of the system in tabular form
 long[] getUsingBundles(long serviceId)
          Answer the list of identifers of the bundles that use the service
 

Field Detail

BUNDLE_IDENTIFIER

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

See Also:
Constant Field Values

BUNDLE_LOCATION

static final java.lang.String BUNDLE_LOCATION
The name of the item containing the bundle location in the CompositeData

See Also:
Constant Field Values

EVENT_TYPE

static final java.lang.String EVENT_TYPE
The name of the item containing the event type in the CompositeData

See Also:
Constant Field Values

OBJECT_CLASS

static final java.lang.String OBJECT_CLASS
The name of the item containing the interfaces of the service in the CompositeData

See Also:
Constant Field Values

SERVICE_EVENT_TYPE

static final java.lang.String SERVICE_EVENT_TYPE
The type of the JMX event raised in response to ServiceEvent in the underlying OSGi container

See Also:
Constant Field Values

SERVICE_ID

static final java.lang.String SERVICE_ID
The name of the item containing the service identifier in the CompositeData

See Also:
Constant Field Values

USING_BUNDLES

static final java.lang.String USING_BUNDLES
The name of the item containing the bundles using the service in the CompositeData

See Also:
Constant Field Values

SERVICE

static final java.lang.String[] SERVICE
The item names in the CompositeData representing the service


SERVICE_EVENT

static final java.lang.String[] SERVICE_EVENT
The item names in the CompositeData representing the ServiceEvent

Method Detail

getServiceInterfaces

java.lang.String[] getServiceInterfaces(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

getBundle

long getBundle(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

getProperties

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

Parameters:
serviceId - - the identifier of the service
Returns:
the table of credentials. These include the standard mandatory service.id and objectClass credentials 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

For each propery entry, the following row is returned

  • Property Key - the string key
  • Property Value - the stringified version of the property value
  • Property Value Type - the type of the property value

getServices

javax.management.openmbean.TabularData getServices()
Answer the service state of the system in tabular form

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

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

  • identifier - long
  • interfaces - String[]
  • bundle - long
  • using bundles - long[]

See OSGiService for the precise definition of the CompositeType that defines each row of the table.


getUsingBundles

long[] getUsingBundles(long serviceId)
                       throws java.io.IOException
Answer the list of identifers 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


Copyright © 2009. All Rights Reserved.