public class Framework extends 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 |
|---|---|
InputStream |
createStream(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
|
String |
getProperty(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(String location)
Install the bundle indicated by the bundleLocations
|
long |
installBundleFromURL(String location,
String url)
Install the bundle indicated by the bundleLocations
|
CompositeData |
installBundles(String[] locations)
Batch install the bundles indicated by the list of bundleLocationUrls
|
CompositeData |
installBundlesFromURL(String[] locations,
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.
|
CompositeData |
refreshBundlesAndWait(long[] bundleIdentifiers) |
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
|
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
|
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
|
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
|
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,
String url)
Update the bundle identified by the bundle identifier
|
CompositeData |
updateBundles(long[] bundleIdentifiers)
Batch update the bundles indicated by the list of bundle identifier.
|
CompositeData |
updateBundlesFromURL(long[] bundleIdentifiers,
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 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.IOException - if the operation failedorg.osgi.jmx.framework.FrameworkMBean#getDependencyClosureBundles(long[])public int getFrameworkStartLevel()
throws IOException
FrameworkMBeangetFrameworkStartLevel in interface FrameworkMBeanIOException - if the operation failedFrameworkMBean.getFrameworkStartLevel()public int getInitialBundleStartLevel()
throws IOException
FrameworkMBeangetInitialBundleStartLevel in interface FrameworkMBeanIOException - if the operation failedFrameworkMBean.getInitialBundleStartLevel()public String getProperty(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 IOException
FrameworkMBeanFrameworkMBean.refreshBundles(long[]).getRemovalPendingBundles in interface FrameworkMBeanIOException - if the operation failedFrameworkMBean.getRemovalPendingBundles()public long installBundle(String location) throws IOException
FrameworkMBeaninstallBundle in interface FrameworkMBeanlocation - the location of the bundle to installIOException - if the operation does not succeedFrameworkMBean.installBundle(java.lang.String)public long installBundleFromURL(String location, String url) throws IOException
FrameworkMBeaninstallBundleFromURL in interface FrameworkMBeanlocation - the location to assign to the bundleurl - the URL which will supply the bytes for the bundleIOException - if the operation does not succeedFrameworkMBean.installBundleFromURL(String, String)public InputStream createStream(String url) throws IOException
IOExceptionpublic CompositeData installBundles(String[] locations) throws IOException
FrameworkMBeaninstallBundles in interface FrameworkMBeanlocations - the array of locations of the bundles to installIOException - if the operation does not succeedFrameworkMBean.installBundles(java.lang.String[])public CompositeData installBundlesFromURL(String[] locations, String[] urls) throws IOException
FrameworkMBeaninstallBundlesFromURL in interface FrameworkMBeanlocations - the array of locations to assign to the installed
bundlesurls - the array of urls which supply the bundle bytesIOException - if the operation does not succeedFrameworkMBean.installBundlesFromURL(String[], String[])public void refreshBundle(long bundleIdentifier)
throws IOException
FrameworkMBeanrefreshBundle in interface FrameworkMBeanbundleIdentifier - the bundle identifierIOException - if the operation failedFrameworkMBean.refreshBundle(long)public boolean refreshBundleAndWait(long bundleIdentifier)
throws IOException
refreshBundleAndWait in interface FrameworkMBeanIOExceptionFrameworkMBean.refreshBundleAndWait(long)public void refreshBundles(long[] bundleIdentifiers)
throws IOException
FrameworkMBeanrefreshBundles in interface FrameworkMBeanbundleIdentifiers - The identifiers of the bundles to refresh, or
null for all bundles with packages pending removal.IOException - if the operation failedFrameworkMBean.refreshBundles(long[])public CompositeData refreshBundlesAndWait(long[] bundleIdentifiers) throws IOException
refreshBundlesAndWait in interface FrameworkMBeanIOExceptionFrameworkMBean.refreshBundlesAndWait(long[])public boolean resolveBundle(long bundleIdentifier)
throws IOException
FrameworkMBeanresolveBundle in interface FrameworkMBeanbundleIdentifier - the bundle identifiertrue if the bundle was resolved, false otherwiseIOException - if the operation does not succeedFrameworkMBean.resolveBundle(long)public boolean resolveBundles(long[] bundleIdentifiers)
throws 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 otherwiseIOException - if the operation does not succeedFrameworkMBean.resolveBundles(long[])public CompositeData resolve(long[] bundleIdentifiers) throws IOException
FrameworkMBeanFrameworkMBean.resolveBundles(long[]) but with a more detailed return type.resolve in interface FrameworkMBeanIOExceptionpublic void restartFramework()
throws IOException
FrameworkMBeanrestartFramework in interface FrameworkMBeanIOException - if the operation failedFrameworkMBean.restartFramework()public void setBundleStartLevel(long bundleIdentifier,
int newlevel)
throws IOException
FrameworkMBeansetBundleStartLevel in interface FrameworkMBeanbundleIdentifier - the bundle identifiernewlevel - the new start level for the bundleIOException - if the operation failedFrameworkMBean.setBundleStartLevel(long, int)public CompositeData setBundleStartLevels(long[] bundleIdentifiers, int[] newlevels) throws IOException
FrameworkMBeansetBundleStartLevels in interface FrameworkMBeanbundleIdentifiers - the array of bundle identifiersnewlevels - the array of new start level for the bundlesIOException - if the operation failedFrameworkMBean.setBundleStartLevels(long[], int[])public void setFrameworkStartLevel(int newlevel)
throws IOException
FrameworkMBeansetFrameworkStartLevel in interface FrameworkMBeannewlevel - the new start levelIOException - if the operation failedFrameworkMBean.setFrameworkStartLevel(int)public void setInitialBundleStartLevel(int newlevel)
throws IOException
FrameworkMBeansetInitialBundleStartLevel in interface FrameworkMBeannewlevel - the new start levelIOException - if the operation failedFrameworkMBean.setInitialBundleStartLevel(int)public void shutdownFramework()
throws IOException
FrameworkMBeanshutdownFramework in interface FrameworkMBeanIOException - if the operation failedFrameworkMBean.shutdownFramework()public void startBundle(long bundleIdentifier)
throws IOException
FrameworkMBeanstartBundle in interface FrameworkMBeanbundleIdentifier - the bundle identifierIOException - if the operation does not succeedFrameworkMBean.startBundle(long)public CompositeData startBundles(long[] bundleIdentifiers) throws IOException
FrameworkMBeanstartBundles in interface FrameworkMBeanbundleIdentifiers - the array of bundle identifiersIOException - if the operation does not succeedFrameworkMBean.startBundles(long[])public void stopBundle(long bundleIdentifier)
throws IOException
FrameworkMBeanstopBundle in interface FrameworkMBeanbundleIdentifier - the bundle identifierIOException - if the operation does not succeedFrameworkMBean.stopBundle(long)public CompositeData stopBundles(long[] bundleIdentifiers) throws IOException
FrameworkMBeanstopBundles in interface FrameworkMBeanbundleIdentifiers - the array of bundle identifiersIOException - if the operation does not succeedFrameworkMBean.stopBundles(long[])public void uninstallBundle(long bundleIdentifier)
throws IOException
FrameworkMBeanuninstallBundle in interface FrameworkMBeanbundleIdentifier - the bundle identifierIOException - if the operation does not succeedFrameworkMBean.uninstallBundle(long)public CompositeData uninstallBundles(long[] bundleIdentifiers) throws IOException
FrameworkMBeanuninstallBundles in interface FrameworkMBeanbundleIdentifiers - the array of bundle identifiersIOException - if the operation does not succeedFrameworkMBean.uninstallBundles(long[])public void updateBundle(long bundleIdentifier)
throws IOException
FrameworkMBeanupdateBundle in interface FrameworkMBeanbundleIdentifier - the bundle identifierIOException - if the operation does not succeedFrameworkMBean.updateBundle(long)public void updateBundleFromURL(long bundleIdentifier,
String url)
throws IOException
FrameworkMBeanupdateBundleFromURL in interface FrameworkMBeanbundleIdentifier - the bundle identifierurl - the URL to use to update the bundleIOException - if the operation does not succeedFrameworkMBean.updateBundleFromURL(long, String)public CompositeData updateBundles(long[] bundleIdentifiers) throws IOException
FrameworkMBeanupdateBundles in interface FrameworkMBeanbundleIdentifiers - the array of bundle identifiersIOException - if the operation does not succeedFrameworkMBean.updateBundles(long[])public CompositeData updateBundlesFromURL(long[] bundleIdentifiers, String[] urls) throws IOException
FrameworkMBeanupdateBundlesFromURL in interface FrameworkMBeanbundleIdentifiers - the array of bundle identifiersurls - the array of URLs to use to update the bundlesIOException - if the operation does not succeedFrameworkMBean.updateBundlesFromURL(long[], String[])public void updateFramework()
throws IOException
FrameworkMBeanupdateFramework in interface FrameworkMBeanIOException - if the operation failedFrameworkMBean.updateFramework()Copyright © 2009-2015 The Apache Software Foundation. All Rights Reserved.