void loadFramework(ResourceBuilder system) throws Exception { Parameters parameters = new Parameters(properties.getProperty(Constants.RUNFW), project); if (parameters.isEmpty()) { log.log(LogService.LOG_WARNING, "No -runfw set"); return; } if (parameters.size() > 1) throw new IllegalArgumentException( "Too many frameworks specified in " + Constants.RUNFW + " (" + parameters + ")"); Map.Entry<String, Attrs> bsn = parameters.entrySet() .iterator() .next(); String name = bsn.getKey(); String version = bsn.getValue() .getVersion(); log.log(LogService.LOG_INFO, "Using frameowork " + name + ";" + version); if ("none".equals(name)) return; Resource framework = getHighestResource(name, version); if (framework == null) { log.log(LogService.LOG_ERROR, "Cannot find framework " + name + ";" + version); } else super.setFramework(system, framework); }
void loadFramework(ResourceBuilder system) throws Exception { Parameters parameters = new Parameters(properties.getProperty(Constants.RUNFW), project); if (parameters.isEmpty()) { log.log(LogService.LOG_WARNING, "No -runfw set"); return; } if (parameters.size() > 1) throw new IllegalArgumentException( "Too many frameworks specified in " + Constants.RUNFW + " (" + parameters + ")"); Map.Entry<String, Attrs> bsn = parameters.entrySet() .iterator() .next(); String name = bsn.getKey(); String version = bsn.getValue() .getVersion(); log.log(LogService.LOG_INFO, "Using frameowork " + name + ";" + version); if ("none".equals(name)) return; Resource framework = getHighestResource(name, version); if (framework == null) { log.log(LogService.LOG_ERROR, "Cannot find framework " + name + ";" + version); } else super.setFramework(system, framework); }
void doExports(Domain domain, List< ? super Capability> caps) throws Exception { Parameters exports = domain.getExportPackage(); for (Entry<String,Attrs> entry : exports.entrySet()) { CapReqBuilder builder = new CapReqBuilder(Namespaces.NS_WIRING_PACKAGE); String pkgName = Processor.removeDuplicateMarker(entry.getKey()); builder.addAttribute(Namespaces.NS_WIRING_PACKAGE, pkgName); String versionStr = entry.getValue().getVersion(); Version version = Version.parseVersion(versionStr); builder.addAttribute(Namespaces.ATTR_VERSION, version); for (Entry<String,String> attribEntry : entry.getValue().entrySet()) { String key = attribEntry.getKey(); if (!"specification-version".equalsIgnoreCase(key) && !Constants.VERSION_ATTRIBUTE.equalsIgnoreCase(key)) { if (key.endsWith(":")) builder.addDirective(key.substring(0, key.length() - 1), attribEntry.getValue()); else builder.addAttribute(key, attribEntry.getValue()); } } Entry<String,Attrs> bsn = domain.getBundleSymbolicName(); builder.addAttribute(Namespaces.ATTR_BUNDLE_SYMBOLIC_NAME, bsn.getKey()); builder.addAttribute(Namespaces.ATTR_BUNDLE_VERSION, Version.parseVersion(bsn.getValue().getVersion())); caps.add(builder.buildCapability()); } }
private void fixupOldStyleVersions(Attrs attrs) { if (attrs.containsKey(SPECIFICATION_VERSION) && attrs.getVersion() == null) { attrs.put("version", attrs.get(SPECIFICATION_VERSION)); attrs.remove(SPECIFICATION_VERSION); } }
void doExports(Domain domain, List< ? super Capability> caps) throws Exception { Parameters exports = domain.getExportPackage(); for (Entry<String,Attrs> entry : exports.entrySet()) { CapReqBuilder builder = new CapReqBuilder(Namespaces.NS_WIRING_PACKAGE); String pkgName = Processor.removeDuplicateMarker(entry.getKey()); builder.addAttribute(Namespaces.NS_WIRING_PACKAGE, pkgName); String versionStr = entry.getValue().getVersion(); Version version = Version.parseVersion(versionStr); builder.addAttribute(Namespaces.ATTR_VERSION, version); for (Entry<String,String> attribEntry : entry.getValue().entrySet()) { String key = attribEntry.getKey(); if (!"specification-version".equalsIgnoreCase(key) && !Constants.VERSION_ATTRIBUTE.equalsIgnoreCase(key)) { if (key.endsWith(":")) builder.addDirective(key.substring(0, key.length() - 1), attribEntry.getValue()); else builder.addAttribute(key, attribEntry.getValue()); } } Entry<String,Attrs> bsn = domain.getBundleSymbolicName(); builder.addAttribute(Namespaces.ATTR_BUNDLE_SYMBOLIC_NAME, bsn.getKey()); builder.addAttribute(Namespaces.ATTR_BUNDLE_VERSION, Version.parseVersion(bsn.getValue().getVersion())); caps.add(builder.buildCapability()); } }
private void fixupOldStyleVersions(Attrs attrs) { if (attrs.containsKey(SPECIFICATION_VERSION) && attrs.getVersion() == null) { attrs.put("version", attrs.get(SPECIFICATION_VERSION)); attrs.remove(SPECIFICATION_VERSION); } }
void doBundleAndHost(Domain domain, List< ? super Capability> caps) throws Exception { CapReqBuilder bundleBuilder = new CapReqBuilder(Namespaces.NS_WIRING_BUNDLE); CapReqBuilder hostBuilder = new CapReqBuilder(Namespaces.NS_WIRING_HOST); boolean allowFragments = true; if (domain.getFragmentHost() != null) return; Map.Entry<String,Attrs> bsn = domain.getBundleSymbolicName(); Version version = Version.parseVersion(bsn.getValue().getVersion()); bundleBuilder.addAttribute(Namespaces.NS_WIRING_BUNDLE, bsn.getKey()).addAttribute( Constants.BUNDLE_VERSION_ATTRIBUTE, version); hostBuilder.addAttribute(Namespaces.NS_WIRING_HOST, bsn.getKey()).addAttribute( Constants.BUNDLE_VERSION_ATTRIBUTE, version); for (Entry<String,String> entry : bsn.getValue().entrySet()) { String key = entry.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(entry.getValue())) allowFragments = false; } else if (!Constants.SINGLETON_DIRECTIVE.equalsIgnoreCase(directiveName)) { bundleBuilder.addDirective(directiveName, entry.getValue()); } } else { bundleBuilder.addAttribute(key, entry.getValue()); } } caps.add(bundleBuilder.buildCapability()); if (allowFragments) caps.add(hostBuilder.buildCapability()); }
private void fixupOldStyleVersions(Attrs attrs) { if (attrs.containsKey(SPECIFICATION_VERSION) && attrs.getVersion() == null) { attrs.put("version", attrs.get(SPECIFICATION_VERSION)); attrs.remove(SPECIFICATION_VERSION); } }
private void fixupOldStyleVersions(Attrs attrs) { if (attrs.containsKey(SPECIFICATION_VERSION) && attrs.getVersion() == null) { attrs.put("version", attrs.get(SPECIFICATION_VERSION)); attrs.remove(SPECIFICATION_VERSION); } }
void doBundleAndHost(Domain domain, List< ? super Capability> caps) throws Exception { CapReqBuilder bundleBuilder = new CapReqBuilder(Namespaces.NS_WIRING_BUNDLE); CapReqBuilder hostBuilder = new CapReqBuilder(Namespaces.NS_WIRING_HOST); boolean allowFragments = true; if (domain.getFragmentHost() != null) return; Map.Entry<String,Attrs> bsn = domain.getBundleSymbolicName(); Version version = Version.parseVersion(bsn.getValue().getVersion()); bundleBuilder.addAttribute(Namespaces.NS_WIRING_BUNDLE, bsn.getKey()).addAttribute( Constants.BUNDLE_VERSION_ATTRIBUTE, version); hostBuilder.addAttribute(Namespaces.NS_WIRING_HOST, bsn.getKey()).addAttribute( Constants.BUNDLE_VERSION_ATTRIBUTE, version); for (Entry<String,String> entry : bsn.getValue().entrySet()) { String key = entry.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(entry.getValue())) allowFragments = false; } else if (!Constants.SINGLETON_DIRECTIVE.equalsIgnoreCase(directiveName)) { bundleBuilder.addDirective(directiveName, entry.getValue()); } } else { bundleBuilder.addAttribute(key, entry.getValue()); } } caps.add(bundleBuilder.buildCapability()); if (allowFragments) caps.add(hostBuilder.buildCapability()); }
case VERSIONED : accept = entry.getValue() .getVersion() != null; break; case CONDITIONAL :
public Requirement addImportPackage(String pname, Attrs attrs) throws Exception { CapReqBuilder reqb = new CapReqBuilder(resource, PackageNamespace.PACKAGE_NAMESPACE); reqb.addDirectives(attrs); reqb.addFilter(PackageNamespace.PACKAGE_NAMESPACE, pname, attrs.getVersion(), attrs); Requirement requirement = reqb.buildRequirement(); addRequirement(requirement); return requirement; }
public Requirement addImportPackage(String pname, Attrs attrs) throws Exception { CapReqBuilder reqb = new CapReqBuilder(resource, PackageNamespace.PACKAGE_NAMESPACE); reqb.addDirectives(attrs); reqb.addFilter(PackageNamespace.PACKAGE_NAMESPACE, pname, attrs.getVersion(), attrs); Requirement requirement = reqb.buildRequirement(); addRequirement(requirement); return requirement; }
.getFQN()); String v = e.getValue() .getVersion(); if (v != null) { VersionRange vr = VersionRange.parseOSGiVersionRange(v); .getFQN()); String v = e.getValue() .getVersion(); if (v != null) { VersionRange vr = VersionRange.parseOSGiVersionRange(v);
Attrs attrs = new Attrs(c.decorators); attrs.put(ContractNamespace.CONTRACT_NAMESPACE, c.name); String range = analyzer.applyVersionPolicy(c.version.toString(), c.decorators.getVersion(), false); String name = ContractNamespace.CONTRACT_NAMESPACE; while (requirements.containsKey(name))
Attrs attrs = new Attrs(c.decorators); attrs.put(ContractNamespace.CONTRACT_NAMESPACE, c.name); String range = analyzer.applyVersionPolicy(c.version.toString(), c.decorators.getVersion(), false); String name = ContractNamespace.CONTRACT_NAMESPACE; while (requirements.containsKey(name))
.getFQN()); String v = e.getValue() .getVersion(); if (v != null) { VersionRange vr = VersionRange.parseOSGiVersionRange(v); .getFQN()); String v = e.getValue() .getVersion(); if (v != null) { VersionRange vr = VersionRange.parseOSGiVersionRange(v);
private void createAugmentOperation(MultiMap<Requirement, Augment> operations, String bsn, Attrs attrs) { String range = attrs.getVersion(); Requirement bundleRequirement = CapReqBuilder.createBundleRequirement(bsn, range) .buildSyntheticRequirement(); Augment augment = new Augment(); augment.additionalCapabilities = new Parameters(attrs.get(Constants.AUGMENT_CAPABILITY_DIRECTIVE)); augment.additionalRequirements = new Parameters(attrs.get(Constants.AUGMENT_REQUIREMENT_DIRECTIVE)); operations.add(bundleRequirement, augment); }
private void createAugmentOperation(MultiMap<Requirement, Augment> operations, String bsn, Attrs attrs) { String range = attrs.getVersion(); Requirement bundleRequirement = CapReqBuilder.createBundleRequirement(bsn, range) .buildSyntheticRequirement(); Augment augment = new Augment(); augment.additionalCapabilities = new Parameters(attrs.get(Constants.AUGMENT_CAPABILITY_DIRECTIVE)); augment.additionalRequirements = new Parameters(attrs.get(Constants.AUGMENT_REQUIREMENT_DIRECTIVE)); operations.add(bundleRequirement, augment); }
try { Version fromExport = new Version( cleanupVersion(exporterAttributes.getVersion())); Version fromSet = new Version(cleanupVersion(attributes.getVersion())); if (!fromExport.equals(fromSet)) { SetLocation location = warning(