org.osgi.resource.Wiring类的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(6.7k)|赞(0)|评价(0)|浏览(126)

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

Wiring介绍

[英]A wiring for a resource. A wiring is associated with a resource and represents the dependencies with other wirings.

Instances of this type must be effectively immutable. That is, for a given instance of this interface, the methods defined by this interface must always return the same result.
[中]资源的连线。布线与资源关联,并表示与其他布线的依赖关系。
这种类型的实例必须是有效不可变的。也就是说,对于该接口的给定实例,该接口定义的方法必须始终返回相同的结果。

代码示例

代码示例来源:origin: apache/felix

for (Capability cap : wiring.getResource().getCapabilities(null))
for (Wire wire : wiring.getProvidedResourceWires(HostNamespace.HOST_NAMESPACE))
for (Wire wire : wiring.getRequiredResourceWires(null))

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

? wiring.getResourceCapabilities(null)
  : resource.getCapabilities(null);
Map<String, Capability> exports = new HashMap<String, Capability>(caps.size());

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

+ " (" + ((wiring != null) ? "RESOLVED)" : "UNRESOLVED)"));
List<Requirement> reqs = (wiring != null)
  ? wiring.getResourceRequirements(null)
  : resource.getRequirements(null);
for (Requirement req : reqs)
  ? Util.getDynamicRequirements(wiring.getResourceRequirements(null))
  : Util.getDynamicRequirements(resource.getRequirements(null));
for (Requirement req : reqs)

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

for (Wire wire : wiring.getRequiredResourceWires(HostNamespace.HOST_NAMESPACE))
    .getResourceCapabilities(null).contains(fragCand))

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

if (candWiring != null)
  for (Wire w : candWiring.getRequiredResourceWires(null))

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

for (Wire wire : wiring.getRequiredResourceWires(null))
  : Util.getDynamicRequirements(wiring.getResourceRequirements(null)))

代码示例来源:origin: apache/felix

private static int getWiringID(Wiring bw)
{
  Resource res = bw.getResource();
  if (res != null)
  {
    return getResourceIDAndAdd(res, null);
  }
  return bw.hashCode();
}

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

for (Wire wire : wiring.getRequiredResourceWires(HostNamespace.HOST_NAMESPACE))
    .getResourceCapabilities(null).contains(fragCand))

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

rc.getWirings().get(req.getResource()).getRequiredResourceWires(null);
req = getDeclaredRequirement(req);
for (Wire w : wires)

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

for (Wire wire : wiring.getRequiredResourceWires(null))
  : Util.getDynamicRequirements(wiring.getResourceRequirements(null)))

代码示例来源:origin: biz.aQute.bnd/biz.aQute.resolve

public Map<Resource,List<Wire>> resolveDynamic(ResolveContext context,
    Wiring hostWiring, Requirement dynamicRequirement)
    throws ResolutionException
{
  Resource host = hostWiring.getResource();
  List<Capability> matches = context.findProviders(dynamicRequirement);
  // We can only create a dynamic import if the following
  // conditions are met:
  // 1. The package in question is not already imported.
  // 2. The package in question is not accessible via require-bundle.
  // 3. The package in question is not exported by the resource.
  if (!matches.isEmpty())
  {
    // Make sure all matching candidates are packages.
    for (Capability cap : matches)
    {
      if (!cap.getNamespace().equals(PackageNamespace.PACKAGE_NAMESPACE))
      {
        throw new IllegalArgumentException(
          "Matching candidate does not provide a package name.");
      }
    }
    ResolveSession session = ResolveSession.createSession(context,  new DumbExecutor(), host, dynamicRequirement, matches);
    return doResolve(session);
  }
  throw new Candidates.MissingRequirementError(dynamicRequirement).toException();
}

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

for (Wire wire : wiring.getRequiredResourceWires(HostNamespace.HOST_NAMESPACE))
    .getResourceCapabilities(null).contains(fragCand))

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

for (Capability cap : wiring.getResource().getCapabilities(null)) {
  if (PackageNamespace.PACKAGE_NAMESPACE.equals(cap.getNamespace())) {
    exportNames.add((String) cap.getAttributes()
for (Wire wire : wiring.getProvidedResourceWires(null)) {
  if (HostNamespace.HOST_NAMESPACE
      .equals(wire.getCapability().getNamespace())) {
for (Wire wire : wiring.getRequiredResourceWires(null)) {
  if (PackageNamespace.PACKAGE_NAMESPACE
      .equals(wire.getCapability().getNamespace())) {

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

if (candWiring != null)
  for (Wire w : candWiring.getRequiredResourceWires(null))

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

? wiring.getResourceCapabilities(null)
  : resource.getCapabilities(null);
Map<String, Capability> exports = new HashMap<String, Capability>(caps.size());

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

for (Wire wire : wiring.getRequiredResourceWires(null))
for (Requirement req : wiring.getResourceRequirements(null))

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

+ " (" + ((wiring != null) ? "RESOLVED)" : "UNRESOLVED)"));
List<Requirement> reqs = (wiring != null)
  ? wiring.getResourceRequirements(null)
  : resource.getRequirements(null);
for (Requirement req : reqs)
  ? Util.getDynamicRequirements(wiring.getResourceRequirements(null))
  : Util.getDynamicRequirements(resource.getRequirements(null));
for (Requirement req : reqs)

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

public Map<Resource,List<Wire>> resolveDynamic(ResolveContext context,
    Wiring hostWiring, Requirement dynamicRequirement)
    throws ResolutionException
{
  Resource host = hostWiring.getResource();
  List<Capability> matches = context.findProviders(dynamicRequirement);
  // We can only create a dynamic import if the following
  // conditions are met:
  // 1. The package in question is not already imported.
  // 2. The package in question is not accessible via require-bundle.
  // 3. The package in question is not exported by the resource.
  if (!matches.isEmpty())
  {
    // Make sure all matching candidates are packages.
    for (Capability cap : matches)
    {
      if (!cap.getNamespace().equals(PackageNamespace.PACKAGE_NAMESPACE))
      {
        throw new IllegalArgumentException(
          "Matching candidate does not provide a package name.");
      }
    }
    ResolveSession session = ResolveSession.createSession(context,  new DumbExecutor(), host, dynamicRequirement, matches);
    return doResolve(session);
  }
  throw new Candidates.MissingRequirementError(dynamicRequirement).toException();
}

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

for (Wire wire : wiring.getRequiredResourceWires(HostNamespace.HOST_NAMESPACE))
    .getResourceCapabilities(null).contains(fragCand))

代码示例来源:origin: biz.aQute.bnd/biz.aQute.resolve

for (Capability cap : wiring.getResource().getCapabilities(null)) {
  if (PackageNamespace.PACKAGE_NAMESPACE.equals(cap.getNamespace())) {
    exportNames.add((String) cap.getAttributes()
for (Wire wire : wiring.getProvidedResourceWires(null)) {
  if (HostNamespace.HOST_NAMESPACE
      .equals(wire.getCapability().getNamespace())) {
for (Wire wire : wiring.getRequiredResourceWires(null)) {
  if (PackageNamespace.PACKAGE_NAMESPACE
      .equals(wire.getCapability().getNamespace())) {

相关文章