Examples of BundleManifest


Examples of org.apache.aries.application.utils.manifest.BundleManifest

  {
    _logger.debug(LOG_ENTRY, "findBlueprints", applicationBundles);
    Collection<IFile> blueprints = new ArrayList<IFile>();
    for (IDirectory appBundle : applicationBundles) {
      if (appBundle != null) {
        BundleManifest bundleMf = BundleManifest.fromBundle(appBundle);
        BundleBlueprintParser bpParser = new BundleBlueprintParser(bundleMf);
        List<IFile> files = appBundle.listAllFiles();
        Iterator<IFile> it = files.iterator();
        while (it.hasNext()) {
          IFile file = (IFile) it.next();        
View Full Code Here

Examples of org.apache.aries.application.utils.manifest.BundleManifest

   
    private void collectBundleInfos(File baseDir, ApplicationMetadataFactory applicationMetadataFactory, Set<BundleInfo> bundleInfos) throws IOException, ManagementException {
        for (File file : baseDir.listFiles()) {
            if (file.isDirectory()) {
                if (file.getName().endsWith(".jar")) {
                    BundleManifest bm = fromBundle(file);
                    if (bm != null && bm.isValid()) {
                        bundleInfos.add(new SimpleBundleInfo(applicationMetadataFactory, bm, "reference:" + file.toURI().toString()));               
                    }
                } else {
                    collectBundleInfos(file, applicationMetadataFactory, bundleInfos);
                    continue;
                }
            } else {
                BundleManifest bm = fromBundle(file);
                if (bm != null && bm.isValid()) {
                    /*
                     * Pass file:// url instead of reference:file:// as bundle location to make sure
                     * Equinox has its own copy of the jar. That is, to prevent strange ZipErrors when
                     * application bundles are updated at runtime, specifically, when
                     * ApplicationGBean.hotSwapApplicationContent() is called.
View Full Code Here

Examples of org.apache.aries.application.utils.manifest.BundleManifest

            File manifestFile = new File(file, JarFile.MANIFEST_NAME);
            if (manifestFile.isFile()) {
                FileInputStream in = null;
                try {
                    in = new FileInputStream(manifestFile);
                    return new BundleManifest(in);
                } catch (IOException e) {
                    LOG.debug("Error reading manifest file: " + file, e);
                } finally {
                    IOUtils.close(in);
                }
View Full Code Here

Examples of org.apache.aries.application.utils.manifest.BundleManifest

        while (e.hasMoreElements()) {
            URL url = e.nextElement();
            if (url.getPath().endsWith("/")) {
                continue;
            }
            BundleManifest bm = fromBundle(url.openStream());
            if (bm != null && bm.isValid()) {
                bundleInfos.add(new SimpleBundleInfo(applicationMetadataFactory, bm, url.toExternalForm()));
            }
        }
        return bundleInfos;
    }
View Full Code Here

Examples of org.apache.aries.application.utils.manifest.BundleManifest

    // find we need a String-based BundleInfoImpl constructor for other reasons,
    // 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);
View Full Code Here

Examples of org.apache.aries.application.utils.manifest.BundleManifest

      for (IFile f : ebaFile) {
        if (f.isDirectory()) {
          continue;
        }
       
        BundleManifest bm = getBundleManifest (f);
        if (bm != null) {
          if (bm.isValid()) {
            extraBundlesInfo.add(new SimpleBundleInfo(_applicationMetadataFactory, bm, f.toURL().toExternalForm()));
          } else if (deploymentMetadata != null) {
            throw new ManagementException (MessageUtil.getMessage("APPMANAGEMENT0003E", f.getName(), ebaFile.getName()));
          } else {
            // We have a jar that needs converting to a bundle, or a war to migrate to a WAB
View Full Code Here

Examples of org.apache.aries.application.utils.manifest.BundleManifest

   * Extract a bundle manifest from an IFile representing a bundle
   * @param file The bundle to extract the manifest from
   * @return bundle manifest
   */
  private BundleManifest getBundleManifest(IFile file) throws IOException {
    BundleManifest mf = null;
    InputStream in = null;
    try {
      in = file.open();
      mf = BundleManifest.fromBundle(in);
    } finally {
View Full Code Here

Examples of org.apache.aries.application.utils.manifest.BundleManifest

        while (e.hasMoreElements()) {
            URL url = e.nextElement();
            if (url.getPath().endsWith("/")) {
                continue;
            }
            BundleManifest bm = BundleManifest.fromBundle(url.openStream());
            if (bm != null && bm.isValid()) {
                bundleInfo.add(new SimpleBundleInfo(applicationFactory, bm, url.toExternalForm()));
            }
        }
    }
View Full Code Here

Examples of org.apache.aries.application.utils.manifest.BundleManifest

        for (File file : baseDir.listFiles()) {
            if (file.isDirectory()) {
                collectFileSystemBasedBundleInfos(file, applicationFactory);
                continue;
            }
            BundleManifest bm = BundleManifest.fromBundle(file);
            if (bm != null && bm.isValid()) {
                /*
                 * Pass file:// url instead of reference:file:// as bundle location to make sure
                 * Equinox has its own copy of the jar. That is, to prevent strange ZipErrors when
                 * application bundles are updated at runtime, specifically, when
                 * ApplicationGBean.hotSwapApplicationContent() is called.
View Full Code Here

Examples of org.apache.aries.application.utils.manifest.BundleManifest

        while (e.hasMoreElements()) {
            URL url = e.nextElement();
            if (url.getPath().endsWith("/")) {
                continue;
            }
            BundleManifest bm = BundleManifest.fromBundle(url.openStream());
            if (bm != null && bm.isValid()) {
                bundleInfo.add(new SimpleBundleInfo(applicationFactory, bm, url.toExternalForm()));
            }
        }
    }
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.