Package org.apache.aries.application.modelling

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


      Collection<ImportedBundle> appUseBundleNames,
      Collection<ModelledResource> fakeServiceProvidingBundles)
  {
    logger.debug(LOG_ENTRY, "createDeployedBundles", new Object[]{assetName,
        appContentNames, appUseBundleNames, fakeServiceProvidingBundles})
    DeployedBundles result = new DeployedBundlesImpl (assetName,
        appContentNames, appUseBundleNames, fakeServiceProvidingBundles);
    logger.debug(LOG_EXIT, "createDeployedBundles", result);
    return result;
  }
View Full Code Here


    for (ResolveConstraint constraint : constraints ) {
      Content content = ManifestHeaderProcessor.parseContent(constraint.getBundleName(), constraint.getVersionRange().toString());
      restrictedReqs.add(content);
    }
   
    DeployedBundles deployedBundles = generateDeployedBundles (appMetadata,
        byValueBundles, restrictedReqs);
   
    Manifest man = generateDeploymentManifest(appMetadata.getApplicationSymbolicName(),
        appMetadata.getApplicationVersion().toString(), deployedBundles);
    _logger.debug(LOG_EXIT, "generateDeploymentManifest", new Object[] {man});
View Full Code Here

   
    String appSymbolicName = appMetadata.getApplicationSymbolicName();
    String appVersion = appMetadata.getApplicationVersion().toString();
    String uniqueName = appSymbolicName + "_" + appVersion;
   
    DeployedBundles deployedBundles = modellingHelper.createDeployedBundles(appSymbolicName, appContentIB, useBundleIB, Arrays.asList(fakeBundleResource));
    Collection<ModelledResource> bundlesToBeProvisioned = resolver.resolve(
        appSymbolicName, appVersion, byValueBundles, bundlesToResolve);
    pruneFakeBundleFromResults (bundlesToBeProvisioned);

    if (bundlesToBeProvisioned.isEmpty()) {
      throw new ResolverException(MessageUtil.getMessage("EMPTY_DEPLOYMENT_CONTENT",uniqueName));
    }
    for (ModelledResource rbm : bundlesToBeProvisioned)
    {
      deployedBundles.addBundle(rbm);
    }
    Collection<ModelledResource> requiredUseBundle = deployedBundles.getRequiredUseBundle();
    if (requiredUseBundle.size() < useBundleSet.size())
    {
      // Some of the use-bundle entries were redundant so resolve again with just the good ones.
      deployedBundles = modellingHelper.createDeployedBundles(appSymbolicName, appContentIB, useBundleIB, Arrays.asList(fakeBundleResource));
      bundlesToResolve.clear();
      bundlesToResolve.addAll(appContent);
      Collection<ImportedBundle> slimmedDownUseBundle = narrowUseBundles(useBundleIB, requiredUseBundle);
      bundlesToResolve.addAll(toContent(slimmedDownUseBundle));
      bundlesToBeProvisioned = resolver.resolve(appSymbolicName, appVersion, byValueBundles, bundlesToResolve);
      pruneFakeBundleFromResults (bundlesToBeProvisioned);
      for (ModelledResource rbm : bundlesToBeProvisioned)
      {
        deployedBundles.addBundle(rbm);
      }
    }

    // Check for circular dependencies. No shared bundle can depend on any
    // isolated bundle.
    Collection<ModelledResource> sharedBundles = new HashSet<ModelledResource>();
    sharedBundles.addAll (deployedBundles.getDeployedProvisionBundle());
    sharedBundles.addAll (deployedBundles.getRequiredUseBundle());

    Collection<ModelledResource> appContentBundles = deployedBundles.getDeployedContent();
    Collection<Content> requiredSharedBundles = new ArrayList<Content>();
    for (ModelledResource mr : sharedBundles) {
      String version = mr.getExportedBundle().getVersion();
      String exactVersion = "[" + version + "," + version + "]";
View Full Code Here

  {
   
    Skeleton.getSkeleton(appMetadata).setReturnValue(new MethodCall(ApplicationMetadata.class, "getApplicationContents"), Arrays.asList(mockContent("aries.test.a", "1.0.0"), mockContent("aries.test.b", "[1.0.0, 2.0.0)" )));
    Skeleton.getSkeleton(appMetadata).setReturnValue(new MethodCall(ApplicationMetadata.class, "getUseBundles"), Arrays.asList(BUNDLE_C, BUNDLE_D));
   
    DeployedBundles deployedBundles = deplMFMgr.generateDeployedBundles (appMetadata,
        new ArrayList<ModelledResource>(), Collections.<Content>emptyList());
    Manifest man = deplMFMgr.generateDeploymentManifest(appMetadata.getApplicationSymbolicName(),
        appMetadata.getApplicationVersion().toString(), deployedBundles);
   
    Attributes attrs = man.getMainAttributes();
View Full Code Here

    _resolver.addResult(cmr);
    Skeleton.getSkeleton(appMetadata).setReturnValue(new MethodCall(ApplicationMetadata.class, "getApplicationContents"), Arrays.asList(mockContent("test.isolated" , "1.0.0")));
   
   
    try {
      DeployedBundles deployedBundles = deplMFMgr.generateDeployedBundles (appMetadata,
          new ArrayList<ModelledResource>(), new ArrayList<Content>());
      deplMFMgr.generateDeploymentManifest(appMetadata.getApplicationSymbolicName(),
          appMetadata.getApplicationVersion().toString(), deployedBundles);
    } catch (ResolverException rx) {
      List<String> usr = rx.getUnsatisfiedRequirements();
View Full Code Here

   
    app = Skeleton.newMock(AriesApplication.class);
    Skeleton.getSkeleton(app).setReturnValue(new MethodCall(AriesApplication.class, "getApplicationMetadata"), appMetadata);
   
    try {
      DeployedBundles deployedBundles = deplMFMgr.generateDeployedBundles (appMetadata,
          Arrays.asList(new ModelledResource[] {testIsolated1.getBundle(), testIsolated2.getBundle()}),
          new ArrayList<Content>());
      deplMFMgr.generateDeploymentManifest(appMetadata.getApplicationSymbolicName(),
          appMetadata.getApplicationVersion().toString(), deployedBundles);
    } catch (ResolverException rx) {
View Full Code Here

    app = Skeleton.newMock(AriesApplication.class);
    Skeleton.getSkeleton(app).setReturnValue(new MethodCall(AriesApplication.class, "getApplicationMetadata"), appMetadata);
   
    try {
      DeployedBundles deployedBundles = deplMFMgr.generateDeployedBundles (appMetadata,
          Arrays.asList(new ModelledResource[] {cmr.get(0), cmr.get(2), cmr.get(3)}),
          new ArrayList<Content>());
      deplMFMgr.generateDeploymentManifest(appMetadata.getApplicationSymbolicName(),
          appMetadata.getApplicationVersion().toString(), deployedBundles);
     
View Full Code Here

            mockContent("test.bundle", "1.0.0")));

    app = Skeleton.newMock(AriesApplication.class);
    Skeleton.getSkeleton(app).setReturnValue(new MethodCall(AriesApplication.class, "getApplicationMetadata"), appMetadata);
   
    DeployedBundles deployedBundles = deplMFMgr.generateDeployedBundles (appMetadata,
        Arrays.asList(new ModelledResource[] {cmr.get(0), cmr.get(1)}),
        new ArrayList<Content>());
    Manifest mf = deplMFMgr.generateDeploymentManifest(appMetadata.getApplicationSymbolicName(),
        appMetadata.getApplicationVersion().toString(), deployedBundles);
   
View Full Code Here

        Arrays.asList(mockContent("test.api", "1.0.0")));

    app = Skeleton.newMock(AriesApplication.class);
    Skeleton.getSkeleton(app).setReturnValue(new MethodCall(AriesApplication.class, "getApplicationMetadata"), appMetadata);
   
    DeployedBundles deployedBundles = deplMFMgr.generateDeployedBundles (appMetadata,
        Arrays.asList(new ModelledResource[] {cmr.get(0), cmr.get(2), cmr.get(3)}),
        new ArrayList<Content>());
   
    Manifest mf = deplMFMgr.generateDeploymentManifest(appMetadata.getApplicationSymbolicName(),
        appMetadata.getApplicationVersion().toString(), deployedBundles);
View Full Code Here

  }

  @Test
  public void testGetImportPackage_InvalidDuplicatesWithAttributes() throws Exception
  {
    DeployedBundles deployedBundles = getSimpleDeployedBundles(ternary.CONTENT, ternary.CONTENT, ternary.NONE);
   
    deployedBundles.addBundle(createModelledResource("bundle.a", "1.0.0",
        Arrays.asList("package.c;version=1.0.0;was_internal=true"), new ArrayList<String>()));
    deployedBundles.addBundle(createModelledResource("bundle.b", "1.0.0",
        Arrays.asList("package.c;version=2.0.0"), new ArrayList<String>()));
    deployedBundles.addBundle(createModelledResource("bundle.c", "1.0.0",
        new ArrayList<String>(), Arrays.asList("package.c;version=2.0.0;was_internal=true")));

    // Check that the incompatible package requirement attributes cause an exception.
    String importPackageEntry = null;
    try
    {
      importPackageEntry = deployedBundles.getImportPackage();
      Assert.fail("Expected exception. ImportPackage=" + importPackageEntry);
    }
    catch (ResolverException e)
    {
      // We expect to reach this point if the test passes.
View Full Code Here

TOP

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

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.