Package org.osgi.service.indexer.impl.types

Examples of org.osgi.service.indexer.impl.types.SymbolicName


    Map<String, Map<String, String>> map = OSGiHeader.parseHeader(header);
    if (map.size() != 1)
      throw new IllegalArgumentException("Invalid format for Bundle-SymbolicName header.");

    Entry<String, Map<String, String>> entry = map.entrySet().iterator().next();
    return new SymbolicName(entry.getKey(), entry.getValue());
  }
View Full Code Here


    default:
      type = Namespaces.RESOURCE_TYPE_PLAIN_JAR;
      break;
    }

    SymbolicName bsn = Util.getSymbolicName(resource);
    boolean singleton = Boolean.TRUE.toString().equalsIgnoreCase(bsn.getAttributes().get(Constants.SINGLETON_DIRECTIVE + ":"));

    Version version = Util.getVersion(resource);

    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());
  }
View Full Code Here

    Attributes attribs = resource.getManifest().getMainAttributes();
    if (attribs.getValue(Constants.FRAGMENT_HOST) != null)
      return;

    SymbolicName bsn = Util.getSymbolicName(resource);
    Version version = Util.getVersion(resource);

    bundleBuilder.addAttribute(Namespaces.NS_WIRING_BUNDLE, bsn.getName()).addAttribute(Constants.BUNDLE_VERSION_ATTRIBUTE, version);
    hostBuilder.addAttribute(Namespaces.NS_WIRING_HOST, bsn.getName()).addAttribute(Constants.BUNDLE_VERSION_ATTRIBUTE, version);

    for (Entry<String, String> attribEntry : bsn.getAttributes().entrySet()) {
      String key = attribEntry.getKey();
      if (key.endsWith(":")) {
        String directiveName = key.substring(0, key.length() - 1);
        if (Constants.FRAGMENT_ATTACHMENT_DIRECTIVE.equalsIgnoreCase(directiveName)) {
          if (Constants.FRAGMENT_ATTACHMENT_NEVER.equalsIgnoreCase(attribEntry.getValue()))
View Full Code Here

          else
            builder.addAttribute(key, attribEntry.getValue());
        }
      }

      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());
    }
View Full Code Here

    default:
      type = Namespaces.RESOURCE_TYPE_PLAIN_JAR;
      break;
    }
   
    SymbolicName bsn = Util.getSymbolicName(resource);
    boolean singleton = Boolean.TRUE.toString().equalsIgnoreCase(bsn.getAttributes().get(Constants.SINGLETON_DIRECTIVE + ":"));
   
    Version version = Util.getVersion(resource);
   
    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());
View Full Code Here

   
    Attributes attribs = resource.getManifest().getMainAttributes();
    if (attribs.getValue(Constants.FRAGMENT_HOST) != null)
      return;
   
    SymbolicName bsn = Util.getSymbolicName(resource);
    Version version = Util.getVersion(resource);
   
    bundleBuilder.addAttribute(Namespaces.NS_WIRING_BUNDLE, bsn.getName())
      .addAttribute(Constants.BUNDLE_VERSION_ATTRIBUTE, version);
    hostBuilder.addAttribute(Namespaces.NS_WIRING_HOST, bsn.getName())
      .addAttribute(Constants.BUNDLE_VERSION_ATTRIBUTE, version);
   
    for (Entry<String, String> attribEntry : bsn.getAttributes().entrySet()) {
      String key = attribEntry.getKey();
      if (key.endsWith(":")) {
        String directiveName = key.substring(0, key.length() - 1);
        if (Constants.FRAGMENT_ATTACHMENT_DIRECTIVE.equalsIgnoreCase(directiveName)) {
          if (Constants.FRAGMENT_ATTACHMENT_NEVER.equalsIgnoreCase(attribEntry.getValue()))
View Full Code Here

    Map<String, Map<String, String>> map = OSGiHeader.parseHeader(header);
    if (map.size() != 1)
      throw new IllegalArgumentException("Invalid format for Bundle-SymbolicName header.");

    Entry<String, Map<String, String>> entry = map.entrySet().iterator().next();
    return new SymbolicName(entry.getKey(), entry.getValue());
  }
View Full Code Here

          else
            builder.addAttribute(key, attribEntry.getValue());
        }
      }
     
      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());
    }
View Full Code Here

  public void setKnownBundlesExtra(Properties extras) {
    this.extraProperties = extras;
  }
 
  public void analyzeResource(Resource resource, List<Capability> caps, List<Requirement> reqs) throws Exception {
    SymbolicName resourceName = Util.getSymbolicName(resource);
   
    for (Enumeration<?> names = defaultProperties.propertyNames(); names.hasMoreElements(); ) {
      String propName = (String) names.nextElement();
      processPropertyName(resource, caps, reqs, resourceName, propName, defaultProperties);
    }
View Full Code Here

    Map<String, Map<String, String>> map = OSGiHeader.parseHeader(header);
    if (map.size() != 1)
      throw new IllegalArgumentException("Invalid format for Bundle-SymbolicName header.");

    Entry<String, Map<String, String>> entry = map.entrySet().iterator().next();
    return new SymbolicName(entry.getKey(), entry.getValue());
  }
View Full Code Here

TOP

Related Classes of org.osgi.service.indexer.impl.types.SymbolicName

Copyright © 2018 www.massapicom. 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.