Package org.apache.aries.util.manifest

Examples of org.apache.aries.util.manifest.BundleManifest


  @Test
  public void testModelServicesNoneExportEJB() throws ModellerException {
    Manifest man = new Manifest();
    setBasicHeaders(man);
    man.getMainAttributes().putValue("Export-EJB", "NONE,anEJB , another");
    modeller.modelServices(new BundleManifest(man), bundleLocation);
    ejbLocator.assertSkeletonNotCalled();
  }
View Full Code Here


  @Test
  public void testModelServicesExportEJB() throws ModellerException {
    Manifest man = new Manifest();
    setBasicHeaders(man);
    man.getMainAttributes().putValue("Export-EJB", "anEJB , another");
    modeller.modelServices(new BundleManifest(man), bundleLocation);
    ejbLocator.assertCalled(new MethodCall(EJBLocator.class, "findEJBs", BundleManifest.class,
        bundleLocation, ParsedEJBServices.class));
  }
View Full Code Here

 
  private void runTest(byte[] zip, String manifest) throws ModellerException,
      IOException {
    ICloseableDirectory icd = FileSystem.getFSRoot(new
        ByteArrayInputStream(zip));
    new OpenEJBLocator().findEJBs(new BundleManifest(getClass().getClassLoader().
        getResourceAsStream(manifest)), icd, registry);
    icd.close();
  }
View Full Code Here

   * @param archive CommonArchive. The caller is responsible for closing this afterwards.
   * @return ParsedServiceElementsImpl
   * @throws OpenFailureException
   */
  public ParsedServiceElements getServiceElements (IDirectory archive) throws ModellerException {
      BundleManifest bm = BundleManifest.fromBundle(archive);
      return getServiceElements(bm, archive);
  }
View Full Code Here

 
  public ParsedServiceElements getServiceElements(InputStreamProvider archive) throws ModellerException {
      ICloseableDirectory dir = null;
      try {
          dir = FileSystem.getFSRoot(archive.open());
          BundleManifest bm = BundleManifest.fromBundle(dir);
          return getServiceElements(bm, dir);
      } catch (IOException e) {
          throw new ModellerException(e);
      } finally {
          IOUtils.close(dir);
View Full Code Here

 
  public ModelledResource getModelledResource(String uri, IDirectory bundle) throws ModellerException{
    _logger.debug(LOG_ENTRY, "getModelledResource", new Object[]{uri, bundle});

    if (bundle != null) {
        BundleManifest bm = BundleManifest.fromBundle(bundle);
        ParsedServiceElements pse = getServiceElements(bm, bundle);
        return model(uri, bm, pse);
    } else {
      // The bundle does not exist
      ModellerException me = new ModellerException(MessageUtil.getMessage("INVALID_BUNDLE_LOCATION", bundle));
View Full Code Here

   * Check whether a file is a bundle.
   * @param file the file path
   * @return true if the file is a bundle, false else
   */
  public static boolean isBundle(File file) {
    BundleManifest bm = BundleManifest.fromBundle(file);
    return ((bm != null) && (bm.isValid()));
  }
View Full Code Here

TOP

Related Classes of org.apache.aries.util.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.