Package org.apache.aries.application.modelling

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


    // 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();
      }
View Full Code Here


   
    // Filter out requirements satisfied by internal capabilities.
    Collection<ImportedPackage> result = new ArrayList<ImportedPackage>();
    for (ImportedPackage req : requirements)
    {
      ExportedPackage match = getPackageMatch(req, deployedContent);
      //If we didn't find a match then it must come from outside
      if (match == null)
      {
        result.add(req);
      }
View Full Code Here

   * @return an ExportedPackageImpl or null if no match is found.
   */
  private ExportedPackage getPackageMatch(ImportedPackage requirement, Collection<ModelledResource> bundles)
  {
    logger.debug(LOG_ENTRY, "getPackageMatch", new Object[]{requirement, bundles});
    ExportedPackage result = null;
   
    outer: for (ModelledResource bundle : bundles)
    {
      for (ExportedPackage pkg : bundle.getExportedPackages())
      {
View Full Code Here

    Collection<ImportedPackage> externalReqs = getExternalPackageRequirements();
    Collection<ModelledResource> usedUseBundles = new HashSet<ModelledResource>();
    for (ImportedPackage req : externalReqs)
    {
      // Find a match from the supplied bundle capabilities.
      ExportedPackage match = getPackageMatch(req, deployedUseBundle);
      if (match != null)
      {
          usedUseBundles.add(match.getBundle());
      }
    }
    logger.debug(LOG_EXIT, "getRequiredUseBundle", usedUseBundles);
    return usedUseBundles;
  }
View Full Code Here

      {
        // Grab and remove the package name, leaving only additional attributes.
        Object pkg = props.remove(ResourceType.PACKAGE.toString());
        // bundle symbolic name and version will be in additionalProps, so do not
        // need to be passed in separately.
        ExportedPackage info = modellingManager.getExportedPackage(this, pkg.toString(), props);
        packageCapabilities.add(info);
      } else if (ResourceType.SERVICE.toString().equals(capability.getName())) {
        String name = null;   // we've lost this irretrievably
        int ranking = 0;
        Collection<String> ifaces;
View Full Code Here

    // Override Resolver behaviour.
    //ImportedBundle isolated = new ImportedBundleImpl ("test.isolated" , "1.0.0");
   
    // When we resolve isolated, we're going to get another bundle which has a dependency on isolated.
    Collection<ModelledResource> cmr = new ArrayList<ModelledResource>();
    ExportedPackage testIsolatedPkg = createExportedPackage ("test.isolated", "1.0.0",
        new String[] {"test.shared"}, new String[] {"test.isolated.pkg"});
    cmr.add (testIsolatedPkg.getBundle());
   
    ExportedPackage testSharedPkg = createExportedPackage ("test.shared", "1.0.0",
        new String[] {"test.isolated.pkg"}, new String[] {"test.shared"});
    cmr.add (testSharedPkg.getBundle());
    _resolver.addResult(cmr);
   
    // The second time DeploymentGenerator calls the Resolver, it will provide just
    // test.shared. The resolver will return test.shared _plus_ test.isolated.
    _resolver.addResult(cmr);
View Full Code Here

   */
  @Test
  public void checkMultipleCircularDependenciesDetected() throws Exception {
   
    Collection<ModelledResource> cmr = new ArrayList<ModelledResource>();
    ExportedPackage testIsolated1 = createExportedPackage ("test.isolated1", "1.0.0",
        new String[] {"test.isolated1","test.isolated2"}, new String[] {"test.shared1", "test.shared2"});
    cmr.add (testIsolated1.getBundle());
   
    ExportedPackage testIsolated2 = createExportedPackage ("test.isolated2", "1.0.0",
        new String[] {"test.isolated1","test.isolated2"}, new String[] {"test.shared1", "test.shared2"});
    cmr.add (testIsolated2.getBundle());
   
    ExportedPackage testShared1 = createExportedPackage ("test.shared1", "1.0.0",
        new String[] {"test.shared1", "test.shared2"}, new String[] {"test.isolated1","test.isolated2"});
    cmr.add (testShared1.getBundle());
   
    ExportedPackage testShared2 = createExportedPackage ("test.shared2", "1.0.0",
        new String[] {"test.shared1", "test.shared2"}, new String[] {"test.isolated1","test.isolated2"});
    cmr.add (testShared2.getBundle());
   
    _resolver.addResult(cmr);
   
    // The second time DeploymentGenerator calls the Resolver, it will provide just
    // test.shared. The resolver will return test.shared _plus_ test.isolated.
View Full Code Here

      {
        // Grab and remove the package name, leaving only additional attributes.
        Object pkg = props.remove(ResourceType.PACKAGE.toString());
        // bundle symbolic name and version will be in additionalProps, so do not
        // need to be passed in separately.
        ExportedPackage info = modellingManager.getExportedPackage(this, pkg.toString(), props);
        packageCapabilities.add(info);
      } else if (ResourceType.SERVICE.toString().equals(capability.getName())) {
        String name = null;   // we've lost this irretrievably
        int ranking = 0;
        Collection<String> ifaces;
View Full Code Here

  public boolean equals(Object thing) {
    if (thing == this) {
      return true;
    } else {
      if (thing instanceof ExportedPackage) {
        ExportedPackage otherPackage = (ExportedPackage) thing;
        if (!this.getPackageName()
            .equals(otherPackage.getPackageName())) {
          return false;
        }
        if (!this.getVersion().equals(otherPackage.getVersion())) {
          return false;
        }
        if (!this.getPackageName()
            .equals(otherPackage.getPackageName())) {
          return false;
        }
       
        // We'll pick up the bundle comparisons in the attributes
        Map<String, Object> otherAttributes = otherPackage
            .getAttributes();

        if (!attributesAreEqual(otherAttributes)) {
          return false;
        }
View Full Code Here

    // 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();
      }
View Full Code Here

TOP

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

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.