Package org.apache.aries.application.management

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


    try {     
      ByteArrayOutputStream bytesOut = new ByteArrayOutputStream();
      RepositoryGeneratorImpl.generateRepository(repositoryAdmin, appName + "_" + appVersion, byValueBundles, 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
    resolveRepos.add(repositoryAdmin.getSystemRepository());
View Full Code Here


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

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

     List<ImportedBundle> result = new ArrayList<ImportedBundle>();
     for (Content c : content) {
       try {
       result.add(modellingManager.getImportedBundle(c.getContentName(), c.getVersion().toString()));
       } catch (InvalidAttributeException iae) {
         throw new ResolverException(iae);
       }
     }
     log.debug(LOG_EXIT, "toImportedBundle", result);
     return result;
   }
View Full Code Here

     if ((bundleInfos != null) && (!!!bundleInfos.isEmpty())) {
       for (BundleInfo bi : bundleInfos) {
         try {
         result.add(modellingManager.getModelledResource(null, bi, null, null));
         } catch (InvalidAttributeException iae) {
           throw new ResolverException(iae);
         }
       }
     }
     return result;
   }
View Full Code Here

      Document doc;
      try {
        doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();

      } catch (ParserConfigurationException pce) {
        throw new ResolverException(pce);
      }
      Element root = doc.createElement("repository");

      root.setAttribute("name", repositoryName);
      doc.appendChild(root);
      for (ModelledResource mr : byValueBundles) {
        BundleResource bundleResource = new BundleResource(mr, repositoryAdmin);
        if (bundleResourceTransformers.size() > 0) {
          for (BundleResourceTransformer brt : bundleResourceTransformers) {
            bundleResource = brt.transform (bundleResource);
          }
        }
        writeResource (bundleResource, mr.getLocation(), doc, root);
      }

      try {
        Transformer trans = TransformerFactory.newInstance().newTransformer();
        trans.setOutputProperty(OutputKeys.INDENT, "yes");
        trans.transform(new DOMSource(doc), new StreamResult(os));
      } catch (TransformerException te) {
        logger.debug(LOG_EXIT, "generateRepository", te);
        throw new ResolverException(te);
      }
      logger.debug(LOG_EXIT, "generateRepository");
  }
View Full Code Here

              // list of packages available in the target runtime environment. If the resource has no symbolic name, we can ignore it
              if (r.getSymbolicName() != null) {
                try {
                  modelledResourceForThisMatch = new ModelledBundleResource (r, modellingManager, modellingHelper);
                } catch (InvalidAttributeException iax) {
                  ResolverException re = new ResolverException("Internal error occurred: " + iax);
                  log.debug(LOG_EXIT, "doResolve", re);
                  throw re;
                }
                toReturn.add(modelledResourceForThisMatch);
              }
            }
          }
          log.debug(LOG_EXIT, 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();
          Map<String, String> unsatisfiedRequirements = extractConsumableMessageInfo(refinedReqs);

          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 }));
          re.setUnsatisfiedRequirementsAndReasons(unsatisfiedRequirements);

          log.debug(LOG_EXIT, "doResolve", re);
          throw re;
        }
  }
View Full Code Here

    try {     
      ByteArrayOutputStream bytesOut = new ByteArrayOutputStream();
      RepositoryGeneratorImpl.generateRepository(repositoryAdmin, appName + "_" + appVersion, byValueBundles, 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
    resolveRepos.add(repositoryAdmin.getSystemRepository());
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[] { app.getApplicationMetadata().getApplicationName(), reqList }));
      re.setUnsatisfiedRequirementsAndReasons(unsatisfiedRequirements);
      log.debug(LOG_EXIT, "resolve", re);
     
      throw re;
    }
  }
View Full Code Here

     List<ImportedBundle> result = new ArrayList<ImportedBundle>();
     for (Content c : content) {
       try {
       result.add(modellingManager.getImportedBundle(c.getContentName(), c.getVersion().toString()));
       } catch (InvalidAttributeException iae) {
         throw new ResolverException(iae);
       }
     }
     log.debug(LOG_EXIT, "toImportedBundle", result);
     return result;
   }
View Full Code Here

     if ((bundleInfos != null) && (!!!bundleInfos.isEmpty())) {
       for (BundleInfo bi : bundleInfos) {
         try {
         result.add(modellingManager.getModelledResource(null, bi, null, null));
         } catch (InvalidAttributeException iae) {
           throw new ResolverException(iae);
         }
       }
     }
     return result;
   }
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.