org.apache.felix.resolver.Util类的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(7.1k)|赞(0)|评价(0)|浏览(290)

本文整理了Java中org.apache.felix.resolver.Util类的一些代码示例,展示了Util类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util类的具体详情如下:
包路径:org.apache.felix.resolver.Util
类名称:Util

Util介绍

暂无

代码示例

代码示例来源:origin: org.eclipse/osgi

  1. ? Util.getDynamicRequirements(wiring.getResourceRequirements(null))
  2. : Util.getDynamicRequirements(resource.getRequirements(null));
  3. for (Requirement req : reqs)

代码示例来源:origin: org.eclipse/osgi

  1. String resSymName = Util.getSymbolicName(req.getResource());
  2. Version resVersion = Util.getVersion(req.getResource());

代码示例来源:origin: forge/roaster

  1. public static boolean isMultiple(Requirement req)
  2. {
  3. return Namespace.CARDINALITY_MULTIPLE.equals(req.getDirectives()
  4. .get(Namespace.REQUIREMENT_CARDINALITY_DIRECTIVE)) && !isDynamic(req);
  5. }

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.osgi

  1. private boolean isMandatory(ResolveContext rc, Requirement requirement) {
  2. // The requirement is optional
  3. if (Util.isOptional(requirement)) {
  4. return false;
  5. }
  6. // This is a fragment that is already resolved and there is no unresolved hosts to attach it to
  7. Resource resource = requirement.getResource();
  8. if (Util.isFragment(resource) && rc.getWirings().containsKey(resource)) {
  9. return false;
  10. }
  11. return true;
  12. }

代码示例来源:origin: org.eclipse/osgi

  1. private static void permutate(
  2. Candidates allCandidates, Requirement req, List<Candidates> permutations)
  3. {
  4. if (!Util.isMultiple(req))
  5. {
  6. List<Capability> candidates = allCandidates.getCandidates(req);
  7. if ((candidates != null) && (candidates.size() > 1 || Util.isOptional(req)))
  8. {
  9. Candidates perm = allCandidates.copy();
  10. candidates = perm.getCandidates(req);
  11. candidates.remove(0);
  12. if (candidates.isEmpty())
  13. {
  14. perm.clearCandidates(req);
  15. }
  16. permutations.add(perm);
  17. }
  18. }
  19. }

代码示例来源:origin: org.eclipse/osgi

  1. : Util.getDynamicRequirements(wiring.getResourceRequirements(null)))
  2. if (!Util.isDynamic(req))
  3. if (Util.isMultiple(req))

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.osgi

  1. public void permutate(Requirement req, List<Candidates> permutations)
  2. {
  3. if (!Util.isMultiple(req) && canRemoveCandidate(req))
  4. {
  5. Candidates perm = copy();
  6. perm.removeFirstCandidate(req);
  7. permutations.add(perm);
  8. }
  9. }

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.osgi

  1. public Map<Resource, Resource> getHosts()
  2. {
  3. Map<Resource, Resource> hosts = new HashMap<Resource, Resource>();
  4. for (Resource res : m_mandatoryResources)
  5. {
  6. if (res instanceof WrappedResource)
  7. {
  8. res = ((WrappedResource) res).getDeclaredResource();
  9. }
  10. if (!Util.isFragment(res))
  11. {
  12. hosts.put(res, getWrappedHost(res));
  13. }
  14. }
  15. for (Capability cap : m_dependentMap.keySet())
  16. {
  17. Resource res = cap.getResource();
  18. if (res instanceof WrappedResource)
  19. {
  20. res = ((WrappedResource) res).getDeclaredResource();
  21. }
  22. if (!Util.isFragment(res))
  23. {
  24. hosts.put(res, getWrappedHost(res));
  25. }
  26. }
  27. return hosts;
  28. }

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.osgi

  1. public boolean canRemoveCandidate(Requirement req)
  2. {
  3. List<Capability> candidates = m_candidateMap.get(req);
  4. return ((candidates != null) && (candidates.size() > 1 || Util.isOptional(req)));
  5. }

代码示例来源:origin: forge/roaster

  1. + Util.getSymbolicName(m_resource)
  2. + " [" + m_resource
  3. + "] because it exports package '"
  4. + m_pkgName
  5. + "' and is also exposed to it from resource "
  6. + Util.getSymbolicName(m_blame1.m_cap.getResource())
  7. + " [" + m_blame1.m_cap.getResource()
  8. + "] via the following dependency chain:\n\n"
  9. + Util.getSymbolicName(m_resource)
  10. + " [" + m_resource
  11. + "] because it is exposed to package '"
  12. + m_pkgName
  13. + "' from resources "
  14. + Util.getSymbolicName(m_blame1.m_cap.getResource())
  15. + " [" + m_blame1.m_cap.getResource()
  16. + "] and "
  17. + Util.getSymbolicName(m_blame2.m_cap.getResource())
  18. + " [" + m_blame2.m_cap.getResource()
  19. + "] via two dependency chains.\n\nChain 1:\n"

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.osgi

  1. .equals(BundleNamespace.BUNDLE_NAMESPACE))
  2. if (Util.isReexport(w.getRequirement()))
  3. if (Util.isReexport(req))

