org.apache.aries.jmx.framework
Class ServiceState

java.lang.Object
  extended by javax.management.NotificationBroadcasterSupport
      extended by org.apache.aries.jmx.framework.ServiceState
All Implemented Interfaces:
MBeanRegistration, NotificationBroadcaster, NotificationEmitter, ServiceStateMBean

public class ServiceState
extends NotificationBroadcasterSupport
implements ServiceStateMBean, MBeanRegistration

Implementation of ServiceStateMBean which emits JMX Notification for framework ServiceEvent events

Version:
$Rev: 943553 $ $Date: 2010-05-12 16:29:16 +0100 (Wed, 12 May 2010) $

Field Summary
protected  ExecutorService eventDispatcher
           
protected  Logger logger
           
static String SERVICE_EVENT
           
protected  org.osgi.framework.AllServiceListener serviceListener
           
 
Fields inherited from interface org.osgi.jmx.framework.ServiceStateMBean
BUNDLE_IDENTIFIER, BUNDLE_IDENTIFIER_ITEM, BUNDLE_LOCATION, BUNDLE_LOCATION_ITEM, BUNDLE_SYMBOLIC_NAME, BUNDLE_SYMBOLIC_NAME_ITEM, EVENT, EVENT_ITEM, IDENTIFIER, IDENTIFIER_ITEM, OBJECT_CLASS, OBJECT_CLASS_ITEM, OBJECTNAME, SERVICE_EVENT_TYPE, SERVICE_TYPE, SERVICES_TYPE, USING_BUNDLES, USING_BUNDLES_ITEM
 
Constructor Summary
ServiceState(org.osgi.framework.BundleContext bundleContext, Logger logger)
           
 
Method Summary
 long getBundleIdentifier(long serviceId)
           
protected  ExecutorService getEventDispatcher()
           
 MBeanNotificationInfo[] getNotificationInfo()
           
 String[] getObjectClass(long serviceId)
           
 TabularData getProperties(long serviceId)
           
 long[] getUsingBundles(long serviceId)
           
 TabularData listServices()
           
 void postDeregister()
           
 void postRegister(Boolean registrationDone)
           
 void preDeregister()
           
 ObjectName preRegister(MBeanServer server, ObjectName name)
           
protected  void shutDownDispatcher()
           
 
Methods inherited from class javax.management.NotificationBroadcasterSupport
addNotificationListener, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected Logger logger

eventDispatcher

protected ExecutorService eventDispatcher

serviceListener

protected org.osgi.framework.AllServiceListener serviceListener

SERVICE_EVENT

public static String SERVICE_EVENT
Constructor Detail

ServiceState

public ServiceState(org.osgi.framework.BundleContext bundleContext,
                    Logger logger)
Method Detail

getBundleIdentifier

public long getBundleIdentifier(long serviceId)
                         throws IOException
Specified by:
getBundleIdentifier in interface ServiceStateMBean
Throws:
IOException
See Also:
ServiceStateMBean.getBundleIdentifier(long)

getObjectClass

public String[] getObjectClass(long serviceId)
                        throws IOException
Specified by:
getObjectClass in interface ServiceStateMBean
Throws:
IOException
See Also:
ServiceStateMBean.getObjectClass(long)

getProperties

public TabularData getProperties(long serviceId)
                          throws IOException
Specified by:
getProperties in interface ServiceStateMBean
Throws:
IOException
See Also:
ServiceStateMBean.getProperties(long)

getUsingBundles

public long[] getUsingBundles(long serviceId)
                       throws IOException
Specified by:
getUsingBundles in interface ServiceStateMBean
Throws:
IOException
See Also:
ServiceStateMBean.getUsingBundles(long)

listServices

public TabularData listServices()
                         throws IOException
Specified by:
listServices in interface ServiceStateMBean
Throws:
IOException
See Also:
ServiceStateMBean.listServices()

getNotificationInfo

public MBeanNotificationInfo[] getNotificationInfo()
Specified by:
getNotificationInfo in interface NotificationBroadcaster
Overrides:
getNotificationInfo in class NotificationBroadcasterSupport
See Also:
NotificationBroadcasterSupport.getNotificationInfo()

postDeregister

public void postDeregister()
Specified by:
postDeregister in interface MBeanRegistration
See Also:
MBeanRegistration.postDeregister()

postRegister

public void postRegister(Boolean registrationDone)
Specified by:
postRegister in interface MBeanRegistration
See Also:
MBeanRegistration.postRegister(java.lang.Boolean)

preDeregister

public void preDeregister()
                   throws Exception
Specified by:
preDeregister in interface MBeanRegistration
Throws:
Exception

preRegister

public ObjectName preRegister(MBeanServer server,
                              ObjectName name)
                       throws Exception
Specified by:
preRegister in interface MBeanRegistration
Throws:
Exception
See Also:
MBeanRegistration.preRegister(javax.management.MBeanServer, javax.management.ObjectName)

shutDownDispatcher

protected void shutDownDispatcher()

getEventDispatcher

protected ExecutorService getEventDispatcher()


Copyright © 2009-2011 The Apache Software Foundation. All Rights Reserved.