public class Framework extends java.lang.Object implements FrameworkMBean
Framework represents FrameworkMBean implementation.
FrameworkMBeanBATCH_ACTION_RESULT_TYPE, BATCH_INSTALL_RESULT_TYPE, BATCH_RESOLVE_RESULT_TYPE, BUNDLE_IN_ERROR, BUNDLE_IN_ERROR_ID_ITEM, BUNDLE_IN_ERROR_LOCATION_ITEM, COMPLETED, COMPLETED_ITEM, ERROR, ERROR_ITEM, OBJECTNAME, REMAINING, REMAINING_ID_ITEM, REMAINING_LOCATION_ITEM, SUCCESS, SUCCESS_ITEM| Constructor and Description |
|---|
Framework(org.osgi.framework.BundleContext context,
org.osgi.service.startlevel.StartLevel startLevel,
org.osgi.service.packageadmin.PackageAdmin packageAdmin)
Constructs new FrameworkMBean.
|
| Modifier and Type | Method and Description |
|---|---|
java.io.InputStream |
createStream(java.lang.String url) |
long[] |
getDependencyClosure(long[] bundles)
Returns the dependency closure for the specified bundles.
|
int |
getFrameworkStartLevel()
Retrieve the framework start level
|
int |
getInitialBundleStartLevel()
Answer the initial start level assigned to a bundle when it is first
started
|
java.lang.String |
getProperty(java.lang.String key)
Returns the value of the specified property.
|
long[] |
getRemovalPendingBundles()
Returns the bundles IDs that have non-current, in use bundle wirings.
|
long |
installBundle(java.lang.String location)
Install the bundle indicated by the bundleLocations
|
long |
installBundleFromURL(java.lang.String location,
java.lang.String url)
Install the bundle indicated by the bundleLocations
|
javax.management.openmbean.CompositeData |
installBundles(java.lang.String[] locations)
Batch install the bundles indicated by the list of bundleLocationUrls
|
javax.management.openmbean.CompositeData |
installBundlesFromURL(java.lang.String[] locations,
java.lang.String[] urls)
Batch install the bundles indicated by the list of bundleLocationUrls
|
void |
refreshBundle(long bundleIdentifier)
Force the update, replacement or removal of the packages identified by
the specified bundle.
|
boolean |
refreshBundleAndWait(long bundleIdentifier) |
void |
refreshBundles(long[] bundleIdentifiers)
Force the update, replacement or removal of the packages identified by
the list of bundles.
|
javax.management.openmbean.CompositeData |
refreshBundlesAndWait(long[] bundleIdentifiers) |
javax.management.openmbean.CompositeData |
resolve(long[] bundleIdentifiers)
Same as
FrameworkMBean.resolveBundles(long[]) but with a more detailed return type. |
boolean |
resolveBundle(long bundleIdentifier)
Resolve the bundle indicated by the unique symbolic name and version
|
boolean |
resolveBundles(long[] bundleIdentifiers)
Batch resolve the bundles indicated by the list of bundle identifiers
|
void |
restartFramework()
Restart the framework by updating the system bundle
|
void |
setBundleStartLevel(long bundleIdentifier,
int newlevel)
Set the start level for the bundle identifier
|
javax.management.openmbean.CompositeData |
setBundleStartLevels(long[] bundleIdentifiers,
int[] newlevels)
Set the start levels for the list of bundles.
|
void |
setFrameworkStartLevel(int newlevel)
Set the start level for the framework
|
void |
setInitialBundleStartLevel(int newlevel)
Set the initial start level assigned to a bundle when it is first started
|
void |
shutdownFramework()
Shutdown the framework by stopping the system bundle
|
void |
startBundle(long bundleIdentifier)
Start the bundle indicated by the bundle identifier
|
javax.management.openmbean.CompositeData |
startBundles(long[] bundleIdentifiers)
Batch start the bundles indicated by the list of bundle identifier
|
void |
stopBundle(long bundleIdentifier)
Stop the bundle indicated by the bundle identifier
|
javax.management.openmbean.CompositeData |
stopBundles(long[] bundleIdentifiers)
Batch stop the bundles indicated by the list of bundle identifier
|
void |
uninstallBundle(long bundleIdentifier)
Uninstall the bundle indicated by the bundle identifier
|
javax.management.openmbean.CompositeData |
uninstallBundles(long[] bundleIdentifiers)
Batch uninstall the bundles indicated by the list of bundle identifiers
|
void |
updateBundle(long bundleIdentifier)
Update the bundle indicated by the bundle identifier
|
void |
updateBundleFromURL(long bundleIdentifier,
java.lang.String url)
Update the bundle identified by the bundle identifier
|
javax.management.openmbean.CompositeData |
updateBundles(long[] bundleIdentifiers)
Batch update the bundles indicated by the list of bundle identifier.
|
javax.management.openmbean.CompositeData |
updateBundlesFromURL(long[] bundleIdentifiers,
java.lang.String[] urls)
Update the bundle uniquely identified by the bundle symbolic name and
version using the contents of the supplied urls.
|
void |
updateFramework()
Update the framework by updating the system bundle.
|
public Framework(org.osgi.framework.BundleContext context,
org.osgi.service.startlevel.StartLevel startLevel,
org.osgi.service.packageadmin.PackageAdmin packageAdmin)
context - bundle context of jmx bundle.startLevel - @see StartLevel service reference.packageAdmin - @see PackageAdmin service reference.public long[] getDependencyClosure(long[] bundles)
throws java.io.IOException
FrameworkMBean
A graph of bundles is computed starting with the specified bundles. The
graph is expanded by adding any bundle that is either wired to a package
that is currently exported by a bundle in the graph or requires a bundle
in the graph. The graph is fully constructed when there is no bundle
outside the graph that is wired to a bundle in the graph. The graph may
contain UNINSTALLED bundles that are
removal pending.
getDependencyClosure in interface FrameworkMBeanbundles - The initial bundles IDs for which to generate the dependency
closure.java.io.IOException - if the operation failedorg.osgi.jmx.framework.FrameworkMBean#getDependencyClosureBundles(long[])public int getFrameworkStartLevel()
throws java.io.IOException
FrameworkMBeangetFrameworkStartLevel in interface FrameworkMBeanjava.io.IOException - if the operation failedFrameworkMBean.getFrameworkStartLevel()public int getInitialBundleStartLevel()
throws java.io.IOException
FrameworkMBeangetInitialBundleStartLevel in interface FrameworkMBeanjava.io.IOException - if the operation failedFrameworkMBean.getInitialBundleStartLevel()public java.lang.String getProperty(java.lang.String key)
FrameworkMBeannull if the property is not found.getProperty in interface FrameworkMBeankey - The name of the requested property.null if the
property is undefined.FrameworkMBean.getProperty(java.lang.String)public long[] getRemovalPendingBundles()
throws java.io.IOException
FrameworkMBeanFrameworkMBean.refreshBundles(long[]).getRemovalPendingBundles in interface FrameworkMBeanjava.io.IOException - if the operation failedFrameworkMBean.getRemovalPendingBundles()public long installBundle(java.lang.String location)
throws java.io.IOException
FrameworkMBeaninstallBundle in interface FrameworkMBeanlocation - the location of the bundle to installjava.io.IOException - if the operation does not succeedFrameworkMBean.installBundle(java.lang.String)public long installBundleFromURL(java.lang.String location,
java.lang.String url)
throws java.io.IOException
FrameworkMBeaninstallBundleFromURL in interface FrameworkMBeanlocation - the location to assign to the bundleurl - the URL which will supply the bytes for the bundlejava.io.IOException - if the operation does not succeedFrameworkMBean.installBundleFromURL(String, String)public java.io.InputStream createStream(java.lang.String url)
throws java.io.IOException
java.io.IOExceptionpublic javax.management.openmbean.CompositeData installBundles(java.lang.String[] locations)
throws java.io.IOException
FrameworkMBeaninstallBundles in interface FrameworkMBeanlocations - the array of locations of the bundles to installjava.io.IOException - if the operation does not succeedFrameworkMBean.installBundles(java.lang.String[])public javax.management.openmbean.CompositeData installBundlesFromURL(java.lang.String[] locations,
java.lang.String[] urls)
throws java.io.IOException
FrameworkMBeaninstallBundlesFromURL in interface FrameworkMBeanlocations - the array of locations to assign to the installed
bundlesurls - the array of urls which supply the bundle bytesjava.io.IOException - if the operation does not succeedFrameworkMBean.installBundlesFromURL(String[], String[])public void refreshBundle(long bundleIdentifier)
throws java.io.IOException
FrameworkMBeanrefreshBundle in interface FrameworkMBeanbundleIdentifier - the bundle identifierjava.io.IOException - if the operation failedFrameworkMBean.refreshBundle(long)public boolean refreshBundleAndWait(long bundleIdentifier)
throws java.io.IOException
refreshBundleAndWait in interface FrameworkMBeanjava.io.IOExceptionFrameworkMBean.refreshBundleAndWait(long)public void refreshBundles(long[] bundleIdentifiers)
throws java.io.IOException
FrameworkMBeanrefreshBundles in interface FrameworkMBeanbundleIdentifiers - The identifiers of the bundles to refresh, or
null for all bundles with packages pending removal.java.io.IOException - if the operation failedFrameworkMBean.refreshBundles(long[])public javax.management.openmbean.CompositeData refreshBundlesAndWait(long[] bundleIdentifiers)
throws java.io.IOException
refreshBundlesAndWait in interface FrameworkMBeanjava.io.IOExceptionFrameworkMBean.refreshBundlesAndWait(long[])public boolean resolveBundle(long bundleIdentifier)
throws java.io.IOException
FrameworkMBeanresolveBundle in interface FrameworkMBeanbundleIdentifier - the bundle identifiertrue if the bundle was resolved, false otherwisejava.io.IOException - if the operation does not succeedFrameworkMBean.resolveBundle(long)public boolean resolveBundles(long[] bundleIdentifiers)
throws java.io.IOException
FrameworkMBeanresolveBundles in interface FrameworkMBeanbundleIdentifiers - The identifiers of the bundles to resolve, or
null to resolve all unresolved bundles.true if the bundles were resolved, false otherwisejava.io.IOException - if the operation does not succeedFrameworkMBean.resolveBundles(long[])public javax.management.openmbean.CompositeData resolve(long[] bundleIdentifiers)
throws java.io.IOException
FrameworkMBeanFrameworkMBean.resolveBundles(long[]) but with a more detailed return type.resolve in interface FrameworkMBeanjava.io.IOExceptionpublic void restartFramework()
throws java.io.IOException
FrameworkMBeanrestartFramework in interface FrameworkMBeanjava.io.IOException - if the operation failedFrameworkMBean.restartFramework()public void setBundleStartLevel(long bundleIdentifier,
int newlevel)
throws java.io.IOException
FrameworkMBeansetBundleStartLevel in interface FrameworkMBeanbundleIdentifier - the bundle identifiernewlevel - the new start level for the bundlejava.io.IOException - if the operation failedFrameworkMBean.setBundleStartLevel(long, int)public javax.management.openmbean.CompositeData setBundleStartLevels(long[] bundleIdentifiers,
int[] newlevels)
throws java.io.IOException
FrameworkMBeansetBundleStartLevels in interface FrameworkMBeanbundleIdentifiers - the array of bundle identifiersnewlevels - the array of new start level for the bundlesjava.io.IOException - if the operation failedFrameworkMBean.setBundleStartLevels(long[], int[])public void setFrameworkStartLevel(int newlevel)
throws java.io.IOException
FrameworkMBeansetFrameworkStartLevel in interface FrameworkMBeannewlevel - the new start leveljava.io.IOException - if the operation failedFrameworkMBean.setFrameworkStartLevel(int)public void setInitialBundleStartLevel(int newlevel)
throws java.io.IOException
FrameworkMBeansetInitialBundleStartLevel in interface FrameworkMBeannewlevel - the new start leveljava.io.IOException - if the operation failedFrameworkMBean.setInitialBundleStartLevel(int)public void shutdownFramework()
throws java.io.IOException
FrameworkMBeanshutdownFramework in interface FrameworkMBeanjava.io.IOException - if the operation failedFrameworkMBean.shutdownFramework()public void startBundle(long bundleIdentifier)
throws java.io.IOException
FrameworkMBeanstartBundle in interface FrameworkMBeanbundleIdentifier - the bundle identifierjava.io.IOException - if the operation does not succeedFrameworkMBean.startBundle(long)public javax.management.openmbean.CompositeData startBundles(long[] bundleIdentifiers)
throws java.io.IOException
FrameworkMBeanstartBundles in interface FrameworkMBeanbundleIdentifiers - the array of bundle identifiersjava.io.IOException - if the operation does not succeedFrameworkMBean.startBundles(long[])public void stopBundle(long bundleIdentifier)
throws java.io.IOException
FrameworkMBeanstopBundle in interface FrameworkMBeanbundleIdentifier - the bundle identifierjava.io.IOException - if the operation does not succeedFrameworkMBean.stopBundle(long)public javax.management.openmbean.CompositeData stopBundles(long[] bundleIdentifiers)
throws java.io.IOException
FrameworkMBeanstopBundles in interface FrameworkMBeanbundleIdentifiers - the array of bundle identifiersjava.io.IOException - if the operation does not succeedFrameworkMBean.stopBundles(long[])public void uninstallBundle(long bundleIdentifier)
throws java.io.IOException
FrameworkMBeanuninstallBundle in interface FrameworkMBeanbundleIdentifier - the bundle identifierjava.io.IOException - if the operation does not succeedFrameworkMBean.uninstallBundle(long)public javax.management.openmbean.CompositeData uninstallBundles(long[] bundleIdentifiers)
throws java.io.IOException
FrameworkMBeanuninstallBundles in interface FrameworkMBeanbundleIdentifiers - the array of bundle identifiersjava.io.IOException - if the operation does not succeedFrameworkMBean.uninstallBundles(long[])public void updateBundle(long bundleIdentifier)
throws java.io.IOException
FrameworkMBeanupdateBundle in interface FrameworkMBeanbundleIdentifier - the bundle identifierjava.io.IOException - if the operation does not succeedFrameworkMBean.updateBundle(long)public void updateBundleFromURL(long bundleIdentifier,
java.lang.String url)
throws java.io.IOException
FrameworkMBeanupdateBundleFromURL in interface FrameworkMBeanbundleIdentifier - the bundle identifierurl - the URL to use to update the bundlejava.io.IOException - if the operation does not succeedFrameworkMBean.updateBundleFromURL(long, String)public javax.management.openmbean.CompositeData updateBundles(long[] bundleIdentifiers)
throws java.io.IOException
FrameworkMBeanupdateBundles in interface FrameworkMBeanbundleIdentifiers - the array of bundle identifiersjava.io.IOException - if the operation does not succeedFrameworkMBean.updateBundles(long[])public javax.management.openmbean.CompositeData updateBundlesFromURL(long[] bundleIdentifiers,
java.lang.String[] urls)
throws java.io.IOException
FrameworkMBeanupdateBundlesFromURL in interface FrameworkMBeanbundleIdentifiers - the array of bundle identifiersurls - the array of URLs to use to update the bundlesjava.io.IOException - if the operation does not succeedFrameworkMBean.updateBundlesFromURL(long[], String[])public void updateFramework()
throws java.io.IOException
FrameworkMBeanupdateFramework in interface FrameworkMBeanjava.io.IOException - if the operation failedFrameworkMBean.updateFramework()Copyright © 2009-2019 The Apache Software Foundation. All Rights Reserved.