org.apache.aries.jmx.framework
Class BundleState

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

public class BundleState
extends NotificationBroadcasterSupport
implements BundleStateMBean, MBeanRegistration

Implementation of BundleStateMBean which emits JMX Notification on Bundle state changes

Version:
$Rev: 931474 $ $Date: 2010-04-07 10:20:32 +0100 (Wed, 07 Apr 2010) $

Field Summary
static String BUNDLE_EVENT
           
protected  org.osgi.framework.BundleContext bundleContext
           
protected  org.osgi.framework.BundleListener bundleListener
           
protected  ExecutorService eventDispatcher
           
protected  Logger logger
           
protected  org.osgi.service.packageadmin.PackageAdmin packageAdmin
           
protected  org.osgi.service.startlevel.StartLevel startLevel
           
 
Fields inherited from interface org.osgi.jmx.framework.BundleStateMBean
ACTIVE, BUNDLE_EVENT_TYPE, BUNDLE_TYPE, BUNDLES_TYPE, EVENT, EVENT_ITEM, EXPORTED_PACKAGES, EXPORTED_PACKAGES_ITEM, FRAGMENT, FRAGMENT_ITEM, FRAGMENTS, FRAGMENTS_ITEM, HEADER_TYPE, HEADERS, HEADERS_ITEM, HEADERS_TYPE, HOSTS, HOSTS_ITEM, IDENTIFIER, IDENTIFIER_ITEM, IMPORTED_PACKAGES, IMPORTED_PACKAGES_ITEM, INSTALLED, KEY, KEY_ITEM, LAST_MODIFIED, LAST_MODIFIED_ITEM, LOCATION, LOCATION_ITEM, OBJECTNAME, PERSISTENTLY_STARTED, PERSISTENTLY_STARTED_ITEM, REGISTERED_SERVICES, REGISTERED_SERVICES_ITEM, REMOVAL_PENDING, REMOVAL_PENDING_ITEM, REQUIRED, REQUIRED_BUNDLES, REQUIRED_BUNDLES_ITEM, REQUIRED_ITEM, REQUIRING_BUNDLES, REQUIRING_BUNDLES_ITEM, RESOLVED, SERVICES_IN_USE, SERVICES_IN_USE_ITEM, START_LEVEL, START_LEVEL_ITEM, STARTING, STATE, STATE_ITEM, STOPPING, SYMBOLIC_NAME, SYMBOLIC_NAME_ITEM, UNINSTALLED, UNKNOWN, VALUE, VALUE_ITEM, VERSION, VERSION_ITEM
 
Constructor Summary
BundleState(org.osgi.framework.BundleContext bundleContext, org.osgi.service.packageadmin.PackageAdmin packageAdmin, org.osgi.service.startlevel.StartLevel startLevel, Logger logger)
           
 
Method Summary
protected  ExecutorService getEventDispatcher()
           
 String[] getExportedPackages(long bundleId)
           
 long[] getFragments(long bundleId)
           
 TabularData getHeaders(long bundleId)
           
 long[] getHosts(long fragmentId)
           
 String[] getImportedPackages(long bundleId)
           
 long getLastModified(long bundleId)
           
 String getLocation(long bundleId)
           
 MBeanNotificationInfo[] getNotificationInfo()
           
 long[] getRegisteredServices(long bundleId)
           
 long[] getRequiredBundles(long bundleIdentifier)
           
 long[] getRequiringBundles(long bundleIdentifier)
           
 long[] getServicesInUse(long bundleIdentifier)
           
 int getStartLevel(long bundleId)
           
 String getState(long bundleId)
           
 String getSymbolicName(long bundleId)
           
 String getVersion(long bundleId)
           
 boolean isFragment(long bundleId)
           
 boolean isPersistentlyStarted(long bundleId)
           
 boolean isRemovalPending(long bundleId)
           
 boolean isRequired(long bundleId)
           
 TabularData listBundles()
           
 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

bundleContext

protected org.osgi.framework.BundleContext bundleContext

packageAdmin

protected org.osgi.service.packageadmin.PackageAdmin packageAdmin

startLevel

protected org.osgi.service.startlevel.StartLevel startLevel

eventDispatcher

protected ExecutorService eventDispatcher

bundleListener

protected org.osgi.framework.BundleListener bundleListener

BUNDLE_EVENT

public static String BUNDLE_EVENT
Constructor Detail

BundleState

public BundleState(org.osgi.framework.BundleContext bundleContext,
                   org.osgi.service.packageadmin.PackageAdmin packageAdmin,
                   org.osgi.service.startlevel.StartLevel startLevel,
                   Logger logger)
Method Detail

getExportedPackages

public String[] getExportedPackages(long bundleId)
                             throws IOException,
                                    IllegalArgumentException
Specified by:
getExportedPackages in interface BundleStateMBean
Throws:
IOException
IllegalArgumentException
See Also:
BundleStateMBean.getExportedPackages(long)

getFragments

public long[] getFragments(long bundleId)
                    throws IOException,
                           IllegalArgumentException
Specified by:
getFragments in interface BundleStateMBean
Throws:
IOException
IllegalArgumentException
See Also:
BundleStateMBean.getFragments(long)

