org.osgi.jmx.codec
Class OSGiServiceEvent

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

public class OSGiServiceEvent
extends java.lang.Object

Author:
Hal Hildebrand Date: Nov 24, 2008 Time: 2:42:48 PM

This class represents the CODEC for the composite data representing a OSGi ServiceEvent

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
BundleIdentifier long
BundleLocation String
ObjectClass Array of String
EventType int

Field Summary
static javax.management.openmbean.CompositeType SERVICE_EVENT
          The CompositeType representation of the OSGiServiceEvent
 
Constructor Summary
OSGiServiceEvent(javax.management.openmbean.CompositeData data)
          Construct an OSGiServiceEvent from the CompositeData representing the event
OSGiServiceEvent(long serviceId, long bundleId, java.lang.String location, java.lang.String[] interfaces, int eventType)
          Construct and OSGiServiceEvent
OSGiServiceEvent(org.osgi.framework.ServiceEvent event)
           
 
Method Summary
 javax.management.openmbean.CompositeData asCompositeData()
          Answer the receiver encoded as CompositeData
 long getBundleId()
           
 int getEventType()
           
 java.lang.String[] getInterfaces()
           
 java.lang.String getLocation()
           
 long getServiceId()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SERVICE_EVENT

public static final javax.management.openmbean.CompositeType SERVICE_EVENT
The CompositeType representation of the OSGiServiceEvent

Constructor Detail

OSGiServiceEvent

public OSGiServiceEvent(javax.management.openmbean.CompositeData data)
Construct an OSGiServiceEvent from the CompositeData representing the event

Parameters:
data - = the CompositeData representation of the event

OSGiServiceEvent

public OSGiServiceEvent(long serviceId,
                        long bundleId,
                        java.lang.String location,
                        java.lang.String[] interfaces,
                        int eventType)
Construct and OSGiServiceEvent

Parameters:
serviceId -
bundleId -
location -
interfaces -
eventType -

OSGiServiceEvent

public OSGiServiceEvent(org.osgi.framework.ServiceEvent event)
Method Detail

asCompositeData

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

Returns:
the CompositeData encoding of the receiver.

getBundleId

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

getEventType

public int getEventType()
Returns:
the type of the event

getInterfaces

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

getLocation

public java.lang.String getLocation()
Returns:
the location of the bundle the service belongs to

getServiceId

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


Copyright © 2009. All Rights Reserved.