Package org.osgi.service.indexer

Examples of org.osgi.service.indexer.Requirement


    LinkedList<Capability> caps = new LinkedList<Capability>();
    LinkedList<Requirement> reqs = new LinkedList<Requirement>();

    a.analyzeResource(new JarResource(new File("testdata/07-optionalimport.jar")), caps, reqs);

    Requirement pkgImport = findReqs("osgi.wiring.package", reqs).get(0);
    assertEquals("(&(osgi.wiring.package=org.example.a)(version>=1.0.0)(!(version>=2.0.0)))", pkgImport.getDirectives().get("filter"));
    assertEquals("optional", pkgImport.getDirectives().get("resolution"));
  }
View Full Code Here


    LinkedList<Capability> caps = new LinkedList<Capability>();
    LinkedList<Requirement> reqs = new LinkedList<Requirement>();

    a.analyzeResource(new JarResource(new File("testdata/08-fragmenthost.jar")), caps, reqs);

    Requirement req = findReqs("osgi.wiring.host", reqs).get(0);
    assertEquals("(&(osgi.wiring.host=org.example.a)(bundle-version>=0.0.0))", req.getDirectives().get("filter"));
  }
View Full Code Here

        }
        builder.append(')');
        filter = builder.toString();
      }

      Requirement requirement = new Builder().setNamespace(Namespaces.NS_EE).addDirective(Namespaces.DIRECTIVE_FILTER, filter).buildRequirement();
      reqs.add(requirement);
    }
  }
View Full Code Here

    }

    if (highest != null) {
      Version lower = new Version(highest.getMajor(), highest.getMinor(), 0);
      Version upper = new Version(highest.getMajor() + 1, 0, 0);
      Requirement requirement = createRequirement(new VersionRange(true, lower, upper, false));
      reqs.add(requirement);
    }
  }
View Full Code Here

    filter.insert(0, "(&");
    Util.addVersionFilter(filter, range, VersionKey.PackageVersion);
    filter.append(')');

    builder.addDirective(Namespaces.DIRECTIVE_FILTER, filter.toString()).addDirective(Namespaces.DIRECTIVE_EFFECTIVE, Namespaces.EFFECTIVE_ACTIVE);
    Requirement requirement = builder.buildRequirement();
    return requirement;
  }
View Full Code Here

        }
        builder.append(')');
        filter = builder.toString();
      }

      Requirement requirement = new Builder().setNamespace(Namespaces.NS_EE).addDirective(Namespaces.DIRECTIVE_FILTER, filter).buildRequirement();
      reqs.add(requirement);
    }
  }
View Full Code Here

    }

    if (highest != null) {
      Version lower = new Version(highest.getMajor(), highest.getMinor(), 0);
      Version upper = new Version(highest.getMajor() + 1, 0, 0);
      Requirement requirement = createRequirement(new VersionRange(true, lower, upper, false));
      reqs.add(requirement);
    }
  }
View Full Code Here

    filter.insert(0, "(&");
    Util.addVersionFilter(filter, range, VersionKey.PackageVersion);
    filter.append(')');

    builder.addDirective(Namespaces.DIRECTIVE_FILTER, filter.toString()).addDirective(Namespaces.DIRECTIVE_EFFECTIVE, Namespaces.EFFECTIVE_ACTIVE);
    Requirement requirement = builder.buildRequirement();
    return requirement;
  }
View Full Code Here

TOP

Related Classes of org.osgi.service.indexer.Requirement

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.