public class BundleState extends NotificationBroadcasterSupport implements BundleStateMBean, MBeanRegistration
BundleStateMBean which emits JMX Notification on Bundle
state changes.| Modifier and Type | Field and Description |
|---|---|
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 |
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,
Logger logger) |
| Modifier and Type | Method and Description |
|---|---|
protected AttributeChangeNotification |
getAttributeChangeNotification(org.osgi.framework.BundleEvent event) |
CompositeData |
getBundle(long id)
New!!
|
long[] |
getBundleIds() |
protected ExecutorService |
getEventDispatcher() |
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
|
String |
getHeader(long bundleId,
String key) |
String |
getHeader(long bundleId,
String key,
String locale) |
TabularData |
getHeaders(long bundleId)
Answer the headers for the bundle uniquely identified by the bundle id.
|
TabularData |
getHeaders(long bundleId,
String locale) |
long[] |
getHosts(long fragmentId)
Answer the list of bundle ids of the bundles which host a fragment
|
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
|
String |
getLocation(long bundleId)
Answer the location of the bundle.
|
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
|
String |
getState(long bundleId)
Answer the symbolic name of the state of the bundle
|
String |
getSymbolicName(long bundleId)
Answer the symbolic name of the bundle
|
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
|
TabularData |
listBundles()
Answer the bundle state of the system in tabular form.
|
TabularData |
listBundles(String... items) |
void |
postDeregister() |
void |
postRegister(Boolean registrationDone) |
void |
preDeregister() |
ObjectName |
preRegister(MBeanServer server,
ObjectName name) |
protected void |
shutDownDispatcher() |
addNotificationListener, handleNotification, removeNotificationListener, removeNotificationListener, sendNotificationprotected Logger logger
protected org.osgi.framework.BundleContext bundleContext
protected org.osgi.service.packageadmin.PackageAdmin packageAdmin
protected org.osgi.service.startlevel.StartLevel startLevel
protected ExecutorService eventDispatcher
protected org.osgi.framework.BundleListener bundleListener
public static String BUNDLE_EVENT
public BundleState(org.osgi.framework.BundleContext bundleContext,
org.osgi.service.packageadmin.PackageAdmin packageAdmin,
org.osgi.service.startlevel.StartLevel startLevel,
Logger logger)
public String[] getExportedPackages(long bundleId) throws IOException, IllegalArgumentException
BundleStateMBeangetExportedPackages in interface BundleStateMBeanIOException - if the operation failsIllegalArgumentException - if the bundle indicated does not existBundleStateMBean.getExportedPackages(long)public long[] getFragments(long bundleId)
throws IOException,
IllegalArgumentException
BundleStateMBeangetFragments in interface BundleStateMBeanIOException - if the operation failsIllegalArgumentException - if the bundle indicated does not existBundleStateMBean.getFragments(long)public TabularData getHeaders(long bundleId) throws IOException, IllegalArgumentException
BundleStateMBeanBundleStateMBean.HEADERS_TYPE.getHeaders in interface BundleStateMBeanbundleId - the unique identifier of the bundleIOException - if the operation failsIllegalArgumentException - if the bundle indicated does not existBundleStateMBean.getHeaders(long)public TabularData getHeaders(long bundleId, String locale) throws IOException, IllegalArgumentException
getHeaders in interface BundleStateMBeanIOExceptionIllegalArgumentExceptionBundleStateMBean.getHeaders(long, java.lang.String)public String getHeader(long bundleId, String key) throws IOException
getHeader in interface BundleStateMBeanIOExceptionBundleStateMBean.getHeader(long, java.lang.String)public String getHeader(long bundleId, String key, String locale) throws IOException
getHeader in interface BundleStateMBeanIOExceptionBundleStateMBean.getHeader(long, java.lang.String, java.lang.String)public long[] getHosts(long fragmentId)
throws IOException,
IllegalArgumentException
BundleStateMBeangetHosts in interface BundleStateMBeanfragmentId - the bundle id of the fragmentIOException - if the operation failsIllegalArgumentException - if the bundle indicated does not existBundleStateMBean.getHosts(long)public String[] getImportedPackages(long bundleId) throws IOException, IllegalArgumentException
BundleStateMBeangetImportedPackages in interface BundleStateMBeanbundleId - the bundle identifierIOException - if the operation failsIllegalArgumentException - if the bundle indicated does not existBundleStateMBean.getImportedPackages(long)public long getLastModified(long bundleId)
throws IOException,
IllegalArgumentException
BundleStateMBeangetLastModified in interface BundleStateMBeanbundleId - the unique identifier of a bundleIOException - if the operation failsIllegalArgumentException - if the bundle indicated does not existBundleStateMBean.getLastModified(long)public String getLocation(long bundleId) throws IOException, IllegalArgumentException
BundleStateMBeangetLocation in interface BundleStateMBeanbundleId - the identifier of the bundleIOException - if the operation failsIllegalArgumentException - if the bundle indicated does not existBundleStateMBean.getLocation(long)public long[] getRegisteredServices(long bundleId)
throws IOException,
IllegalArgumentException
BundleStateMBeangetRegisteredServices in interface BundleStateMBeanbundleId - the bundle identifierIOException - if the operation failsIllegalArgumentException - if the bundle indicated does not existBundleStateMBean.getRegisteredServices(long)public long[] getRequiredBundles(long bundleIdentifier)
throws IOException,
IllegalArgumentException
BundleStateMBeangetRequiredBundles in interface BundleStateMBeanbundleIdentifier - the bundle identifierIOException - if the operation failsIllegalArgumentException - if the bundle indicated does not existBundleStateMBean.getRequiredBundles(long)public long[] getRequiringBundles(long bundleIdentifier)
throws IOException,
IllegalArgumentException
BundleStateMBeangetRequiringBundles in interface BundleStateMBeanbundleIdentifier - the bundle identifierIOException - if the operation failsIllegalArgumentException - if the bundle indicated does not existBundleStateMBean.getRequiringBundles(long)public long[] getServicesInUse(long bundleIdentifier)
throws IOException,
IllegalArgumentException
BundleStateMBeangetServicesInUse in interface BundleStateMBeanbundleIdentifier - the bundle identifierIOException - if the operation failsIllegalArgumentException - if the bundle indicated does not existBundleStateMBean.getServicesInUse(long)public int getStartLevel(long bundleId)
throws IOException,
IllegalArgumentException
BundleStateMBeangetStartLevel in interface BundleStateMBeanbundleId - the identifier of the bundleIOException - if the operation failsIllegalArgumentException - if the bundle indicated does not existBundleStateMBean.getStartLevel(long)public String getState(long bundleId) throws IOException, IllegalArgumentException
BundleStateMBeangetState in interface BundleStateMBeanbundleId - the identifier of the bundleIOException - if the operation failsIllegalArgumentException - if the bundle indicated does not existBundleStateMBean.getState(long)public String getSymbolicName(long bundleId) throws IOException, IllegalArgumentException
BundleStateMBeangetSymbolicName in interface BundleStateMBeanbundleId - the identifier of the bundleIOException - if the operation failsIllegalArgumentException - if the bundle indicated does not existBundleStateMBean.getSymbolicName(long)public String getVersion(long bundleId) throws IOException, IllegalArgumentException
BundleStateMBeangetVersion in interface BundleStateMBeanbundleId - the identifier of the bundleIOException - if the operation failsIllegalArgumentException - if the bundle indicated does not existBundleStateMBean.getVersion(long)public boolean isFragment(long bundleId)
throws IOException,
IllegalArgumentException
BundleStateMBeanisFragment in interface BundleStateMBeanbundleId - the identifier of the bundleIOException - if the operation failsIllegalArgumentException - if the bundle indicated does not existBundleStateMBean.isFragment(long)public boolean isActivationPolicyUsed(long bundleId)
throws IOException
BundleStateMBeanisActivationPolicyUsed in interface BundleStateMBeanbundleId - the identifier of the bundleIOException - if the operation failsBundleStateMBean.isActivationPolicyUsed(long)public boolean isPersistentlyStarted(long bundleId)
throws IOException,
IllegalArgumentException
BundleStateMBeanisPersistentlyStarted in interface BundleStateMBeanbundleId - the identifier of the bundleIOException - if the operation failsIllegalArgumentException - if the bundle indicated does not existBundleStateMBean.isPersistentlyStarted(long)public boolean isRemovalPending(long bundleId)
throws IOException,
IllegalArgumentException
BundleStateMBeanisRemovalPending in interface BundleStateMBeanbundleId - the identifier of the bundleIOException - if the operation failsIllegalArgumentException - if the bundle indicated does not existBundleStateMBean.isRemovalPending(long)public boolean isRequired(long bundleId)
throws IOException,
IllegalArgumentException
BundleStateMBeanisRequired in interface BundleStateMBeanbundleId - the identifier of the bundleIOException - if the operation failsIllegalArgumentException - if the bundle indicated does not existBundleStateMBean.isRequired(long)public CompositeData getBundle(long id) throws IOException
BundleStateMBeangetBundle in interface BundleStateMBeanid - The Bundle IDIOExceptionpublic long[] getBundleIds()
throws IOException
getBundleIds in interface BundleStateMBeanIOExceptionpublic TabularData listBundles() throws IOException
BundleStateMBeanBundleStateMBean.BUNDLES_TYPE.listBundles in interface BundleStateMBeanIOExceptionBundleStateMBean.listBundles()public TabularData listBundles(String... items) throws IOException
listBundles in interface BundleStateMBeanIOExceptionpublic MBeanNotificationInfo[] getNotificationInfo()
getNotificationInfo in interface NotificationBroadcastergetNotificationInfo in class NotificationBroadcasterSupportNotificationBroadcasterSupport.getNotificationInfo()public void postDeregister()
postDeregister in interface MBeanRegistrationMBeanRegistration.postDeregister()public void postRegister(Boolean registrationDone)
postRegister in interface MBeanRegistrationMBeanRegistration.postRegister(java.lang.Boolean)public void preDeregister()
throws Exception
preDeregister in interface MBeanRegistrationExceptionMBeanRegistration.preDeregister()public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception
preRegister in interface MBeanRegistrationExceptionMBeanRegistration.preRegister(javax.management.MBeanServer, javax.management.ObjectName)protected AttributeChangeNotification getAttributeChangeNotification(org.osgi.framework.BundleEvent event) throws IOException
IOExceptionprotected void shutDownDispatcher()
protected ExecutorService getEventDispatcher()
Copyright © 2009-2015 The Apache Software Foundation. All Rights Reserved.