代码示例来源:origin: com.github.veithen.cosmos/cosmos-equinox

  1. : Util.getDynamicRequirements(wiring.getResourceRequirements(null)))
  2. if (!Util.isDynamic(req))
  3. if (Util.isMultiple(req))

代码示例来源:origin: forge/roaster

  1. private boolean permuteUsedBlameRequirement(Requirement req, Set<Requirement> mutated, Candidates permutation)
  2. {
  3. // Sanity check for multiple.
  4. if (Util.isMultiple(req))
  5. {
  6. return false;
  7. }
  8. // If we've already permutated this requirement in another
  9. // uses constraint, don't permutate it again just continue
  10. // with the next uses constraint.
  11. if (mutated.contains(req))
  12. {
  13. return true;
  14. }
  15. // See if we can permutate the candidates for blamed
  16. // requirement; there may be no candidates if the resource
  17. // associated with the requirement is already resolved.
  18. if (permutation.canRemoveCandidate(req))
  19. {
  20. permutation.removeFirstCandidate(req);
  21. mutated.add(req);
  22. return true;
  23. }
  24. return false;
  25. }

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.osgi

  1. public Map<Resource, Resource> getHosts()
  2. {
  3. Map<Resource, Resource> hosts = new HashMap<Resource, Resource>();
  4. for (Resource res : m_mandatoryResources)
  5. {
  6. if (res instanceof WrappedResource)
  7. {
  8. res = ((WrappedResource) res).getDeclaredResource();
  9. }
  10. if (!Util.isFragment(res))
  11. {
  12. hosts.put(res, getWrappedHost(res));
  13. }
  14. }
  15. for (Capability cap : m_dependentMap.keySet())
  16. {
  17. Resource res = cap.getResource();
  18. if (res instanceof WrappedResource)
  19. {
  20. res = ((WrappedResource) res).getDeclaredResource();
  21. }
  22. if (!Util.isFragment(res))
  23. {
  24. hosts.put(res, getWrappedHost(res));
  25. }
  26. }
  27. return hosts;
  28. }

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.osgi

  1. public boolean canRemoveCandidate(Requirement req)
  2. {
  3. List<Capability> candidates = m_candidateMap.get(req);
  4. return ((candidates != null) && (candidates.size() > 1 || Util.isOptional(req)));
  5. }

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.osgi

  1. private boolean isMandatory(ResolveContext rc, Requirement requirement) {
  2. // The requirement is optional
  3. if (Util.isOptional(requirement)) {
  4. return false;
  5. }
  6. // This is a fragment that is already resolved and there is no unresolved hosts to attach it to
  7. Resource resource = requirement.getResource();
  8. if (Util.isFragment(resource) && rc.getWirings().containsKey(resource)) {
  9. return false;
  10. }
  11. return true;
  12. }

代码示例来源:origin: org.eclipse.tycho/org.eclipse.osgi

  1. + Util.getSymbolicName(m_resource)
  2. + " [" + m_resource
  3. + "] because it exports package '"
  4. + m_pkgName
  5. + "' and is also exposed to it from resource "
  6. + Util.getSymbolicName(m_blame1.m_cap.getResource())
  7. + " [" + m_blame1.m_cap.getResource()
  8. + "] via the following dependency chain:\n\n"
  9. + Util.getSymbolicName(m_resource)
  10. + " [" + m_resource
  11. + "] because it is exposed to package '"
  12. + m_pkgName
  13. + "' from resources "
  14. + Util.getSymbolicName(m_blame1.m_cap.getResource())
  15. + " [" + m_blame1.m_cap.getResource()
  16. + "] and "
  17. + Util.getSymbolicName(m_blame2.m_cap.getResource())
  18. + " [" + m_blame2.m_cap.getResource()
  19. + "] via two dependency chains.\n\nChain 1:\n"

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.osgi

  1. .equals(BundleNamespace.BUNDLE_NAMESPACE))
  2. if (Util.isReexport(w.getRequirement()))
  3. if (Util.isReexport(req))

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.osgi

  1. String resSymName = Util.getSymbolicName(req.getResource());
  2. Version resVersion = Util.getVersion(req.getResource());

代码示例来源:origin: org.eclipse/osgi

  1. public static boolean isMultiple(Requirement req)
  2. {
  3. return Namespace.CARDINALITY_MULTIPLE.equals(req.getDirectives()
  4. .get(Namespace.REQUIREMENT_CARDINALITY_DIRECTIVE)) && !isDynamic(req);
  5. }

相关文章