Examples of buildCapability()


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

    if (size > 0L)
      builder.addAttribute(Namespaces.ATTR_CONTENT_SIZE, size);

    builder.addAttribute(Namespaces.ATTR_CONTENT_MIME, mimeType.toString());

    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()

      String service = OSGiHeader.removeDuplicateMarker(export.getKey());
      Builder builder = new Builder().setNamespace(Namespaces.NS_SERVICE).addAttribute(Constants.OBJECTCLASS, service);
      for (Entry<String, String> attribEntry : export.getValue().entrySet())
        builder.addAttribute(attribEntry.getKey(), attribEntry.getValue());
      builder.addDirective(Namespaces.DIRECTIVE_EFFECTIVE, Namespaces.EFFECTIVE_ACTIVE);
      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()

        .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

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

      .setNamespace(Namespaces.NS_IDENTITY)
      .addAttribute(Namespaces.NS_IDENTITY, name)
      .addAttribute(Namespaces.ATTR_IDENTITY_TYPE, Namespaces.RESOURCE_TYPE_PLAIN_JAR);
    if (version != null)
      builder.addAttribute(Namespaces.ATTR_VERSION, version);
    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, mimeType.toString());
   
    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()

          .setNamespace(Namespaces.NS_SERVICE)
          .addAttribute(Constants.OBJECTCLASS, service);
      for (Entry<String,String> attribEntry : export.getValue().entrySet())
        builder.addAttribute(attribEntry.getKey(), attribEntry.getValue());
      builder.addDirective(Namespaces.DIRECTIVE_EFFECTIVE, Namespaces.EFFECTIVE_ACTIVE);
      caps.add(builder.buildCapability());
    }
  }
 
  private void doImportService(Resource resource, List<? super Requirement> reqs) throws Exception {
    @SuppressWarnings("deprecation")
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.