Package org.osgi.jmx.framework
Interface FrameworkMBean
public interface FrameworkMBean
The FrameworkMbean provides mechanisms to exert control over the framework.
For many operations, it provides a batch mechanism to avoid excessive message
passing when interacting remotely.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final CompositeTypeThe Composite Type for a batch action result.static final CompositeTypeThe Composite Type which represents the result of a batch install operation.static final CompositeTypeThe Composite Type which represents the result of a batch resolve operation.static final StringThe key for BUNDLE_IN_ERROR.static final ItemThe item containing the bundle which caused the error during the batch operation.static final ItemThe item containing the bundle which caused the error during the batch operation.static final StringThe key COMPLETED, used inCOMPLETED_ITEM.static final ItemThe item containing the list of bundles completing the batch operation.static final StringThe key ERROR, used inERROR_ITEM.static final ItemThe item containing the error message of the batch operation.static final StringThe fully qualified object name of this mbean.static final StringThe key REMAINING, used inREMAINING_ID_ITEMandREMAINING_LOCATION_ITEM.static final ItemThe item containing the list of remaining bundles unprocessed by the failing batch operation.static final ItemThe item containing the list of remaining bundles unprocessed by the failing batch operation.static final StringThe SUCCESS, used inSUCCESS_ITEM.static final ItemThe item that indicates if this operation was successful. -
Method Summary
Modifier and TypeMethodDescriptionlong[]getDependencyClosure(long[] bundles) Returns the dependency closure for the specified bundles.intRetrieve the framework start levelintAnswer the initial start level assigned to a bundle when it is first startedgetProperty(String key) Returns the value of the specified property.long[]Returns the bundles IDs that have non-current, in use bundle wirings.longinstallBundle(String location) Install the bundle indicated by the bundleLocationslonginstallBundleFromURL(String location, String url) Install the bundle indicated by the bundleLocationsinstallBundles(String[] locations) Batch install the bundles indicated by the list of bundleLocationUrlsinstallBundlesFromURL(String[] locations, String[] urls) Batch install the bundles indicated by the list of bundleLocationUrlsvoidrefreshBundle(long bundleIdentifier) Force the update, replacement or removal of the packages identified by the specified bundle.booleanrefreshBundleAndWait(long bundleIdentifier) voidrefreshBundles(long[] bundleIdentifiers) Force the update, replacement or removal of the packages identified by the list of bundles.refreshBundlesAndWait(long[] bundleIdentifiers) resolve(long[] bundleIdentifiers) Same asresolveBundles(long[])but with a more detailed return type.booleanresolveBundle(long bundleIdentifier) Resolve the bundle indicated by the unique symbolic name and versionbooleanresolveBundles(long[] bundleIdentifiers) Batch resolve the bundles indicated by the list of bundle identifiersvoidRestart the framework by updating the system bundlevoidsetBundleStartLevel(long bundleIdentifier, int newlevel) Set the start level for the bundle identifiersetBundleStartLevels(long[] bundleIdentifiers, int[] newlevels) Set the start levels for the list of bundles.voidsetFrameworkStartLevel(int newlevel) Set the start level for the frameworkvoidsetInitialBundleStartLevel(int newlevel) Set the initial start level assigned to a bundle when it is first startedvoidShutdown the framework by stopping the system bundlevoidstartBundle(long bundleIdentifier) Start the bundle indicated by the bundle identifierstartBundles(long[] bundleIdentifiers) Batch start the bundles indicated by the list of bundle identifiervoidstopBundle(long bundleIdentifier) Stop the bundle indicated by the bundle identifierstopBundles(long[] bundleIdentifiers) Batch stop the bundles indicated by the list of bundle identifiervoiduninstallBundle(long bundleIdentifier) Uninstall the bundle indicated by the bundle identifieruninstallBundles(long[] bundleIdentifiers) Batch uninstall the bundles indicated by the list of bundle identifiersvoidupdateBundle(long bundleIdentifier) Update the bundle indicated by the bundle identifiervoidupdateBundleFromURL(long bundleIdentifier, String url) Update the bundle identified by the bundle identifierupdateBundles(long[] bundleIdentifiers) Batch update the bundles indicated by the list of bundle identifier.updateBundlesFromURL(long[] bundleIdentifiers, String[] urls) Update the bundle uniquely identified by the bundle symbolic name and version using the contents of the supplied urls.voidUpdate the framework by updating the system bundle.
-
Field Details
-
OBJECTNAME
The fully qualified object name of this mbean.- See Also:
-
SUCCESS
The SUCCESS, used inSUCCESS_ITEM.- See Also:
-
SUCCESS_ITEM
The item that indicates if this operation was successful. The key isSUCCESSand the type isSimpleType.BOOLEAN. It is used inBATCH_ACTION_RESULT_TYPEandBATCH_INSTALL_RESULT_TYPE. -
ERROR
The key ERROR, used inERROR_ITEM.- See Also:
-
ERROR_ITEM
The item containing the error message of the batch operation. The key isERRORand the type isSimpleType.STRING. It is used inBATCH_ACTION_RESULT_TYPEandBATCH_INSTALL_RESULT_TYPE. -
COMPLETED
The key COMPLETED, used inCOMPLETED_ITEM.- See Also:
-
COMPLETED_ITEM
The item containing the list of bundles completing the batch operation. The key isCOMPLETEDand the type isJmxConstants.LONG_ARRAY_TYPE. It is used inBATCH_ACTION_RESULT_TYPEandBATCH_INSTALL_RESULT_TYPE. -
BUNDLE_IN_ERROR
The key for BUNDLE_IN_ERROR. This key is used with two different items:BUNDLE_IN_ERROR_ID_ITEMandBUNDLE_IN_ERROR_LOCATION_ITEMthat each have a different type for this key. It is used inBATCH_ACTION_RESULT_TYPEandBATCH_INSTALL_RESULT_TYPE.- See Also:
-
BUNDLE_IN_ERROR_ID_ITEM
The item containing the bundle which caused the error during the batch operation. This item describes the bundle in error as an id. The key isBUNDLE_IN_ERRORand the type isSimpleType.LONG. It is used inBATCH_ACTION_RESULT_TYPE.- See Also:
-
REMAINING
The key REMAINING, used inREMAINING_ID_ITEMandREMAINING_LOCATION_ITEM.- See Also:
-
REMAINING_ID_ITEM
The item containing the list of remaining bundles unprocessed by the failing batch operation. The key isREMAININGand the type isJmxConstants.LONG_ARRAY_TYPE. It is used inBATCH_ACTION_RESULT_TYPEandBATCH_INSTALL_RESULT_TYPE. -
BATCH_ACTION_RESULT_TYPE
The Composite Type for a batch action result.refreshBundle(long)andrefreshBundles(long[]). Notice that a batch action result returns uses an id for theBUNDLE_IN_ERRORwhile theBATCH_INSTALL_RESULT_TYPEuses a location. This Composite Type consists of the following items: -
BUNDLE_IN_ERROR_LOCATION_ITEM
The item containing the bundle which caused the error during the batch operation. This item describes the bundle in error as a location. The key isBUNDLE_IN_ERRORand the type isSimpleType.STRING. It is used inBATCH_INSTALL_RESULT_TYPE.- See Also:
-
REMAINING_LOCATION_ITEM
The item containing the list of remaining bundles unprocessed by the failing batch operation. The key isREMAININGand the type isJmxConstants.STRING_ARRAY_TYPE. It is used inBATCH_ACTION_RESULT_TYPEandBATCH_INSTALL_RESULT_TYPE. -
BATCH_INSTALL_RESULT_TYPE
The Composite Type which represents the result of a batch install operation. It is used ininstallBundles(String[])andinstallBundlesFromURL(String[], String[]). This Composite Type consists of the following items: -
BATCH_RESOLVE_RESULT_TYPE
The Composite Type which represents the result of a batch resolve operation. It is used in. This Composite Type consists of the following items:invalid reference
#refreshBundlesAndWait(String[])
-
-
Method Details
-
getDependencyClosure
Returns the dependency closure for the specified bundles.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
UNINSTALLEDbundles that areremoval pending.- Parameters:
bundles- The initial bundles IDs for which to generate the dependency closure.- Returns:
- A bundle ID array containing a snapshot of the dependency closure of the specified bundles, or an empty array if there were no specified bundles.
- Throws:
IOException- if the operation failed
-
getFrameworkStartLevel
Retrieve the framework start level- Returns:
- the framework start level
- Throws:
IOException- if the operation failed
-
getInitialBundleStartLevel
Answer the initial start level assigned to a bundle when it is first started- Returns:
- the start level
- Throws:
IOException- if the operation failed
-
getProperty
Returns the value of the specified property. If the key is not found in the Framework properties, the system properties are then searched. The method returnsnullif the property is not found.- Parameters:
key- The name of the requested property.- Returns:
- The value of the requested property, or
nullif the property is undefined. - Throws:
IOException- if the operation failed
-
getRemovalPendingBundles
Returns the bundles IDs that have non-current, in use bundle wirings. This is typically the bundles which have been updated or uninstalled since the last call torefreshBundles(long[]).- Returns:
- A bundle ID array containing a snapshot of the bundles which have non-current, in use bundle wirings, or an empty array if there are no such bundles.
- Throws:
IOException- if the operation failed
-
installBundle
Install the bundle indicated by the bundleLocations- Parameters:
location- the location of the bundle to install- Returns:
- the bundle id the installed bundle
- Throws:
IOException- if the operation does not succeed
-
installBundleFromURL
Install the bundle indicated by the bundleLocations- Parameters:
location- the location to assign to the bundleurl- the URL which will supply the bytes for the bundle- Returns:
- the bundle id the installed bundle
- Throws:
IOException- if the operation does not succeed
-
installBundles
Batch install the bundles indicated by the list of bundleLocationUrls- Parameters:
locations- the array of locations of the bundles to install- Returns:
- the resulting state from executing the operation
- Throws:
IOException- if the operation does not succeed- See Also:
-
installBundlesFromURL
Batch install the bundles indicated by the list of bundleLocationUrls- Parameters:
locations- the array of locations to assign to the installed bundlesurls- the array of urls which supply the bundle bytes- Returns:
- the resulting state from executing the operation
- Throws:
IOException- if the operation does not succeed- See Also:
-
refreshBundle
Force the update, replacement or removal of the packages identified by the specified bundle.- Parameters:
bundleIdentifier- the bundle identifier- Throws:
IOException- if the operation failed
-
refreshBundleAndWait
- Throws:
IOException
-
refreshBundles
Force the update, replacement or removal of the packages identified by the list of bundles.- Parameters:
bundleIdentifiers- The identifiers of the bundles to refresh, ornullfor all bundles with packages pending removal.- Throws:
IOException- if the operation failed
-
refreshBundlesAndWait
- Throws:
IOException
-
resolveBundle
Resolve the bundle indicated by the unique symbolic name and version- Parameters:
bundleIdentifier- the bundle identifier- Returns:
trueif the bundle was resolved, false otherwise- Throws:
IOException- if the operation does not succeedIllegalArgumentException- if the bundle indicated does not exist
-
resolveBundles
Batch resolve the bundles indicated by the list of bundle identifiers- Parameters:
bundleIdentifiers- The identifiers of the bundles to resolve, ornullto resolve all unresolved bundles.- Returns:
trueif the bundles were resolved, false otherwise- Throws:
IOException- if the operation does not succeed
-
resolve
Same asresolveBundles(long[])but with a more detailed return type.- Parameters:
bundleIdentifiers-- Returns:
- Throws:
IOException
-
restartFramework
Restart the framework by updating the system bundle- Throws:
IOException- if the operation failed
-
setBundleStartLevel
Set the start level for the bundle identifier- Parameters:
bundleIdentifier- the bundle identifiernewlevel- the new start level for the bundle- Throws:
IOException- if the operation failed
-
setBundleStartLevels
Set the start levels for the list of bundles.- Parameters:
bundleIdentifiers- the array of bundle identifiersnewlevels- the array of new start level for the bundles- Returns:
- the resulting state from executing the operation
- Throws:
IOException- if the operation failed- See Also:
-
setFrameworkStartLevel
Set the start level for the framework- Parameters:
newlevel- the new start level- Throws:
IOException- if the operation failed
-
setInitialBundleStartLevel
Set the initial start level assigned to a bundle when it is first started- Parameters:
newlevel- the new start level- Throws:
IOException- if the operation failed
-
shutdownFramework
Shutdown the framework by stopping the system bundle- Throws:
IOException- if the operation failed
-
startBundle
Start the bundle indicated by the bundle identifier- Parameters:
bundleIdentifier- the bundle identifier- Throws:
IOException- if the operation does not succeedIllegalArgumentException- if the bundle indicated does not exist
-
startBundles
Batch start the bundles indicated by the list of bundle identifier- Parameters:
bundleIdentifiers- the array of bundle identifiers- Returns:
- the resulting state from executing the operation
- Throws:
IOException- if the operation does not succeed- See Also:
-
stopBundle
Stop the bundle indicated by the bundle identifier- Parameters:
bundleIdentifier- the bundle identifier- Throws:
IOException- if the operation does not succeedIllegalArgumentException- if the bundle indicated does not exist
-
stopBundles
Batch stop the bundles indicated by the list of bundle identifier- Parameters:
bundleIdentifiers- the array of bundle identifiers- Returns:
- the resulting state from executing the operation
- Throws:
IOException- if the operation does not succeed- See Also:
-
uninstallBundle
Uninstall the bundle indicated by the bundle identifier- Parameters:
bundleIdentifier- the bundle identifier- Throws:
IOException- if the operation does not succeedIllegalArgumentException- if the bundle indicated does not exist
-
uninstallBundles
Batch uninstall the bundles indicated by the list of bundle identifiers- Parameters:
bundleIdentifiers- the array of bundle identifiers- Returns:
- the resulting state from executing the operation
- Throws:
IOException- if the operation does not succeed- See Also:
-
updateBundle
Update the bundle indicated by the bundle identifier- Parameters:
bundleIdentifier- the bundle identifier- Throws:
IOException- if the operation does not succeedIllegalArgumentException- if the bundle indicated does not exist
-
updateBundleFromURL
Update the bundle identified by the bundle identifier- Parameters:
bundleIdentifier- the bundle identifierurl- the URL to use to update the bundle- Throws:
IOException- if the operation does not succeedIllegalArgumentException- if the bundle indicated does not exist
-
updateBundles
Batch update the bundles indicated by the list of bundle identifier.- Parameters:
bundleIdentifiers- the array of bundle identifiers- Returns:
- the resulting state from executing the operation
- Throws:
IOException- if the operation does not succeed- See Also:
-
updateBundlesFromURL
Update the bundle uniquely identified by the bundle symbolic name and version using the contents of the supplied urls.- Parameters:
bundleIdentifiers- the array of bundle identifiersurls- the array of URLs to use to update the bundles- Returns:
- the resulting state from executing the operation
- Throws:
IOException- if the operation does not succeedIllegalArgumentException- if the bundle indicated does not exist- See Also:
-
updateFramework
Update the framework by updating the system bundle.- Throws:
IOException- if the operation failed
-