Package org.osgi.framework

Examples of org.osgi.framework.Bundle.update()


     */
    public void updateBundle(long bundleIdentifier) throws IOException {
        Bundle bundle = FrameworkUtils.resolveBundle(context, bundleIdentifier);

        try {
            bundle.update();
        } catch (BundleException be) {
            IOException ioex = new IOException("Failed to update bundle with id " + bundleIdentifier);
            ioex.initCause(be);
            throw ioex;
        }
View Full Code Here


    public void updateBundleFromURL(long bundleIdentifier, String url) throws IOException {
        Bundle bundle = FrameworkUtils.resolveBundle(context, bundleIdentifier);;
        InputStream inputStream = null;
        try {
            inputStream = createStream(url);
            bundle.update(inputStream);
        } catch (BundleException be) {
            if (inputStream != null) {
                try {
                    inputStream.close();
                } catch (IOException ioe) {
View Full Code Here

     * @see org.osgi.jmx.framework.FrameworkMBean#updateFramework()
     */
    public void updateFramework() throws IOException {
        Bundle bundle = FrameworkUtils.resolveBundle(context, 0);
        try {
            bundle.update();
        } catch (BundleException be) {
            IOException ioex = new IOException("Failed to update system bundle");
            ioex.initCause(be);
            throw ioex;
        }
View Full Code Here

            Bundle newBundle = context.installBundle(location);
            if (newBundle.getSymbolicName() == null) {
                newBundle.uninstall();
                newBundle = null;
            } else {
                newBundle.update();
            }
            // clear cache
            pluginCache.clear();
            return newBundle;
        } catch (Exception be) {
View Full Code Here

                }
                try {
                    if (isFrameworkExtensionBundle(bundle)) {
                        setSystemBundleUpdationRequired(true);
                    }
                    bundle.update();
                    noOfUpdatedBundles++;
                    logger.logp(Level.INFO, "BundleProvisioner", "update",
                            "Updated bundle {0} from {1} ",
                            new Object[]{bundle.getBundleId(), jar.getPath()});
                } catch (Exception e) {
View Full Code Here

     * @see org.osgi.jmx.framework.FrameworkMBean#restartFramework()
     */
    public void restartFramework() throws IOException {
        Bundle bundle = FrameworkUtils.resolveBundle(context, 0);
        try {
            bundle.update();
        } catch (Exception be) {
            IOException ioex = new IOException("Framework restart failed with message: " + be.getMessage());
            ioex.initCause(be);
            throw ioex;
        }
View Full Code Here

     * @see org.osgi.jmx.framework.FrameworkMBean#updateBundle(long)
     */
    public void updateBundle(long bundleIdentifier) throws IOException {
        Bundle bundle = FrameworkUtils.resolveBundle(context, bundleIdentifier);
        try {
            bundle.update();
        } catch (Exception be) {
            IOException ioex = new IOException("Update of bundle with id " + bundleIdentifier + " failed with message: " + be.getMessage());
            ioex.initCause(be);
            throw ioex;
        }
View Full Code Here

    public void updateBundleFromURL(long bundleIdentifier, String url) throws IOException {
        Bundle bundle = FrameworkUtils.resolveBundle(context, bundleIdentifier);
        InputStream inputStream = null;
        try {
            inputStream = createStream(url);
            bundle.update(inputStream);
        } catch (Exception be) {
            IOException ioex = new IOException("Update of bundle with id " + bundleIdentifier + " from url " + url + " failed with message: " + be.getMessage());
            ioex.initCause(be);
            throw ioex;
        } finally {
View Full Code Here

     * @see org.osgi.jmx.framework.FrameworkMBean#updateFramework()
     */
    public void updateFramework() throws IOException {
        Bundle bundle = FrameworkUtils.resolveBundle(context, 0);
        try {
            bundle.update();
        } catch (Exception be) {
            IOException ioex = new IOException("Update of framework bundle failed with message: " + be.getMessage());
            ioex.initCause(be);
            throw ioex;
        }
View Full Code Here

     * @see org.osgi.jmx.framework.FrameworkMBean#restartFramework()
     */
    public void restartFramework() throws IOException {
        Bundle bundle = FrameworkUtils.resolveBundle(context, 0);
        try {
            bundle.update();
        } catch (BundleException be) {
            IOException ioex = new IOException("Failed to restart framework");
            ioex.initCause(be);
            throw ioex;
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.