org.apache.aries.jmx.framework
Class Framework

java.lang.Object
  extended by org.apache.aries.jmx.framework.Framework
All Implemented Interfaces:
FrameworkMBean

public class Framework
extends Object
implements FrameworkMBean

Framework represents FrameworkMBean implementation.

Version:
$Rev: 1005056 $ $Date: 2010-10-06 15:30:02 +0100 (Wed, 06 Oct 2010) $
See Also:
FrameworkMBean

Field Summary
 
Fields inherited from interface org.osgi.jmx.framework.FrameworkMBean
BATCH_ACTION_RESULT_TYPE, BATCH_INSTALL_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 Summary
Framework(org.osgi.framework.BundleContext context, org.osgi.service.startlevel.StartLevel startLevel, org.osgi.service.packageadmin.PackageAdmin packageAdmin)
          Constructs new FrameworkMBean.
 
Method Summary
 InputStream createStream(String url)
           
 int getFrameworkStartLevel()
          Retrieve the framework start level
 int getInitialBundleStartLevel()
          Answer the initial start level assigned to a bundle when it is first started
 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.
 void refreshBundles(long[] bundleIdentifiers)
          Force the update, replacement or removal of the packages identified by the list of bundles.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Framework

public Framework(org.osgi.framework.BundleContext context,
                 org.osgi.service.startlevel.StartLevel startLevel,
                 org.osgi.service.packageadmin.PackageAdmin packageAdmin)
Constructs new FrameworkMBean.

Parameters:
context - bundle context of jmx bundle.
startLevel - @see StartLevel service reference.
packageAdmin - @see PackageAdmin service reference.
Method Detail

getFrameworkStartLevel

public int getFrameworkStartLevel()
                           throws IOException
Description copied from interface: FrameworkMBean
Retrieve the framework start level

Specified by:
getFrameworkStartLevel in interface FrameworkMBean
Returns:
the framework start level
Throws:
IOException - if the operation failed
See Also:
FrameworkMBean.getFrameworkStartLevel()

getInitialBundleStartLevel

public int getInitialBundleStartLevel()
                               throws IOException
Description copied from interface: FrameworkMBean
Answer the initial start level assigned to a bundle when it is first started

Specified by:
getInitialBundleStartLevel in interface FrameworkMBean
Returns:
the start level
Throws:
IOException - if the operation failed
See Also:
FrameworkMBean.getInitialBundleStartLevel()

installBundle

public long installBundle(String location)
                   throws IOException
Description copied from interface: FrameworkMBean
Install the bundle indicated by the bundleLocations

Specified by:
installBundle in interface FrameworkMBean
Parameters:
location - the location of the bundle to install
Returns:
the bundle id the installed bundle
Throws:
IOException - if the operation does not succeed
See Also:
FrameworkMBean.installBundle(java.lang.String)

installBundleFromURL

public long installBundleFromURL(String location,
                                 String url)
                          throws IOException
Description copied from interface: FrameworkMBean
Install the bundle indicated by the bundleLocations

Specified by:
installBundleFromURL in interface FrameworkMBean
Parameters:
location - the location to assign to the bundle
url - 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
See Also:
FrameworkMBean.installBundleFromURL(String, String)

createStream

public InputStream createStream(String url)
                         throws IOException
Throws:
IOException

installBundles

public CompositeData installBundles(String[] locations)
                             throws IOException
Description copied from interface: FrameworkMBean
Batch install the bundles indicated by the list of bundleLocationUrls

Specified by:
installBundles in interface FrameworkMBean
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:
FrameworkMBean.installBundles(java.lang.String[])

installBundlesFromURL

public CompositeData installBundlesFromURL(String[] locations,
                                           String[] urls)
                                    throws IOException
Description copied from interface: FrameworkMBean
Batch install the bundles indicated by the list of bundleLocationUrls

Specified by:
installBundlesFromURL in interface FrameworkMBean
Parameters:
locations - the array of locations to assign to the installed bundles
urls - 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:
FrameworkMBean.installBundlesFromURL(String[], String[])

refreshBundle

public void refreshBundle(long bundleIdentifier)
                   throws IOException
Description copied from interface: FrameworkMBean
Force the update, replacement or removal of the packages identified by the specified bundle.

