Examples of buildCapability()


Examples of org.osgi.service.indexer.Builder.buildCapability()

     
      if (specVersion != null)
        builder.addAttribute(Namespaces.ATTR_VERSION, specVersion);
     
      builder.addDirective(Namespaces.DIRECTIVE_USES, uses.toString());
      caps.add(builder.buildCapability());
    }
  }

  /**
   * Map the version of package {@code org.osgi.framework} to an OSGi
View Full Code Here

Examples of org.osgi.service.indexer.Builder.buildCapability()

       
        Map<String, String> attribs = entry.getValue();
        Util.copyAttribsToBuilder(builder, attribs);
       
        if ("capability".equalsIgnoreCase(type) || "cap".equalsIgnoreCase(type))
          caps.add(builder.buildCapability());
        else if ("requirement".equalsIgnoreCase(type) || "req".equalsIgnoreCase(type))
          reqs.add(builder.buildRequirement());
        else throw new IllegalArgumentException(MessageFormat.format("Invalid indicator type in known-bundle parsing for bundle \"{0}\", must be either cap[ability] or req[uirement], found \"{1}\".", bundleRef));
      } else {
        throw new IllegalArgumentException(MessageFormat.format("Invalid indicator format in known-bundle parsing for bundle  \"{0}\", expected type@namespace, found \"{1}\".", bundleRef, indicator));
View Full Code Here

Examples of org.osgi.service.indexer.Builder.buildCapability()

        .addAttribute(Namespaces.NS_IDENTITY, bsn.getName())
        .addAttribute(Namespaces.ATTR_IDENTITY_TYPE, identity)
        .addAttribute(Namespaces.ATTR_VERSION, version);
    if (singleton)
      builder.addDirective(Namespaces.DIRECTIVE_SINGLETON, Boolean.TRUE.toString());
    caps.add(builder.buildCapability());
  }

  void setStateLocal(GeneratorState state) {
    this.state.set(state);
  }
View Full Code Here

Examples of org.osgi.service.indexer.Builder.buildCapability()

    long size = resource.getSize();
    if (size > 0L) builder.addAttribute(Namespaces.ATTR_CONTENT_SIZE, size);
   
    builder.addAttribute(Namespaces.ATTR_CONTENT_MIME, MIME_TYPE_OSGI_BUNDLE);
   
    capabilities.add(builder.buildCapability());
  }
 
  private String calculateSHA(Resource resource) throws IOException, NoSuchAlgorithmException {
    MessageDigest digest = MessageDigest.getInstance(SHA_256);
    byte[] buf = new byte[1024];
View Full Code Here

Examples of org.osgi.service.indexer.Builder.buildCapability()

      }
    }
   
    caps.add(bundleBuilder.buildCapability());
    if (allowFragments)
      caps.add(hostBuilder.buildCapability());
  }
 
  private void doExports(Resource resource, List<? super Capability> caps) throws Exception {
    Manifest manifest = resource.getManifest();
   
View Full Code Here

Examples of org.osgi.service.indexer.Builder.buildCapability()

      SymbolicName bsn = Util.getSymbolicName(resource);
      builder.addAttribute(Namespaces.ATTR_BUNDLE_SYMBOLIC_NAME, bsn.getName());
      Version bundleVersion = Util.getVersion(resource);
      builder.addAttribute(Namespaces.ATTR_BUNDLE_VERSION, bundleVersion);
     
      caps.add(builder.buildCapability());
    }
  }

  private void doImports(Resource resource, List<? super Requirement> reqs) throws Exception {
    Manifest manifest = resource.getManifest();
View Full Code Here

Examples of org.osgi.service.indexer.Builder.buildCapability()

    for (Entry<String, Map<String, String>> export : exports.entrySet()) {
      String service = OSGiHeader.removeDuplicateMarker(export.getKey());
      Builder builder = new Builder()
          .setNamespace(Namespaces.NS_WIRING_SERVICE)
          .addAttribute(Namespaces.NS_WIRING_SERVICE, service);
      caps.add(builder.buildCapability());
    }
  }
 
  private void doImportService(Resource resource, List<? super Requirement> reqs) throws Exception {
    @SuppressWarnings("deprecation")
View Full Code Here

Examples of org.osgi.service.indexer.Builder.buildCapability()

     
      if (specVersion != null)
        builder.addAttribute(Namespaces.ATTR_VERSION, specVersion);
     
      builder.addDirective(Namespaces.DIRECTIVE_USES, uses.toString());
      caps.add(builder.buildCapability());
    }
  }

  /**
   * Map the version of package {@code org.osgi.framework} to an OSGi
View Full Code Here

Examples of org.osgi.service.indexer.Builder.buildCapability()

       
      Map<String, String> attribs = entry.getValue();
      Util.copyAttribsToBuilder(builder, attribs);
     
      if (type == IndicatorType.Capability)
        caps.add(builder.buildCapability());
      else if (type == IndicatorType.Requirement)
        reqs.add(builder.buildRequirement());
    }
  }
View Full Code Here

Examples of org.osgi.service.indexer.Builder.buildCapability()

    Builder builder = new Builder().setNamespace(Namespaces.NS_IDENTITY).addAttribute(Namespaces.NS_IDENTITY, bsn.getName()).addAttribute(Namespaces.ATTR_IDENTITY_TYPE, type)
        .addAttribute(Namespaces.ATTR_VERSION, version);
    if (singleton)
      builder.addDirective(Namespaces.DIRECTIVE_SINGLETON, Boolean.TRUE.toString());
    caps.add(builder.buildCapability());
  }

  private void doPlainJarIdentity(Resource resource, List<? super Capability> caps) {
    String name = (String) resource.getProperties().get(Resource.NAME);
    if (name.toLowerCase().endsWith(SUFFIX_JAR))
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.