Package org.osgi.framework

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


                        addInfoMessage(actionRequest, getLocalizedString(actionRequest, "consolebase.bundlemanager.info.stop", symbolicName, id));
                    } else if (UNINSTALL_OPERATION.equals(operation)) {
                        bundle.uninstall();
                        addInfoMessage(actionRequest, getLocalizedString(actionRequest, "consolebase.bundlemanager.info.uninstall", symbolicName, id));
                    } else if (UPDATE_OPERATION.equals(operation)) {
                        bundle.update();
                        addInfoMessage(actionRequest, getLocalizedString(actionRequest, "consolebase.bundlemanager.info.update", symbolicName, id));
                    } else if (REFRESH_OPERATION.equals(operation)) {
                        ServiceReference reference = bundleContext.getServiceReference(PackageAdmin.class.getName());
                        PackageAdmin packageAdmin = (PackageAdmin) bundleContext.getService(reference);
                        packageAdmin.refreshPackages(new Bundle[]{bundle});
View Full Code Here


        saBundle.start();
        sa = getOsgiService(ServiceAssembly.class);
        assertNotNull(sa);
        assertEquals(LifeCycleMBean.STARTED, sa.getCurrentState());

        saBundle.update();
        sa = getOsgiService(ServiceAssembly.class);
        assertNotNull(sa);
        assertEquals(LifeCycleMBean.STARTED, sa.getCurrentState());

        smxHttp.stop();
View Full Code Here

    Bundle bundle = getBundle(args);

    if (bundle == m_context.getBundle()) {
      new SelfUpdateThread(bundle).start();
    } else {
      bundle.update();
    }
  }

  private static final class SelfUpdateThread extends Thread {
    private final Bundle m_self;
View Full Code Here

    Bundle bundle = getBundle(args);

    if (bundle == m_context.getBundle()) {
      new SelfUpdateThread(bundle).start();
    } else {
      bundle.update();
    }
  }

  private static final class SelfUpdateThread extends Thread {
    private final Bundle m_self;
View Full Code Here

            pushMessage(request, String.format("未找到插件[%s],无法更新!",
                bundleSymbolicName));
            doGet(request, response);
            return;
          }
          bundle.update(pluginFile.getInputStream());
        } catch (Exception e) {
          e.printStackTrace();
          pushMessage(request, "更新插件时异常," + e);
          doGet(request, response);
          return;
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

                }

                if (installedBundle != null) {

                    try {
                        installedBundle.update(ins);
                        logger.log(Logger.LOG_INFO, "Bundle "
                            + installedBundle.getSymbolicName()
                            + " updated from " + path);
                    } catch (BundleException be) {
                        logger.log(Logger.LOG_ERROR, "Bundle update from "
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.