Package org.apache.aries.application.management

Examples of org.apache.aries.application.management.BundleInfo


                        }
                    }
                   
                } else {
                    // Step 2: See if the bundle is included in the application
                    BundleInfo bundleInfo = findBundleInfoInApplication(bundleSymbolicName, bundleVersion);
                    if (bundleInfo == null) {
                        // Step 3: Lookup bundle location using the resolver
                        bundleInfo = findBundleInfoUsingResolver(resolver, bundleSymbolicName, bundleVersion);
                    }
                   
                    if (bundleInfo == null) {
                        throw new ManagementException("Could not find bundle: " + bundleSymbolicName + "_" + bundleVersion);
                    }
                       
                    contentBundle = bundleContext.installBundle(bundleInfo.getLocation());
                   
                    applicationBundles.add(contentBundle);
                }
               
            }
View Full Code Here


    if (obrResolver.resolve()) {
     Set<BundleInfo> result = new HashSet<BundleInfo>();
      List<Resource> requiredResources = retrieveRequiredResources(obrResolver);
     
      for (Resource resource: requiredResources) {
        BundleInfo bundleInfo = toBundleInfo(resource, false);
        result.add(bundleInfo);
      }
      if (returnOptionalResources) {
        for (Resource resource: obrResolver.getOptionalResources()) {
          BundleInfo bundleInfo = toBundleInfo(resource, true);
          result.add(bundleInfo);
        }
      }
           
      return result;
View Full Code Here

        resolvedBundles.addAll(app.getBundleInfo());
        return app.getBundleInfo();
    }

    public BundleInfo getBundleInfo(String bundleSymbolicName, Version bundleVersion) {
        BundleInfo result = null;
        for (BundleInfo info : resolvedBundles) {
            if (info.getSymbolicName().equals(bundleSymbolicName)
                    && info.getVersion().equals(bundleVersion)) {
                result = info;
            }
View Full Code Here

    if (obrResolver.resolve()) {
     Set<BundleInfo> result = new HashSet<BundleInfo>();
      List<Resource> requiredResources = retrieveRequiredResources(obrResolver);
     
      for (Resource resource: requiredResources) {
        BundleInfo bundleInfo = toBundleInfo(resource, false);
        result.add(bundleInfo);
      }
      if (returnOptionalResources) {
        for (Resource resource: obrResolver.getOptionalResources()) {
          BundleInfo bundleInfo = toBundleInfo(resource, true);
          result.add(bundleInfo);
        }
      }
           
      return result;
View Full Code Here

    // we could change to using it here.
    Set<BundleInfo> nextResolverResult = new HashSet<BundleInfo>();
    String persistenceLibraryLocation = "../src/test/resources/bundles/repository/a.handy.persistence.library.jar";
    File persistenceLibrary = new File (persistenceLibraryLocation);
    BundleManifest mf = BundleManifest.fromBundle(persistenceLibrary);
    BundleInfo resolvedPersistenceLibrary = new SimpleBundleInfo(_appMetaFactory, mf, persistenceLibraryLocation);
    Field v = SimpleBundleInfo.class.getDeclaredField("_version");
    v.setAccessible(true);
    v.set(resolvedPersistenceLibrary, new Version("1.1.0"));
    nextResolverResult.add(resolvedPersistenceLibrary);
    _resolver.setNextResult(nextResolverResult);
View Full Code Here

        try {
            for (DeploymentContent content : bundlesToInstall) {
                String bundleSymbolicName = content.getContentName();
                Version bundleVersion = content.getExactVersion();

                BundleInfo bundleInfo = null;

                for (BundleInfo info : application.getBundleInfo()) {
                    if (info.getSymbolicName().equals(bundleSymbolicName)
                        && info.getVersion().equals(bundleVersion)) {
                        bundleInfo = info;
                        break;
                    }
                }

                if (bundleInfo == null) {
                    // call out to the bundle repository.
                    bundleInfo = resolver.getBundleInfo(bundleSymbolicName, bundleVersion);
                }

                if (bundleInfo == null) {
                    throw new ManagementException("Cound not find bundles: " + bundleSymbolicName + "_" + bundleVersion);
                }

                Bundle bundle = bundleContext.installBundle(bundleInfo.getLocation());

                applicationBundles.add(bundle);
            }
        } catch (BundleException be) {
            for (Bundle bundle : applicationBundles) {
View Full Code Here

        }

        if (obrResolver.resolve()) {
            Set<BundleInfo> result = new HashSet<BundleInfo>();
            for (Resource resource : obrResolver.getRequiredResources()) {
                BundleInfo bundleInfo = toBundleInfo(resource, false);
                result.add(bundleInfo);
            }
            if (includeOptional) {
                for (Resource resource : obrResolver.getOptionalResources()) {
                    BundleInfo bundleInfo = toBundleInfo(resource, true);
                    result.add(bundleInfo);
                }
            }
            return result;
        } else {
View Full Code Here

        }

        if (resolved) {
            Set<BundleInfo> result = new HashSet<BundleInfo>();
            for (Resource resource : obrResolver.getRequiredResources()) {
                BundleInfo bundleInfo = toBundleInfo(resource, false);
                result.add(bundleInfo);
            }
            if (returnOptionalResources) {
                for (Resource resource : obrResolver.getOptionalResources()) {
                    BundleInfo bundleInfo = toBundleInfo(resource, true);
                    result.add(bundleInfo);
                }
            }
            result.addAll(fragments);
            return result;
View Full Code Here

                        }
                    }
                   
                } else {
                    // Step 2: See if the bundle is included in the application
                    BundleInfo bundleInfo = findBundleInfoInApplication(bundleSymbolicName, bundleVersion);
                    if (bundleInfo == null) {
                        // Step 3: Lookup bundle location using the resolver
                        bundleInfo = findBundleInfoUsingResolver(resolver, bundleSymbolicName, bundleVersion);
                    }
                   
                    if (bundleInfo == null) {
                        throw new ManagementException("Cound not find bundles: " + bundleSymbolicName + "_" + bundleVersion);
                    }
                       
                    contentBundle = bundleContext.installBundle(bundleInfo.getLocation());
                   
                    applicationBundles.add(contentBundle);
                }
               
            }
View Full Code Here

 
  @Override
public void collectFakeResources(Collection<ModelledResource> resources)
  {
    Bundle b = fwMgr.getSharedBundleFramework().getIsolatedBundleContext().getBundle(1);
    BundleInfo info = new BundleInfoImpl(b);
    Collection<ImportedService> serviceImports = Collections.emptySet();
    Collection<ExportedService> serviceExports = Collections.emptySet();
    try {
      resources.add(mgr.getModelledResource(info.getLocation(), info, serviceImports, serviceExports));
    } catch (InvalidAttributeException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.aries.application.management.BundleInfo

Copyright © 2018 www.massapicom. 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.