Package org.apache.aries.application.management

Examples of org.apache.aries.application.management.ResolverException


    AriesApplicationImpl application = new AriesApplicationImpl(originalApp.getApplicationMetadata(), originalApp.getBundleInfo(), _localPlatform);
    Manifest deploymentManifest = deploymentManifestManager.generateDeploymentManifest(originalApp, constraints);
    try {
      application.setDeploymentMetadata(_deploymentMetadataFactory.createDeploymentMetadata(deploymentManifest));
    } catch (IOException ioe) {
      throw new ResolverException(ioe);
    }
    // Store a reference to any modified bundles
    if (originalApp instanceof AriesApplicationImpl) {
      // TODO: are we really passing streams around ?
      application.setModifiedBundles(((AriesApplicationImpl) originalApp).getModifiedBundles());
View Full Code Here


      appRepoURL = f.toURI().toURL();
     
      repositoryAdmin.addRepository(appRepoURL);
      f.delete();
    } catch (Exception e) {
      throw new ResolverException(e);
    }
   
    try {
      if (obrResolver.resolve()) {
        Set<BundleInfo> result = new HashSet<BundleInfo>();
        for (Resource resource: obrResolver.getRequiredResources()) {
          BundleInfo bundleInfo = toBundleInfo(resource);
          result.add(bundleInfo);
        }
        for (Resource resource: obrResolver.getOptionalResources()) {
          BundleInfo bundleInfo = toBundleInfo(resource);
          result.add(bundleInfo);
        }
        return result;
      } else {
        throw new ResolverException("Could not resolve requirements: " + getUnsatisfiedRequirements(obrResolver));
      }
    } finally {
      if (appRepoURL != null) {
        repositoryAdmin.removeRepository(appRepoURL);
      }
View Full Code Here

        _deploymentContent.add(dp);
      else if (useBundleRange.matches(info.getVersion())) {
        _deployedUseBundleContent.add(dp);
      }
      else {
        throw new ResolverException("Bundle " + info.getSymbolicName() + " at version " + info.getVersion() + " is not in the range " + appContentRange + " or " + useBundleRange);
      }
    }
  }
View Full Code Here

        _deploymentContent.add(dp);
      else if (useBundleRange.matches(info.getVersion())) {
        _deployedUseBundleContent.add(dp);
      }
      else {
        throw new ResolverException("Bundle " + info.getSymbolicName() + " at version " + info.getVersion() + " is not in the range " + appContentRange + " or " + useBundleRange);
      }
    }
  }
View Full Code Here

      }

      int buffLen = buff.length();
      String pkgString = (buffLen > 0 ? buff.substring(0, buffLen - 2) : "");

      ResolverException re = new ResolverException(MessageUtil.getMessage(
          "INCOMPATIBLE_PACKAGE_VERSION_REQUIREMENTS", new Object[] { assetName, pkgString }));
      re.setUnsatisfiedRequirements(pkgNames);
      logger.debug(LOG_EXIT,"getExternalPackageRequirements", re);
     
      throw re;
    }
   
View Full Code Here

      for (String name : req.getAttributes().keySet())
      {
        if (Constants.BUNDLE_SYMBOLICNAME_ATTRIBUTE.equals(name)
            || Constants.BUNDLE_VERSION_ATTRIBUTE.equals(name))
        {
          ResolverException re = new ResolverException(MessageUtil.getMessage(
              "INVALID_PACKAGE_REQUIREMENT_ATTRIBUTES", new Object[] { assetName, name, pkgName }));
          re.setUnsatisfiedRequirements(Arrays.asList(pkgName));
          logger.debug(LOG_EXIT, "validateOtherImports", re);
          throw re;
        }
      }
    }
View Full Code Here

   
    public AriesApplication resolve(AriesApplication app, ResolveConstraint... constraints) throws ResolverException {
        try {
            return getAriesApplicationManager().resolve(app, constraints);
        } catch (ManagementException e) {
            throw new ResolverException(e);
        }
    }
View Full Code Here

            TransformerFactory.newInstance().newTransformer().transform(new DOMSource(doc), new StreamResult(bytesOut));

            appRepo = helper.readRepository(new InputStreamReader(new ByteArrayInputStream(bytesOut.toByteArray())));
        } catch (Exception e) {
            throw new ResolverException(e);
        }

        List<Repository> resolveRepos = new ArrayList<Repository>();

        // add system repository
View Full Code Here

        for (String reason : unsatisfiedRequirements.keySet()) {
            reqList.append('\n');
            reqList.append(reason);
        }

        ResolverException re = new ResolverException(MessageUtil.getMessage("RESOLVER_UNABLE_TO_RESOLVE",
                new Object[] { appName, reqList }));
        List<String> list = new ArrayList<String>();
        list.addAll(unsatisfiedRequirements.keySet());
        re.setUnsatisfiedRequirements(list);

        return re;
    }
View Full Code Here

          if (r.getSymbolicName() != null) {
            try {
              modelledResourceForThisMatch = new ModelledBundleResource (r, modellingManager, modellingHelper);
            } catch (InvalidAttributeException iax) {
             
              ResolverException re = new ResolverException("Internal error occurred: " + iax.toString());
              log.debug(LOG_EXIT, "resolve", re);
             
              throw re;
            }
            toReturn.add(modelledResourceForThisMatch);
          }
        }
      }
      log.debug(LOG_EXIT, "resolve", toReturn);
      return toReturn;
    } else {
      Reason[] reasons = obrResolver.getUnsatisfiedRequirements();
      // let's refine the list by removing the indirect unsatisfied bundles that are caused by unsatisfied packages or other bundles
      Map<String,Set<String>> refinedReqs = refineUnsatisfiedRequirements(obrResolver, reasons);
      StringBuffer reqList = new StringBuffer();
      List<String> unsatisfiedRequirements = new LinkedList<String>();

      for (Map.Entry<String, Set<String>> filterEntry : refinedReqs.entrySet()) {
        log.debug("unable to satisfy the filter , filter = " + filterEntry.getKey() + "required by "+filterEntry.getValue());
      
        String reason = extractConsumableMessageInfo(filterEntry.getKey(),filterEntry.getValue());

        reqList.append('\n');
        reqList.append(reason);
        unsatisfiedRequirements.add(reason);
      }

      ResolverException re = new ResolverException(MessageUtil.getMessage("RESOLVER_UNABLE_TO_RESOLVE",
          new Object[] { appName, reqList }));
      re.setUnsatisfiedRequirements(unsatisfiedRequirements);
      log.debug(LOG_EXIT, "resolve", re);
     
      throw re;
    }
   
View Full Code Here

TOP

Related Classes of org.apache.aries.application.management.ResolverException

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.