Package org.osgi.service.indexer

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


      }
    }
   
    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

      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

          .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

     
      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

       
        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

        .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

    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

      }
    }
   
    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

      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

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.