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

    public void testModifyBundleWithTransformations_shouldUnregisterTransformations() throws Exception {
        Bundle providerBundle = getBundleContext()
                .installBundle("test://testlocation/test.provider.transformation.jar", providerTinyBundle.build());
        providerBundle.start();
        providerTinyBundle.removeResource("test.transformation");
        providerBundle.update(providerTinyBundle.build());
        providerBundle.start();
        assertFalse("transformation still possible. It has not been removed",
                transformationEngine.isTransformationPossible(
                        new ModelDescription(ExampleResponseModel.class.getName(), getOsgiProjectVersion()),
                        new ModelDescription(ExampleRequestModel.class.getName(), getOsgiProjectVersion()))
View Full Code Here

            //We need to store the agent checksum and save before we update the agent.
            if (newCheckums.containsKey(bundle.getLocation())) {
                bundleChecksums.put(bundle.getLocation(), newCheckums.get(bundle.getLocation()));
            }
            bundleChecksums.save(); // Force the needed classes to be loaded
            bundle.update(is);
            return;
        }

        // Display
        LOGGER.info("Changes to perform:");
View Full Code Here

        for (Map.Entry<Bundle, Resource> entry : toUpdate.entrySet()) {
            Bundle bundle = entry.getKey();
            Resource resource = entry.getValue();
            LOGGER.info("  " + getUri(resource));
            InputStream is = getBundleInputStream(resource, providers);
            bundle.update(is);
            toRefresh.add(bundle);
        }
        LOGGER.info("Installing bundles:");
        for (Resource resource : toInstall) {
            LOGGER.info("  " + getUri(resource));
View Full Code Here

        Set<Bundle> toStart = new HashSet<Bundle>();
        for (Map.Entry<Bundle, String> e : toUpdate.entrySet()) {
            InputStream is = new URL(e.getValue()).openStream();
            try {
                Bundle bundle = e.getKey();
                bundle.update(is);
                toRefresh.add(bundle);
                toStart.add(bundle);
            } finally {
                is.close();
            }
View Full Code Here

    // get a hold of the bundle proxy creator bundle and update it
    Bundle bundle = OsgiBundleUtils.findBundleBySymbolicName(bundleContext, PROXY_CREATOR_SYM_NAME);

    assertNotNull("proxy creator bundle not found", bundle);
    // update bundle (and thus create a new version of the classes)
    bundle.update();

    // make sure it starts-up
    try {
      waitOnContextCreation(PROXY_CREATOR_SYM_NAME, 60);
    }
View Full Code Here

            }
          }
          // If the bundle is already installed, then update it
          // if the 'update' action is present.
          else if (actionList.contains(AUTO_DEPLOY_UPDATE_VALUE)) {
            b.update();
          }

          // If we have found and/or successfully installed a bundle,
          // then add it to the list of bundles to potentially start.
          if (b != null) {
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.