Specified by:
refreshBundle in interface FrameworkMBean
Parameters:
bundleIdentifier - the bundle identifier
Throws:
IOException - if the operation failed
See Also:
FrameworkMBean.refreshBundle(long)

refreshBundles

public void refreshBundles(long[] bundleIdentifiers)
                    throws IOException
Description copied from interface: FrameworkMBean
Force the update, replacement or removal of the packages identified by the list of bundles.

Specified by:
refreshBundles in interface FrameworkMBean
Parameters:
bundleIdentifiers - The identifiers of the bundles to refresh, or null for all bundles with packages pending removal.
Throws:
IOException - if the operation failed
See Also:
FrameworkMBean.refreshBundles(long[])

resolveBundle

public boolean resolveBundle(long bundleIdentifier)
                      throws IOException
Description copied from interface: FrameworkMBean
Resolve the bundle indicated by the unique symbolic name and version

Specified by:
resolveBundle in interface FrameworkMBean
Parameters:
bundleIdentifier - the bundle identifier
Returns:
true if the bundle was resolved, false otherwise
Throws:
IOException - if the operation does not succeed
See Also:
FrameworkMBean.resolveBundle(long)

resolveBundles

public boolean resolveBundles(long[] bundleIdentifiers)
                       throws IOException
Description copied from interface: FrameworkMBean
Batch resolve the bundles indicated by the list of bundle identifiers

Specified by:
resolveBundles in interface FrameworkMBean
Parameters:
bundleIdentifiers - The identifiers of the bundles to resolve, or null to resolve all unresolved bundles.
Returns:
true if the bundles were resolved, false otherwise
Throws:
IOException - if the operation does not succeed
See Also:
FrameworkMBean.resolveBundles(long[])

restartFramework

public void restartFramework()
                      throws IOException
Description copied from interface: FrameworkMBean
Restart the framework by updating the system bundle

Specified by:
restartFramework in interface FrameworkMBean
Throws:
IOException - if the operation failed
See Also:
FrameworkMBean.restartFramework()

setBundleStartLevel

public void setBundleStartLevel(long bundleIdentifier,
                                int newlevel)
                         throws IOException
Description copied from interface: FrameworkMBean
Set the start level for the bundle identifier

Specified by:
setBundleStartLevel in interface FrameworkMBean
Parameters:
bundleIdentifier - the bundle identifier
newlevel - the new start level for the bundle
Throws:
IOException - if the operation failed
See Also:
FrameworkMBean.setBundleStartLevel(long, int)

setBundleStartLevels

public CompositeData setBundleStartLevels(long[] bundleIdentifiers,
                                          int[] newlevels)
                                   throws IOException
Description copied from interface: FrameworkMBean
Set the start levels for the list of bundles.

Specified by:
setBundleStartLevels in interface FrameworkMBean
Parameters:
bundleIdentifiers - the array of bundle identifiers
newlevels - 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:
FrameworkMBean.setBundleStartLevels(long[], int[])

setFrameworkStartLevel

public void setFrameworkStartLevel(int newlevel)
                            throws IOException
Description copied from interface: FrameworkMBean
Set the start level for the framework

Specified by:
setFrameworkStartLevel in interface FrameworkMBean
Parameters:
newlevel - the new start level
Throws:
IOException - if the operation failed
See Also:
FrameworkMBean.setFrameworkStartLevel(int)

setInitialBundleStartLevel

public void setInitialBundleStartLevel(int newlevel)
                                throws IOException
Description copied from interface: FrameworkMBean
Set the initial start level assigned to a bundle when it is first started

Specified by:
setInitialBundleStartLevel in interface FrameworkMBean
Parameters:
newlevel - the new start level
Throws:
IOException - if the operation failed
See Also:
FrameworkMBean.setInitialBundleStartLevel(int)

shutdownFramework

public void shutdownFramework()
                       throws IOException
Description copied from interface: FrameworkMBean
Shutdown the framework by stopping the system bundle

Specified by:
shutdownFramework in interface FrameworkMBean
Throws:
IOException - if the operation failed
See Also:
FrameworkMBean.shutdownFramework()

startBundle

public void startBundle(long bundleIdentifier)
                 throws IOException