getHeaders

public TabularData getHeaders(long bundleId)
                       throws IOException,
                              IllegalArgumentException
Specified by:
getHeaders in interface BundleStateMBean
Throws:
IOException
IllegalArgumentException
See Also:
BundleStateMBean.getHeaders(long)

getHosts

public long[] getHosts(long fragmentId)
                throws IOException,
                       IllegalArgumentException
Specified by:
getHosts in interface BundleStateMBean
Throws:
IOException
IllegalArgumentException
See Also:
BundleStateMBean.getHosts(long)

getImportedPackages

public String[] getImportedPackages(long bundleId)
                             throws IOException,
                                    IllegalArgumentException
Specified by:
getImportedPackages in interface BundleStateMBean
Throws:
IOException
IllegalArgumentException
See Also:
BundleStateMBean.getImportedPackages(long)

getLastModified

public long getLastModified(long bundleId)
                     throws IOException,
                            IllegalArgumentException
Specified by:
getLastModified in interface BundleStateMBean
Throws:
IOException
IllegalArgumentException
See Also:
BundleStateMBean.getLastModified(long)

getLocation

public String getLocation(long bundleId)
                   throws IOException,
                          IllegalArgumentException
Specified by:
getLocation in interface BundleStateMBean
Throws:
IOException
IllegalArgumentException
See Also:
BundleStateMBean.getLocation(long)

getRegisteredServices

public long[] getRegisteredServices(long bundleId)
                             throws IOException,
                                    IllegalArgumentException
Specified by:
getRegisteredServices in interface BundleStateMBean
Throws:
IOException
IllegalArgumentException
See Also:
BundleStateMBean.getRegisteredServices(long)

getRequiredBundles

public long[] getRequiredBundles(long bundleIdentifier)
                          throws IOException,
                                 IllegalArgumentException
Specified by:
getRequiredBundles in interface BundleStateMBean
Throws:
IOException
IllegalArgumentException
See Also:
BundleStateMBean.getRequiredBundles(long)

getRequiringBundles

public long[] getRequiringBundles(long bundleIdentifier)
                           throws IOException,
                                  IllegalArgumentException
Specified by:
getRequiringBundles in interface BundleStateMBean
Throws:
IOException
IllegalArgumentException
See Also:
BundleStateMBean.getRequiringBundles(long)

getServicesInUse

public long[] getServicesInUse(long bundleIdentifier)
                        throws IOException,
                               IllegalArgumentException
Specified by:
getServicesInUse in interface BundleStateMBean
Throws:
IOException
IllegalArgumentException
See Also:
BundleStateMBean.getServicesInUse(long)

getStartLevel

public int getStartLevel(long bundleId)
                  throws IOException,
                         IllegalArgumentException
Specified by:
getStartLevel in interface BundleStateMBean
Throws:
IOException
IllegalArgumentException
See Also:
BundleStateMBean.getStartLevel(long)

getState

public String getState(long bundleId)
                throws IOException,
                       IllegalArgumentException
Specified by:
getState in interface BundleStateMBean
Throws:
IOException
IllegalArgumentException
See Also:
BundleStateMBean.getState(long)

getSymbolicName

public String getSymbolicName(long bundleId)
                       throws IOException,
                              IllegalArgumentException
Specified by:
getSymbolicName in interface BundleStateMBean
Throws:
IOException
IllegalArgumentException
See Also:
BundleStateMBean.getSymbolicName(long)

getVersion

public String getVersion(long bundleId)
                  throws IOException,
                         IllegalArgumentException
Specified by:
getVersion in interface BundleStateMBean
Throws:
IOException
IllegalArgumentException
See Also:
BundleStateMBean.getVersion(long)

isFragment

public boolean isFragment(long bundleId)
                   throws IOException,
                          IllegalArgumentException
Specified by:
isFragment in interface BundleStateMBean
Throws:
IOException
IllegalArgumentException
See Also:
BundleStateMBean.isFragment(long)

isPersistentlyStarted

public boolean isPersistentlyStarted(long bundleId)
                              throws IOException,
                                     IllegalArgumentException
Specified by:
isPersistentlyStarted in interface BundleStateMBean
Throws:
IOException
IllegalArgumentException
See Also:
BundleStateMBean.isPersistentlyStarted(long)

isRemovalPending

public boolean isRemovalPending(long bundleId)
                         throws IOException,
                                IllegalArgumentException
Specified by:
isRemovalPending in interface BundleStateMBean
Throws:
IOException
IllegalArgumentException
See Also:
BundleStateMBean.isRemovalPending(long)

isRequired

public boolean isRequired(long bundleId)
                   throws IOException,
                          IllegalArgumentException
Specified by:
isRequired in interface BundleStateMBean
Throws:
IOException
IllegalArgumentException
See Also:
BundleStateMBean.isRequired(long)

listBundles

public TabularData listBundles()
                        throws IOException
Specified by:
listBundles in interface BundleStateMBean
Throws:
IOException
See Also:
BundleStateMBean.listBundles()

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
See Also:
MBeanRegistration.preDeregister()

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.