Package org.apache.aries.application.utils.manifest

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


        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

    // 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(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

      }
      deploymentMap.put(AppConstants.DEPLOYMENT_CONTENT, deployedContents.toString());
      // fake the provision bundle now.
      String persistenceLibraryLocation = "../src/test/resources/bundles/repository/a.handy.persistence.library.jar";
      File persistenceLibrary = new File (persistenceLibraryLocation);
      BundleManifest mf = BundleManifest.fromBundle(persistenceLibrary);
     
      deploymentMap.put(AppConstants.DEPLOYMENT_PROVISION_BUNDLE, mf.getSymbolicName()+";" + AppConstants.DEPLOYMENT_BUNDLE_VERSION + "=" + mf.getVersion());
      deploymentMap.put(AppConstants.APPLICATION_SYMBOLIC_NAME, app.getApplicationMetadata().getApplicationSymbolicName());
    
      deploymentMap.put(AppConstants.APPLICATION_VERSION, app.getApplicationMetadata().getApplicationVersion().toString());
     
     
View Full Code Here

      Set<BundleInfo> extraBundlesInfo = new HashSet<BundleInfo>();
      for (IFile f : ebaFile) {
        if (f.isDirectory()) {
          continue;
        }
        BundleManifest bm = getBundleManifest (f);
        if (bm != null) {
          if (bm.isValid()) {
            extraBundlesInfo.add(new SimpleBundleInfo(bm, f.toURL().toExternalForm()));
          } else if (deploymentManifest == null) {
            // We have a jar that needs converting to a bundle, or a war to migrate to a WAB
            // We only do this if a DEPLOYMENT.MF does not exist.
            BundleConversion convertedBinary = null;
View Full Code Here

   * 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

    // 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

  }
 
  @Test
  public void testExploded()
  {
    BundleManifest sut = BundleManifest.fromBundle(new File("../src/test/resources/bundles/exploded.jar"));
    assertEquals("com.ibm.test", sut.getSymbolicName());
    assertEquals("1.0.0", sut.getVersion().toString());
  }
View Full Code Here

    // make sure that the manifest is not the first file in the jar archive
    JarInputStream jarIs = new JarInputStream(new FileInputStream(_testfile));
    assertNull(jarIs.getManifest());
    jarIs.close();
   
    BundleManifest sut = BundleManifest.fromBundle(_testfile);
    assertEquals("com.ibm.test", sut.getSymbolicName());
    assertEquals("1.0.0", sut.getVersion().toString());
  }
View Full Code Here

      Set<BundleInfo> extraBundlesInfo = new HashSet<BundleInfo>();
      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 (deploymentManifest == null) {
            // We have a jar that needs converting to a bundle, or a war to migrate to a WAB
            // We only do this if a DEPLOYMENT.MF does not exist.
            BundleConversion convertedBinary = null;
View Full Code Here

TOP

Related Classes of org.apache.aries.application.utils.manifest.BundleManifest

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.