Description copied from interface: FrameworkMBean
Start the bundle indicated by the bundle identifier

Specified by:
startBundle in interface FrameworkMBean
Parameters:
bundleIdentifier - the bundle identifier
Throws:
IOException - if the operation does not succeed
See Also:
FrameworkMBean.startBundle(long)

startBundles

public CompositeData startBundles(long[] bundleIdentifiers)
                           throws IOException
Description copied from interface: FrameworkMBean
Batch start the bundles indicated by the list of bundle identifier

Specified by:
startBundles in interface FrameworkMBean
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:
FrameworkMBean.startBundles(long[])

stopBundle

public void stopBundle(long bundleIdentifier)
                throws IOException
Description copied from interface: FrameworkMBean
Stop the bundle indicated by the bundle identifier

Specified by:
stopBundle in interface FrameworkMBean
Parameters:
bundleIdentifier - the bundle identifier
Throws:
IOException - if the operation does not succeed
See Also:
FrameworkMBean.stopBundle(long)

stopBundles

public CompositeData stopBundles(long[] bundleIdentifiers)
                          throws IOException
Description copied from interface: FrameworkMBean
Batch stop the bundles indicated by the list of bundle identifier

Specified by:
stopBundles in interface FrameworkMBean
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:
FrameworkMBean.stopBundles(long[])

uninstallBundle

public void uninstallBundle(long bundleIdentifier)
                     throws IOException
Description copied from interface: FrameworkMBean
Uninstall the bundle indicated by the bundle identifier

Specified by:
uninstallBundle in interface FrameworkMBean
Parameters:
bundleIdentifier - the bundle identifier
Throws:
IOException - if the operation does not succeed
See Also:
FrameworkMBean.uninstallBundle(long)

uninstallBundles

public CompositeData uninstallBundles(long[] bundleIdentifiers)
                               throws IOException
Description copied from interface: FrameworkMBean
Batch uninstall the bundles indicated by the list of bundle identifiers

Specified by:
uninstallBundles in interface FrameworkMBean
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:
FrameworkMBean.uninstallBundles(long[])

updateBundle

public void updateBundle(long bundleIdentifier)
                  throws IOException
Description copied from interface: FrameworkMBean
Update the bundle indicated by the bundle identifier

Specified by:
updateBundle in interface FrameworkMBean
Parameters:
bundleIdentifier - the bundle identifier
Throws:
IOException - if the operation does not succeed
See Also:
FrameworkMBean.updateBundle(long)

updateBundleFromURL

public void updateBundleFromURL(long bundleIdentifier,
                                String url)
                         throws IOException
Description copied from interface: FrameworkMBean
Update the bundle identified by the bundle identifier

Specified by:
updateBundleFromURL in interface FrameworkMBean
Parameters:
bundleIdentifier - the bundle identifier
url - the URL to use to update the bundle
Throws:
IOException - if the operation does not succeed
See Also:
FrameworkMBean.updateBundleFromURL(long, String)

updateBundles

public CompositeData updateBundles(long[] bundleIdentifiers)
                            throws IOException
Description copied from interface: FrameworkMBean
Batch update the bundles indicated by the list of bundle identifier.

Specified by:
updateBundles in interface FrameworkMBean
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:
FrameworkMBean.updateBundles(long[])

updateBundlesFromURL

public CompositeData updateBundlesFromURL(long[] bundleIdentifiers,
                                          String[] urls)
                                   throws IOException
Description copied from interface: FrameworkMBean
Update the bundle uniquely identified by the bundle symbolic name and version using the contents of the supplied urls.

Specified by:
updateBundlesFromURL in interface FrameworkMBean
Parameters:
bundleIdentifiers - the array of bundle identifiers
urls - 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 succeed
See Also:
FrameworkMBean.updateBundlesFromURL(long[], String[])

updateFramework

public void updateFramework()
                     throws IOException
Description copied from interface: FrameworkMBean
Update the framework by updating the system bundle.

Specified by:
updateFramework in interface FrameworkMBean
Throws:
IOException - if the operation failed
See Also:
FrameworkMBean.updateFramework()


Copyright © 2009-2013 The Apache Software Foundation. All Rights Reserved.