Package org.apache.aries.application

Examples of org.apache.aries.application.Content


    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


      assertEquals (appMeta.getApplicationName(), "conversion.eba");    
      assertEquals (appMeta.getApplicationSymbolicName(), "conversion.eba");     
      assertEquals (appMeta.getApplicationVersion(), new Version("0.0"));     
      List<Content> appContent = appMeta.getApplicationContents();
      assertEquals (2, appContent.size());
      Content fbw = new ContentImpl("hello.world.jar;version=\"[1.1.0, 1.1.0]\"");
      Content mbl = new ContentImpl("helloWorld.war;version=\"[0.0.0, 0.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;
   
    _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;
      try {
        filter = FrameworkUtil.createFilter(f);
        _requirements[i] = new RequirementImpl("bundle", new FilterWrapper(filter), false, optional, false, comment);
      } catch (InvalidSyntaxException e) {
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 = new ContentImpl(s);
      result.add(c);
    }
    return result;
  }
View Full Code Here

    assertEquals("Travel Reservation", app.getApplicationName());
    assertEquals("com.travel.reservation", app.getApplicationSymbolicName());
    assertEquals(Version.parseVersion("1.2.0"), app.getApplicationVersion());
    List<Content> appContents = app.getApplicationContents();
    assertEquals(2, appContents.size());
    Content appContent1 = new ContentImpl("com.travel.reservation.business");
    Map<String, String> attrs = new HashMap<String, String>();
    attrs.put("version", "\"[1.1.0,1.2.0)\"");
    Content appContent2 = new ContentImpl("com.travel.reservation.web", attrs);
    assertTrue(appContents.contains(appContent2));
    assertTrue(appContents.contains(appContent1));
    List<ServiceDeclaration> importedService = app.getApplicationImportServices();
    assertEquals(2, importedService.size());
    assertTrue(importedService.contains(new ServiceDeclarationImpl("com.travel.flight.api")));
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

  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 = new ContentImpl(s);
      result.add(c);
    }
    return result;
  }
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;
      try {
        filter = FrameworkUtil.createFilter(f);
        _requirements[i] = new RequirementImpl("bundle", new FilterWrapper(filter), false, optional, false, comment);
      } catch (InvalidSyntaxException e) {
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

    Collection<String> packages = new ArrayList<String>();
    Map<String, String> maps = new HashMap<String, String>();
    maps.put("version", "0.0.0");
    maps.put("bundle-symbolic-name", "use.bundle.by.reference");
    maps.put("bundle-version", "[1.0.0,1.0.0]");
    Content useContent = ContentFactory.parseContent("a.b.c", maps);
    assertTrue("Use Bundle not found in import packags", importPackages.contains(useContent));
   
    for (Content c : importPackages) {
      packages.add(c.getContentName());
    }
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.