org.osgi.jmx.codec
Class OSGiService

java.lang.Object
  extended by org.osgi.jmx.codec.OSGiService

public class OSGiService
extends java.lang.Object

Author:
Hal Hildebrand Date: Nov 24, 2008 Time: 7:05:14 AM

This class represents the CODEC for the composite data representing an OSGi ServiceReference

It serves as both the documentation of the type structure and as the codification of the mechanism to convert to/from the CompositeData.

The structure of the composite data is:

Identifier String
ObjectClass Array of String
BundleIdentifier long
UsingBundles Array of long

Field Summary
static javax.management.openmbean.CompositeType SERVICE
          The CompositeType representation of the service
static javax.management.openmbean.TabularType SERVICE_TABLE
          The TabularType representation of a list of services
 
Constructor Summary
OSGiService(javax.management.openmbean.CompositeData data)
          Construct an OSGiService encoded in the CompositeData
OSGiService(long identifier, java.lang.String[] interfaces, long bundle, long[] usingBundles)
          Construct an OSGiService
OSGiService(org.osgi.framework.ServiceReference reference)
          Construct an OSGiService from the underlying ServiceReference
 
Method Summary
 javax.management.openmbean.CompositeData asCompositeData()
          Answer the receiver encoded as CompositeData
 long getBundle()
           
 long getIdentifier()
           
 java.lang.String[] getInterfaces()
           
 long[] getUsingBundles()
           
static javax.management.openmbean.TabularData tableFrom(java.util.ArrayList<OSGiService> services)
          Construct the TabularData representing a list of services
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SERVICE

public static final javax.management.openmbean.CompositeType SERVICE
The CompositeType representation of the service


SERVICE_TABLE

public static final javax.management.openmbean.TabularType SERVICE_TABLE
The TabularType representation of a list of services

Constructor Detail

OSGiService

public OSGiService(javax.management.openmbean.CompositeData data)
Construct an OSGiService encoded in the CompositeData

Parameters:
data - - the CompositeData encoding the OSGiService

OSGiService

public OSGiService(long identifier,
                   java.lang.String[] interfaces,
                   long bundle,
                   long[] usingBundles)
Construct an OSGiService

Parameters:
identifier -
interfaces -
bundle -
usingBundles -

OSGiService

public OSGiService(org.osgi.framework.ServiceReference reference)
Construct an OSGiService from the underlying ServiceReference

Parameters:
reference - - the reference of the service
Method Detail

tableFrom

public static javax.management.openmbean.TabularData tableFrom(java.util.ArrayList<OSGiService> services)
Construct the TabularData representing a list of services

Parameters:
services - - the list of services
Returns:
the TabularData representing the list of OSGiServices

asCompositeData

public javax.management.openmbean.CompositeData asCompositeData()
Answer the receiver encoded as CompositeData

Returns:
the CompositeData encoding of the receiver.

getBundle

public long getBundle()
Returns:
the identifier of the bundle the service belongs to

getIdentifier

public long getIdentifier()
Returns:
the identifier of the service

getInterfaces

public java.lang.String[] getInterfaces()
Returns:
the interfaces implemented by the service

getUsingBundles

public long[] getUsingBundles()
Returns:
the identifiers of the bundles which are using the service


Copyright © 2009. All Rights Reserved.