Package org.apache.aries.application.modelling

Examples of org.apache.aries.application.modelling.ImportedPackage


  }
 
  public static ImportedPackage intersectPackage_ (ImportedPackage p1, ImportedPackage p2) {
   
    logger.debug(LOG_ENTRY, "intersectPackage_", new Object[]{p1, p2});
    ImportedPackage result = null;
    if (p1.getPackageName().equals(p2.getPackageName()))
    {
      Map<String,String> att1 = new HashMap<String, String>(p1.getAttributes());
      Map<String,String> att2 = new HashMap<String, String>(p2.getAttributes());
     
View Full Code Here


    // Find the matching capabilities from bundles in use bundle, and prune
    // matched requirements out of the external requirements collection.
    Map<ImportedPackage,ExportedPackage> useBundlePkgs = new HashMap<ImportedPackage,ExportedPackage>();
    for (Iterator<ImportedPackage> iter = externalReqs.iterator(); iter.hasNext(); )
    {
      ImportedPackage req = iter.next();
      ExportedPackage match = getPackageMatch(req, deployedUseBundle);
      if (match != null)
      {
        useBundlePkgs.put(req, match);
        iter.remove();
      }
    }
   
   
    StringBuilder useBundleImports = new StringBuilder();
    for(Map.Entry<ImportedPackage, ExportedPackage> entry : useBundlePkgs.entrySet()) {
      useBundleImports.append(entry.getValue().toDeploymentString());
      ImportedPackage key = entry.getKey();
      if(key.isOptional())
        useBundleImports.append(";" + Constants.RESOLUTION_DIRECTIVE +":=" + Constants.RESOLUTION_OPTIONAL);
      useBundleImports.append(",");
    }
   
    String result = useBundleImports.toString() + createManifestString(externalReqs);
View Full Code Here

        // Grab and remove the package name, leaving only additional attributes.
        String name = filter.remove(ResourceType.PACKAGE.toString());
        if (requirement.isOptional()) {
          filter.put(Constants.RESOLUTION_DIRECTIVE + ":", Constants.RESOLUTION_OPTIONAL);
        }
        ImportedPackage info = modellingManager.getImportedPackage(name, filter);
        packageRequirements.add(info);
      } else if (ResourceType.SERVICE.toString().equals(requirement.getName())) {
        boolean optional = requirement.isOptional();
        String iface;
        String componentName;
View Full Code Here

        // Grab and remove the package name, leaving only additional attributes.
        String name = filter.remove(ResourceType.PACKAGE.toString());
        if (requirement.isOptional()) {
          filter.put(Constants.RESOLUTION_DIRECTIVE + ":", Constants.RESOLUTION_OPTIONAL);
        }
        ImportedPackage info = modellingManager.getImportedPackage(name, filter);
        packageRequirements.add(info);
      } else if (ResourceType.SERVICE.toString().equals(requirement.getName())) {
        boolean optional = requirement.isOptional();
        String iface;
        String componentName;
View Full Code Here

  {
    Map<String, Map<String, String>> imports = ManifestHeaderProcessor.parseImportString(importPackages);
   
    try {
      for (Map.Entry<String, Map<String,String>> e : imports.entrySet()) {
        ImportedPackage importPackage = modellingManager.getImportedPackage(e.getKey(), e.getValue());
       
        for (ExportedPackage export : bundle.getExportedPackages()) {
          if (importPackage.isSatisfied(export)) return true;
        }
      }
    } catch (InvalidAttributeException iae) {
      _logger.error(MessageUtil.getMessage("UNEXPECTED_EXCEPTION_PARSING_IMPORTS", iae, importPackages), iae);
    }
View Full Code Here

  public boolean equals(Object thing) {
    if (thing == this) {
      return true;
    } else {
      if (thing instanceof ImportedPackage) {
        ImportedPackage otherPackage = (ImportedPackage) thing;
        if (!this.getPackageName()
            .equals(otherPackage.getPackageName())) {
          return false;
        }
        if (!this.getVersionRange().equals(otherPackage.getVersionRange())) {
          return false;
        }
        if (!this.getPackageName()
            .equals(otherPackage.getPackageName())) {
          return false;
        }
        Map<String, String> otherAttributes = otherPackage
            .getAttributes();

        // Ignore the bundle, since the same package imported from
        // different bundles should count as the same
View Full Code Here

    // Do the merge.
    Map<String, ImportedPackage> reqMap = new HashMap<String, ImportedPackage>();
    for (ImportedPackage req : requirements)
    {
      String pkgName = req.getPackageName();
      ImportedPackage existingReq = reqMap.get(pkgName);
      if (existingReq == null)
      {
        reqMap.put(pkgName, req);
        continue;
      }
     
      ImportedPackage intersectReq = ModellingHelperImpl.intersectPackage_(req, existingReq);
      if (intersectReq != null)
      {
        reqMap.put(pkgName, intersectReq);
        continue;
      }
View Full Code Here

  }
 
  public static ImportedPackage intersectPackage_ (ImportedPackage p1, ImportedPackage p2) {
   
    logger.debug(LOG_ENTRY, "intersectPackage_", new Object[]{p1, p2});
    ImportedPackage result = null;
    if (p1.getPackageName().equals(p2.getPackageName()))
    {
      Map<String,String> att1 = new HashMap<String, String>(p1.getAttributes());
      Map<String,String> att2 = new HashMap<String, String>(p2.getAttributes());
     
View Full Code Here

    // Find the matching capabilities from bundles in use bundle, and prune
    // matched requirements out of the external requirements collection.
    Map<ImportedPackage,ExportedPackage> useBundlePkgs = new HashMap<ImportedPackage,ExportedPackage>();
    for (Iterator<ImportedPackage> iter = externalReqs.iterator(); iter.hasNext(); )
    {
      ImportedPackage req = iter.next();
      ExportedPackage match = getPackageMatch(req, deployedUseBundle);
      if (match != null)
      {
        useBundlePkgs.put(req, match);
        iter.remove();
      }
    }
   
   
    StringBuilder useBundleImports = new StringBuilder();
    for(Map.Entry<ImportedPackage, ExportedPackage> entry : useBundlePkgs.entrySet()) {
      useBundleImports.append(entry.getValue().toDeploymentString());
      ImportedPackage key = entry.getKey();
      if(key.isOptional())
        useBundleImports.append(";" + Constants.RESOLUTION_DIRECTIVE +":=" + Constants.RESOLUTION_OPTIONAL);
      useBundleImports.append(",");
    }
   
    String result = useBundleImports.toString() + createManifestString(externalReqs);
View Full Code Here

  {
    Map<String, NameValueMap<String, String>> imports = ManifestHeaderProcessor.parseImportString(importPackages);
   
    try {
      for (Map.Entry<String, NameValueMap<String,String>> e : imports.entrySet()) {
        ImportedPackage importPackage = modellingManager.getImportedPackage(e.getKey(), e.getValue());
       
        for (ExportedPackage export : bundle.getExportedPackages()) {
          if (importPackage.isSatisfied(export)) return true;
        }
      }
    } catch (InvalidAttributeException iae) {
      _logger.error(MessageUtil.getMessage("UNEXPECTED_EXCEPTION_PARSING_IMPORTS", iae, importPackages), iae);
    }
View Full Code Here

TOP

Related Classes of org.apache.aries.application.modelling.ImportedPackage

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.