Package org.apache.aries.application

Examples of org.apache.aries.application.DeploymentContent


   
    DeploymentMetadata dm = app.getDeploymentMetadata();
    List<DeploymentContent> dcList = dm.getApplicationDeploymentContents();

    assertEquals (2, dcList.size());
    DeploymentContent dc1 = new DeploymentContentImpl ("foo.bar.widgets;deployed-version=1.1.0");
    DeploymentContent dc2 = new DeploymentContentImpl ("my.business.logic;deployed-version=1.1.0");
    DeploymentContent dc3 = new DeploymentContentImpl ("a.handy.persistence.library;deployed-version=1.1.0");
    assertTrue (dcList.contains(dc1));
    assertTrue (dcList.contains(dc2));
   
    dcList = dm.getApplicationProvisionBundles();
   
View Full Code Here


     
      DeploymentMetadata dm = app.getDeploymentMetadata();
      List<DeploymentContent> dcList = dm.getApplicationDeploymentContents();

      assertEquals (2, dcList.size());
      DeploymentContent dc1 = new DeploymentContentImpl ("hello.world.jar;deployed-version=1.1.0");
      DeploymentContent dc2 = new DeploymentContentImpl ("helloWorld.war;deployed-version=0.0.0");
      DeploymentContent dc3 = new DeploymentContentImpl ("a.handy.persistence.library;deployed-version=1.1.0");
      assertTrue (dcList.contains(dc1));
      assertTrue (dcList.contains(dc2));
     
      dcList = dm.getApplicationProvisionBundles();
     
View Full Code Here

   
    Map<DeploymentContent, BundleSuggestion> urlToBeInstalled = new HashMap<DeploymentContent, BundleSuggestion>();
    Iterator<DeploymentContent> it = content.iterator();
   
    while (it.hasNext()) {
      DeploymentContent bundleToFind = it.next();

      Map<Version, List<BundleSuggestion>> bundlesuggestions = new HashMap<Version, List<BundleSuggestion>>();

      for (BundleRepository obj : providers) {
        BundleSuggestion suggestion = obj.suggestBundleToUse(bundleToFind);

        if (suggestion != null) {
          List<BundleSuggestion> suggestions = bundlesuggestions.get(suggestion.getVersion());

          if (suggestions == null) {
            suggestions = new ArrayList<BundleSuggestion>();
            bundlesuggestions.put(suggestion.getVersion(), suggestions);
          }

          suggestions.add(suggestion);
        }
      }

      BundleSuggestion suggestion = null;

      if (!!!bundlesuggestions.isEmpty()) {

        List<BundleSuggestion> thoughts = bundlesuggestions.get(bundleToFind.getExactVersion());

        if (thoughts != null) {
          Collections.sort(thoughts, new Comparator<BundleSuggestion>() {
            public int compare(BundleSuggestion o1, BundleSuggestion o2)
            {
              return o1.getCost() - o2.getCost();
            }
          });
 
          suggestion = thoughts.get(0);
        }
      }

      // add the suggestion to the list
      if (suggestion != null) {
        urlToBeInstalled.put(bundleToFind, suggestion);
      } else {
        throw new ContextException("Unable to find bundle "+bundleToFind.getContentName() + "/" + bundleToFind.getExactVersion());
      }
    }
   
    LOGGER.debug(LOG_EXIT, "getBundleSuggestions", new Object[] { urlToBeInstalled });
View Full Code Here

   
    for (BundleInfo info : bundlesRequired) {
     
      VersionRange appContentRange = appContent.get(info.getSymbolicName());
      VersionRange useBundleRange = useBundles.get(info.getSymbolicName());
      DeploymentContent dp = new DeploymentContentImpl(info.getSymbolicName(), info.getVersion());
     
      if ((appContentRange == null) && (useBundleRange == null)){
        _provisionSharedContent.add(dp);
      } else if (appContentRange.matches(info.getVersion())) {
        _deploymentContent.add(dp);
View Full Code Here

      Bundle[] sharedBundles = _bundleFrameworkManager.getSharedBundleFramework()
          .getIsolatedBundleContext().getBundles();
      if (shared) {
        if (sharedBundles.length > 0) {
          while (it.hasNext()) {
            DeploymentContent bundleToFind = it.next();

            for (Bundle b : sharedBundles) {
              if (bundleToFind.getContentName().equals(b.getSymbolicName())
                  && bundleToFind.getExactVersion().equals(b.getVersion())) {
                it.remove();
                _bundles.add(b);
                break;
              }
            }
View Full Code Here

   
    for (BundleInfo info : bundlesRequired) {
     
      VersionRange appContentRange = appContent.get(info.getSymbolicName());
      VersionRange useBundleRange = useBundles.get(info.getSymbolicName());
      DeploymentContent dp = new DeploymentContentImpl(info.getSymbolicName(), info.getVersion());
     
      if ((appContentRange == null) && (useBundleRange == null)){
        _provisionSharedContent.add(dp);
      } else if (appContentRange.matches(info.getVersion())) {
        _deploymentContent.add(dp);
View Full Code Here

   
    DeploymentMetadata dm = app.getDeploymentMetadata();
    List<DeploymentContent> dcList = dm.getApplicationDeploymentContents();

    assertEquals (2, dcList.size());
    DeploymentContent dc1 = new DeploymentContentImpl ("foo.bar.widgets;deployed-version=1.1.0");
    DeploymentContent dc2 = new DeploymentContentImpl ("my.business.logic;deployed-version=1.1.0");
    DeploymentContent dc3 = new DeploymentContentImpl ("a.handy.persistence.library;deployed-version=1.1.0");
    assertTrue (dcList.contains(dc1));
    assertTrue (dcList.contains(dc2));
   
    dcList = dm.getApplicationProvisionBundles();
   
View Full Code Here

   
    for (BundleInfo info : bundlesRequired) {
     
      VersionRange range = appContent.get(info.getSymbolicName());
     
      DeploymentContent dp = new DeploymentContentImpl(info.getSymbolicName(), info.getVersion());
     
      if (range == null) {
        _provisionSharedContent.add(dp);
      } else if (range.matches(info.getVersion())) {
        _deploymentContent.add(dp);
View Full Code Here

      Bundle[] sharedBundles = _bundleFrameworkManager.getSharedBundleFramework()
          .getIsolatedBundleContext().getBundles();
      if (shared) {
        if (sharedBundles.length > 0) {
          while (it.hasNext()) {
            DeploymentContent bundleToFind = it.next();

            for (Bundle b : sharedBundles) {
              if (bundleToFind.getContentName().equals(b.getSymbolicName())
                  && bundleToFind.getExactVersion().equals(b.getVersion())) {
                it.remove();
                _bundles.add(b);
                break;
              }
            }
View Full Code Here

   
    DeploymentMetadata dm = app.getDeploymentMetadata();
    List<DeploymentContent> dcList = dm.getApplicationDeploymentContents();

    assertEquals (2, dcList.size());
    DeploymentContent dc1 = new DeploymentContentImpl ("foo.bar.widgets;deployed-version=1.1.0");
    DeploymentContent dc2 = new DeploymentContentImpl ("my.business.logic;deployed-version=1.1.0");
    DeploymentContent dc3 = new DeploymentContentImpl ("a.handy.persistence.library;deployed-version=1.1.0");
    assertTrue (dcList.contains(dc1));
    assertTrue (dcList.contains(dc2));
   
    dcList = dm.getApplicationProvisionBundles();
   
View Full Code Here

TOP

Related Classes of org.apache.aries.application.DeploymentContent

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.