Package org.apache.aries.application

Examples of org.apache.aries.application.Content


    }
    return new ModellingManagerImpl().getModelledResource(null, att, null, null);
  }
 
  private Content mockContent(String symbolicName, String version) {
    Content bundle = Skeleton.newMock(Content.class);
    VersionRange vr = new VersionRange(version);
    Skeleton.getSkeleton(bundle).setReturnValue(new MethodCall(Content.class, "getContentName"), symbolicName);
    Skeleton.getSkeleton(bundle).setReturnValue(new MethodCall(Content.class, "getVersion"), vr);
   
       return bundle;
View Full Code Here


    assertEquals (appMeta.getApplicationName(), "Test application");
    assertEquals (appMeta.getApplicationSymbolicName(), "org.apache.aries.application.management.test");
    assertEquals (appMeta.getApplicationVersion(), new Version("1.0"));
    List<Content> appContent = appMeta.getApplicationContents();
    assertEquals (appContent.size(), 2);
    Content fbw = new ContentImpl("foo.bar.widgets;version=1.0.0");
    Content mbl = new ContentImpl("my.business.logic;version=1.0.0");
    assertTrue (appContent.contains(fbw));
    assertTrue (appContent.contains(mbl));
   
    DeploymentMetadata dm = app.getDeploymentMetadata();
    List<DeploymentContent> dcList = dm.getApplicationDeploymentContents();
View Full Code Here

    _symbolicName = appName;
    _version = appVersion;
   
    for (int i = 0; i < appContent.size(); i++) {
      Content c = appContent.get(i);
     
      String comment = "Requires " + Resource.SYMBOLIC_NAME + " " + c.getContentName() + " with attributes " + c.getAttributes();
     
      String resolution = c.getDirective("resolution");

      boolean optional = Boolean.valueOf(resolution);
     
      String f = ManifestHeaderProcessor.generateFilter(Resource.SYMBOLIC_NAME, c.getContentName(), c.getAttributes());
      Filter filter;
      try {
        filter = FrameworkUtil.createFilter(f);
        _requirements.add(new RequirementImpl("bundle", new FilterWrapper(filter), false, optional, false, comment));
      } catch (InvalidSyntaxException e) {
View Full Code Here

        _symbolicName = appName;
        _version = appVersion;

        _requirements = new Requirement[appContent.size()];
        for (int i = 0; i < _requirements.length; i++) {
            Content c = appContent.get(i);

            String comment = "Requires " + Resource.SYMBOLIC_NAME + " " + c.getContentName()
                             + " with attributes " + c.getAttributes();

            String resolution = c.getDirective("resolution");

            boolean optional = Boolean.valueOf(resolution);

            String f = ManifestHeaderProcessor.generateFilter(Resource.SYMBOLIC_NAME, c.getContentName(), c.getAttributes());
            Filter filter = repositoryAdmin.getHelper().filter(f);
            _requirements[i] = new RequirementImpl("bundle", filter, false, optional, false, comment);
        }
    }
View Full Code Here

  private Set<Content> getContentSetFromHeader (Attributes attributes, String key) {
    String header = _attributes.getValue(key);
    List<String> splitHeader = ManifestHeaderProcessor.split(header, ",");
    HashSet<Content> result = new HashSet<Content>();
    for (String s: splitHeader) {
      Content c = _applicationMetadataFactory.parseContent(s);
      result.add(c);
    }
    return result;
  }
View Full Code Here

   * @param service A single service string value from the Import-Services or Export-Services header
   * @throws InvalidSyntaxException
   */
  public ServiceDeclarationImpl(String service) throws InvalidSyntaxException
  {
    Content content = new ContentImpl(service);
    this.interfaceName = content.getContentName();
    String filterString = content.getAttribute(FILTER);
    if (filterString != null) {
      try {
        this.filter = FrameworkUtil.createFilter(filterString);
      } catch (InvalidSyntaxException ise) {       
        throw new InvalidSyntaxException("Failed to create filter for " + service, ise.getFilter(), ise.getCause());
View Full Code Here

    //If we pass in provision bundles (e.g. import deployment manifest sanity check), we add them into our bundlesToResolve set.
    // This is because we want to make sure all bundles we passed into resolver the same as what we are going to get from resolver.
    List<Content> restrictedReqs = new ArrayList<Content>();
    for (ResolveConstraint constraint : constraints ) {
      Content content = ContentFactory.parseContent(constraint.getBundleName(), constraint.getVersionRange().toString());
      restrictedReqs.add(content);
    }
   
    DeployedBundles deployedBundles = generateDeployedBundles (appMetadata,
        byValueBundles, restrictedReqs);
View Full Code Here

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

      Content ib = ContentFactory.parseContent(mr.getExportedBundle().getSymbolicName(),
          exactVersion);
      requiredSharedBundles.add(ib);

    }
    // This will throw a ResolverException if the shared content does not resolve
View Full Code Here

    //If we pass in provision bundles (e.g. import deployment manifest sanity check), we add them into our bundlesToResolve set.
    // This is because we want to make sure all bundles we passed into resolver the same as what we are going to get from resolver.
    List<Content> restrictedReqs = new ArrayList<Content>();
    for (ResolveConstraint constraint : constraints ) {
      Content content = ManifestHeaderProcessor.parseContent(constraint.getBundleName(), constraint.getVersionRange().toString());
      restrictedReqs.add(content);
    }
   
    DeployedBundles deployedBundles = generateDeployedBundles (appMetadata,
        byValueBundles, restrictedReqs);
View Full Code Here

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

      Content ib = ManifestHeaderProcessor.parseContent(mr.getExportedBundle().getSymbolicName(),
          exactVersion);
      requiredSharedBundles.add(ib);

    }
    // This will throw a ResolverException if the shared content does not resolve
View Full Code Here

TOP

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

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.