public class BundleState extends javax.management.NotificationBroadcasterSupport implements BundleStateMBean, javax.management.MBeanRegistration
BundleStateMBean which emits JMX Notification on Bundle
state changes.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
BUNDLE_EVENT |
protected org.osgi.framework.BundleContext |
bundleContext |
protected org.osgi.framework.BundleListener |
bundleListener |
protected java.util.concurrent.ExecutorService |
eventDispatcher |
protected Logger |
logger |
protected org.osgi.service.packageadmin.PackageAdmin |
packageAdmin |
protected org.osgi.service.startlevel.StartLevel |
startLevel |
protected StateConfig |
stateConfig |
ACTIVATION_POLICY_USED, ACTIVATION_POLICY_USED_ITEM, 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 and Description |
|---|
BundleState(org.osgi.framework.BundleContext bundleContext,
org.osgi.service.packageadmin.PackageAdmin packageAdmin,
org.osgi.service.startlevel.StartLevel startLevel,
StateConfig stateConfig,
Logger logger) |
| Modifier and Type | Method and Description |
|---|---|
protected javax.management.AttributeChangeNotification |
getAttributeChangeNotification(org.osgi.framework.BundleEvent event) |
javax.management.openmbean.CompositeData |
getBundle(long id)
New!!
|
long[] |
getBundleIds() |
protected java.util.concurrent.ExecutorService |
getEventDispatcher() |
java.lang.String[] |
getExportedPackages(long bundleId)
Answer the list of exported packages for this bundle.
|
long[] |
getFragments(long bundleId)
Answer the list of the bundle ids of the fragments associated with this
bundle
|
java.lang.String |
getHeader(long bundleId,
java.lang.String key) |
java.lang.String |
getHeader(long bundleId,
java.lang.String key,
java.lang.String locale) |
javax.management.openmbean.TabularData |
getHeaders(long bundleId)
Answer the headers for the bundle uniquely identified by the bundle id.
|
javax.management.openmbean.TabularData |
getHeaders(long bundleId,
java.lang.String locale) |
long[] |
getHosts(long fragmentId)
Answer the list of bundle ids of the bundles which host a fragment
|
java.lang.String[] |
getImportedPackages(long bundleId)
Answer the array of the packages imported by this bundle
|
long |
getLastModified(long bundleId)
Answer the last modified time of a bundle
|
java.lang.String |
getLocation(long bundleId)
Answer the location of the bundle.
|
javax.management.MBeanNotificationInfo[] |
getNotificationInfo() |
long[] |
getRegisteredServices(long bundleId)
Answer the list of service identifiers representing the services this
bundle exports
|
long[] |
getRequiredBundles(long bundleIdentifier)
Answer the list of identifiers of the bundles this bundle depends upon
|
long[] |
getRequiringBundles(long bundleIdentifier)
Answer the list of identifiers of the bundles which require this bundle
|
long[] |
getServicesInUse(long bundleIdentifier)
Answer the list of service identifiers which refer to the the services
this bundle is using
|
int |
getStartLevel(long bundleId)
Answer the start level of the bundle
|
java.lang.String |
getState(long bundleId)
Answer the symbolic name of the state of the bundle
|
java.lang.String |
getSymbolicName(long bundleId)
Answer the symbolic name of the bundle
|
java.lang.String |
getVersion(long bundleId)
Answer the location of the bundle.
|
boolean |
isActivationPolicyUsed(long bundleId)
Answer whether the specified bundle's autostart setting indicates that
the activation policy declared in the bundle's manifest must be used.
|
boolean |
isFragment(long bundleId)
Answer whether the bundle is a fragment or not
|
boolean |
isPersistentlyStarted(long bundleId)
Answer if the bundle is persistently started when its start level is
reached
|
boolean |
isRemovalPending(long bundleId)
Answer true if the bundle is pending removal
|
boolean |
isRequired(long bundleId)
Answer true if the bundle is required by another bundle
|
javax.management.openmbean.TabularData |
listBundles()
Answer the bundle state of the system in tabular form.
|
javax.management.openmbean.TabularData |
listBundles(java.lang.String... items) |
void |
postDeregister() |
void |
postRegister(java.lang.Boolean registrationDone) |
void |
preDeregister() |
javax.management.ObjectName |
preRegister(javax.management.MBeanServer server,
javax.management.ObjectName name) |
protected void |
shutDownDispatcher() |
protected Logger logger
protected org.osgi.framework.BundleContext bundleContext
protected org.osgi.service.packageadmin.PackageAdmin packageAdmin
protected org.osgi.service.startlevel.StartLevel startLevel
protected StateConfig stateConfig
protected java.util.concurrent.ExecutorService eventDispatcher
protected org.osgi.framework.BundleListener bundleListener
public static java.lang.String BUNDLE_EVENT
public BundleState(org.osgi.framework.BundleContext bundleContext,
org.osgi.service.packageadmin.PackageAdmin packageAdmin,
org.osgi.service.startlevel.StartLevel startLevel,
StateConfig stateConfig,
Logger logger)
public java.lang.String[] getExportedPackages(long bundleId)
throws java.io.IOException,
java.lang.IllegalArgumentException
BundleStateMBeangetExportedPackages in interface BundleStateMBeanjava.io.IOException - if the operation failsjava.lang.IllegalArgumentException - if the bundle indicated does not existBundleStateMBean.getExportedPackages(long)public long[] getFragments(long bundleId)
throws java.io.IOException,
java.lang.IllegalArgumentException
BundleStateMBeangetFragments in interface BundleStateMBeanjava.io.IOException - if the operation failsjava.lang.IllegalArgumentException - if the bundle indicated does not existBundleStateMBean.getFragments(long)public javax.management.openmbean.TabularData getHeaders(long bundleId)
throws java.io.IOException,
java.lang.IllegalArgumentException
BundleStateMBeanBundleStateMBean.HEADERS_TYPE.getHeaders in interface BundleStateMBeanbundleId - the unique identifier of the bundlejava.io.IOException - if the operation failsjava.lang.IllegalArgumentException - if the bundle indicated does not existBundleStateMBean.getHeaders(long)public javax.management.openmbean.TabularData getHeaders(long bundleId,
java.lang.String locale)
throws java.io.IOException,
java.lang.IllegalArgumentException
getHeaders in interface BundleStateMBeanjava.io.IOExceptionjava.lang.IllegalArgumentExceptionBundleStateMBean.getHeaders(long, java.lang.String)public java.lang.String getHeader(long bundleId,
java.lang.String key)
throws java.io.IOException
getHeader in interface BundleStateMBeanjava.io.IOExceptionBundleStateMBean.getHeader(long, java.lang.String)public java.lang.String getHeader(long bundleId,
java.lang.String key,
java.lang.String locale)
throws java.io.IOException
getHeader in interface BundleStateMBeanjava.io.IOExceptionBundleStateMBean.getHeader(long, java.lang.String, java.lang.String)public long[] getHosts(long fragmentId)
throws java.io.IOException,
java.lang.IllegalArgumentException
BundleStateMBeangetHosts in interface BundleStateMBeanfragmentId - the bundle id of the fragmentjava.io.IOException - if the operation failsjava.lang.IllegalArgumentException - if the bundle indicated does not existBundleStateMBean.getHosts(long)public java.lang.String[] getImportedPackages(long bundleId)
throws java.io.IOException,
java.lang.IllegalArgumentException
BundleStateMBeangetImportedPackages in interface BundleStateMBeanbundleId - the bundle identifierjava.io.IOException - if the operation failsjava.lang.IllegalArgumentException - if the bundle indicated does not existBundleStateMBean.getImportedPackages(long)public long getLastModified(long bundleId)
throws java.io.IOException,
java.lang.IllegalArgumentException
BundleStateMBeangetLastModified in interface BundleStateMBeanbundleId - the unique identifier of a bundlejava.io.IOException - if the operation failsjava.lang.IllegalArgumentException - if the bundle indicated does not existBundleStateMBean.getLastModified(long)public java.lang.String getLocation(long bundleId)
throws java.io.IOException,
java.lang.IllegalArgumentException
BundleStateMBeangetLocation in interface BundleStateMBeanbundleId - the identifier of the bundlejava.io.IOException - if the operation failsjava.lang.IllegalArgumentException - if the bundle indicated does not existBundleStateMBean.getLocation(long)public long[] getRegisteredServices(long bundleId)
throws java.io.IOException,
java.lang.IllegalArgumentException
BundleStateMBeangetRegisteredServices in interface BundleStateMBeanbundleId - the bundle identifierjava.io.IOException - if the operation failsjava.lang.IllegalArgumentException - if the bundle indicated does not existBundleStateMBean.getRegisteredServices(long)public long[] getRequiredBundles(long bundleIdentifier)
throws java.io.IOException,
java.lang.IllegalArgumentException
BundleStateMBeangetRequiredBundles in interface BundleStateMBeanbundleIdentifier - the bundle identifierjava.io.IOException - if the operation failsjava.lang.IllegalArgumentException - if the bundle indicated does not existBundleStateMBean.getRequiredBundles(long)public long[] getRequiringBundles(long bundleIdentifier)
throws java.io.IOException,
java.lang.IllegalArgumentException
BundleStateMBeangetRequiringBundles in interface BundleStateMBeanbundleIdentifier - the bundle identifierjava.io.IOException - if the operation failsjava.lang.IllegalArgumentException - if the bundle indicated does not existBundleStateMBean.getRequiringBundles(long)public long[] getServicesInUse(long bundleIdentifier)
throws java.io.IOException,
java.lang.IllegalArgumentException
BundleStateMBeangetServicesInUse in interface BundleStateMBeanbundleIdentifier - the bundle identifierjava.io.IOException - if the operation failsjava.lang.IllegalArgumentException - if the bundle indicated does not existBundleStateMBean.getServicesInUse(long)public int getStartLevel(long bundleId)
throws java.io.IOException,
java.lang.IllegalArgumentException
BundleStateMBeangetStartLevel in interface BundleStateMBeanbundleId - the identifier of the bundlejava.io.IOException - if the operation failsjava.lang.IllegalArgumentException - if the bundle indicated does not existBundleStateMBean.getStartLevel(long)public java.lang.String getState(long bundleId)
throws java.io.IOException,
java.lang.IllegalArgumentException
BundleStateMBeangetState in interface BundleStateMBeanbundleId - the identifier of the bundlejava.io.IOException - if the operation failsjava.lang.IllegalArgumentException - if the bundle indicated does not existBundleStateMBean.getState(long)public java.lang.String getSymbolicName(long bundleId)
throws java.io.IOException,
java.lang.IllegalArgumentException
BundleStateMBeangetSymbolicName in interface BundleStateMBeanbundleId - the identifier of the bundlejava.io.IOException - if the operation failsjava.lang.IllegalArgumentException - if the bundle indicated does not existBundleStateMBean.getSymbolicName(long)public java.lang.String getVersion(long bundleId)
throws java.io.IOException,
java.lang.IllegalArgumentException
BundleStateMBeangetVersion in interface BundleStateMBeanbundleId - the identifier of the bundlejava.io.IOException - if the operation failsjava.lang.IllegalArgumentException - if the bundle indicated does not existBundleStateMBean.getVersion(long)public boolean isFragment(long bundleId)
throws java.io.IOException,
java.lang.IllegalArgumentException
BundleStateMBeanisFragment in interface BundleStateMBeanbundleId - the identifier of the bundlejava.io.IOException - if the operation failsjava.lang.IllegalArgumentException - if the bundle indicated does not existBundleStateMBean.isFragment(long)public boolean isActivationPolicyUsed(long bundleId)
throws java.io.IOException
BundleStateMBeanisActivationPolicyUsed in interface BundleStateMBeanbundleId - the identifier of the bundlejava.io.IOException - if the operation failsBundleStateMBean.isActivationPolicyUsed(long)public boolean isPersistentlyStarted(long bundleId)
throws java.io.IOException,
java.lang.IllegalArgumentException
BundleStateMBeanisPersistentlyStarted in interface BundleStateMBeanbundleId - the identifier of the bundlejava.io.IOException - if the operation failsjava.lang.IllegalArgumentException - if the bundle indicated does not existBundleStateMBean.isPersistentlyStarted(long)public boolean isRemovalPending(long bundleId)
throws java.io.IOException,
java.lang.IllegalArgumentException
BundleStateMBeanisRemovalPending in interface BundleStateMBeanbundleId - the identifier of the bundlejava.io.IOException - if the operation failsjava.lang.IllegalArgumentException - if the bundle indicated does not existBundleStateMBean.isRemovalPending(long)public boolean isRequired(long bundleId)
throws java.io.IOException,
java.lang.IllegalArgumentException
BundleStateMBeanisRequired in interface BundleStateMBeanbundleId - the identifier of the bundlejava.io.IOException - if the operation failsjava.lang.IllegalArgumentException - if the bundle indicated does not existBundleStateMBean.isRequired(long)public javax.management.openmbean.CompositeData getBundle(long id)
throws java.io.IOException
BundleStateMBeangetBundle in interface BundleStateMBeanid - The Bundle IDjava.io.IOExceptionpublic long[] getBundleIds()
throws java.io.IOException
getBundleIds in interface BundleStateMBeanjava.io.IOExceptionpublic javax.management.openmbean.TabularData listBundles()
throws java.io.IOException
BundleStateMBeanBundleStateMBean.BUNDLES_TYPE.listBundles in interface BundleStateMBeanjava.io.IOExceptionBundleStateMBean.listBundles()public javax.management.openmbean.TabularData listBundles(java.lang.String... items)
throws java.io.IOException
listBundles in interface BundleStateMBeanjava.io.IOExceptionpublic javax.management.MBeanNotificationInfo[] getNotificationInfo()
getNotificationInfo in interface javax.management.NotificationBroadcastergetNotificationInfo in class javax.management.NotificationBroadcasterSupportNotificationBroadcasterSupport.getNotificationInfo()public void postDeregister()
postDeregister in interface javax.management.MBeanRegistrationMBeanRegistration.postDeregister()public void postRegister(java.lang.Boolean registrationDone)
postRegister in interface javax.management.MBeanRegistrationMBeanRegistration.postRegister(java.lang.Boolean)public void preDeregister()
throws java.lang.Exception
preDeregister in interface javax.management.MBeanRegistrationjava.lang.ExceptionMBeanRegistration.preDeregister()public javax.management.ObjectName preRegister(javax.management.MBeanServer server,
javax.management.ObjectName name)
throws java.lang.Exception
preRegister in interface javax.management.MBeanRegistrationjava.lang.ExceptionMBeanRegistration.preRegister(javax.management.MBeanServer, javax.management.ObjectName)protected javax.management.AttributeChangeNotification getAttributeChangeNotification(org.osgi.framework.BundleEvent event)
throws java.io.IOException
java.io.IOExceptionprotected void shutDownDispatcher()
protected java.util.concurrent.ExecutorService getEventDispatcher()
Copyright © 2009-2019 The Apache Software Foundation. All Rights Reserved.