public String getSystemCapabilities() { return runsystemcapabilities.isEmpty() ? null : runsystemcapabilities.toString(); }
public String getSystemCapabilities() { return runsystemcapabilities.isEmpty() ? null : runsystemcapabilities.toString(); }
/** * This method should go to the ProjectLauncher * * @throws Exception */ public void calculatedProperties(Map<String, Object> properties) throws Exception { if (!keep) properties.put(org.osgi.framework.Constants.FRAMEWORK_STORAGE_CLEAN, org.osgi.framework.Constants.FRAMEWORK_STORAGE_CLEAN_ONFIRSTINIT); if (!runsystemcapabilities.isEmpty()) properties.put(org.osgi.framework.Constants.FRAMEWORK_SYSTEMCAPABILITIES_EXTRA, runsystemcapabilities.toString()); if (!runsystempackages.isEmpty()) properties.put(org.osgi.framework.Constants.FRAMEWORK_SYSTEMPACKAGES_EXTRA, runsystempackages.toString()); }
/** * This method should go to the ProjectLauncher * * @throws Exception */ public void calculatedProperties(Map<String, Object> properties) throws Exception { if (!keep) properties.put(org.osgi.framework.Constants.FRAMEWORK_STORAGE_CLEAN, org.osgi.framework.Constants.FRAMEWORK_STORAGE_CLEAN_ONFIRSTINIT); if (!runsystemcapabilities.isEmpty()) properties.put(org.osgi.framework.Constants.FRAMEWORK_SYSTEMCAPABILITIES_EXTRA, runsystemcapabilities.toString()); if (!runsystempackages.isEmpty()) properties.put(org.osgi.framework.Constants.FRAMEWORK_SYSTEMPACKAGES_EXTRA, runsystempackages.toString()); }
private void set(Attributes mainAttributes, String key, MultiMap<String, Attrs> multiMap) { Parameters parameters = new Parameters(); List<Attrs> allattrs = new ArrayList<>(); for (Entry<String, List<Attrs>> entry : multiMap.entrySet()) { for (Attrs attrs : entry.getValue()) { parameters.add(entry.getKey(), attrs); } } mainAttributes.putValue(key, parameters.toString()); // (key, allattrs); }
private void addServiceCapability(String[] objectClass, Set<String> provides) { if (objectClass.length > 0) { Parameters p = new Parameters(); Attrs a = new Attrs(); StringBuilder sb = new StringBuilder(); String sep = ""; for (String oc : objectClass) { sb.append(sep) .append(oc); sep = ","; } a.put("objectClass:List<String>", sb.toString()); p.put("osgi.service", a); String s = p.toString(); provides.add(s); } }
private void addServiceCapability(String[] objectClass, Set<String> provides) { if (objectClass.length > 0) { Parameters p = new Parameters(); Attrs a = new Attrs(); StringBuilder sb = new StringBuilder(); String sep = ""; for (String oc : objectClass) { sb.append(sep) .append(oc); sep = ","; } a.put("objectClass:List<String>", sb.toString()); p.put("osgi.service", a); String s = p.toString(); provides.add(s); } }
private void addServiceCapability(String[] objectClass, Set<String> provides) { if (objectClass.length > 0) { Parameters p = new Parameters(); Attrs a = new Attrs(); StringBuilder sb = new StringBuilder(); String sep = ""; for (String oc : objectClass) { sb.append(sep) .append(oc); sep = ","; } a.put("objectClass:List<String>", sb.toString()); p.put("osgi.service", a); String s = p.toString(); provides.add(s); } }
private void addServiceCapability(String[] objectClass, Set<String> provides) { if (objectClass.length > 0) { Parameters p = new Parameters(); Attrs a = new Attrs(); StringBuilder sb = new StringBuilder(); String sep = ""; for (String oc : objectClass) { sb.append(sep) .append(oc); sep = ","; } a.put("objectClass:List<String>", sb.toString()); p.put("osgi.service", a); String s = p.toString(); provides.add(s); } }
private void addExtenderRequirement(Set<String> requires, List<String> beans, Version version) { Version next = version.bumpMajor(); Parameters p = new Parameters(); Attrs a = new Attrs(); a.put(Constants.FILTER_DIRECTIVE, "\"(&(osgi.extender=osgi.cdi)(version>=" + version + ")(!(version>=" + next + ")))\""); a.put("beans:List<String>", String.join(",", beans)); p.put("osgi.extender", a); String s = p.toString(); requires.add(s); }
private void addExtenderRequirement(Set<String> requires, Version version) { Version next = version.bumpMajor(); Parameters p = new Parameters(); Attrs a = new Attrs(); a.put(Constants.FILTER_DIRECTIVE, "\"(&(" + ExtenderNamespace.EXTENDER_NAMESPACE + "=" + ComponentConstants.COMPONENT_CAPABILITY_NAME + ")(" + ExtenderNamespace.CAPABILITY_VERSION_ATTRIBUTE + ">=" + version + ")(!(" + ExtenderNamespace.CAPABILITY_VERSION_ATTRIBUTE + ">=" + next + ")))\""); p.put(ExtenderNamespace.EXTENDER_NAMESPACE, a); String s = p.toString(); requires.add(s); }
private void addExtenderRequirement(Set<String> requires, List<String> beans, Version version) { Version next = version.bumpMajor(); Parameters p = new Parameters(); Attrs a = new Attrs(); a.put(Constants.FILTER_DIRECTIVE, "\"(&(osgi.extender=osgi.cdi)(version>=" + version + ")(!(version>=" + next + ")))\""); a.put("beans:List<String>", String.join(",", beans)); p.put("osgi.extender", a); String s = p.toString(); requires.add(s); }
private void addExtenderRequirement(Set<String> requires, Version version) { Version next = version.bumpMajor(); Parameters p = new Parameters(); Attrs a = new Attrs(); a.put(Constants.FILTER_DIRECTIVE, "\"(&(" + ExtenderNamespace.EXTENDER_NAMESPACE + "=" + ComponentConstants.COMPONENT_CAPABILITY_NAME + ")(" + ExtenderNamespace.CAPABILITY_VERSION_ATTRIBUTE + ">=" + version + ")(!(" + ExtenderNamespace.CAPABILITY_VERSION_ATTRIBUTE + ">=" + next + ")))\""); p.put(ExtenderNamespace.EXTENDER_NAMESPACE, a); String s = p.toString(); requires.add(s); }
private void doLicense(Annotation a) throws Exception { BundleLicense annotation = a.getAnnotation(BundleLicense.class); Parameters p = new Parameters(); p.put(annotation.name(), getAttributes(a, "name")); add(Constants.BUNDLE_LICENSE, p.toString()); }
private void doLicense(Annotation a) throws Exception { BundleLicense annotation = a.getAnnotation(BundleLicense.class); Parameters p = new Parameters(); p.put(annotation.name(), getAttributes(a, "name")); add(Constants.BUNDLE_LICENSE, p.toString()); }
private void doRequireCapability(Annotation a) throws Exception { RequireCapability annotation = a.getAnnotation(RequireCapability.class); Parameters p = new Parameters(); Attrs attrs = getAttributes(a, "ns"); directivesAndVersion(attrs, "filter", "effective", "resolution"); replaceParameters(attrs); if ("".equals(attrs.get(Constants.FILTER_DIRECTIVE))) attrs.remove(Constants.FILTER_DIRECTIVE); p.put(annotation.ns(), attrs); String s = p.toString(); String extra = annotation.extra(); if (extra != null) { extra = extra.trim(); if (extra.length() > 0) s += ";" + extra; } add(Constants.REQUIRE_CAPABILITY, s); }
private void doRequireCapability(Annotation a) throws Exception { RequireCapability annotation = a.getAnnotation(RequireCapability.class); Parameters p = new Parameters(); Attrs attrs = getAttributes(a, "ns"); directivesAndVersion(attrs, "filter", "effective", "resolution"); replaceParameters(attrs); if ("".equals(attrs.get(Constants.FILTER_DIRECTIVE))) attrs.remove(Constants.FILTER_DIRECTIVE); p.put(annotation.ns(), attrs); String s = p.toString(); String extra = annotation.extra(); if (extra != null) { extra = extra.trim(); if (extra.length() > 0) s += ";" + extra; } add(Constants.REQUIRE_CAPABILITY, s); }
private void doProvideCapability(Annotation a) throws Exception { ProvideCapability annotation = a.getAnnotation(ProvideCapability.class); Parameters p = new Parameters(); Attrs attrs = getAttributes(a, "ns"); directivesAndVersion(attrs, "uses", "mandatory", "effective"); p.put(annotation.ns(), attrs); String value = attrs.remove("name"); if (value != null) attrs.put(annotation.ns(), value); value = attrs.remove("value"); String s = p.toString(); if (value != null) s += ";" + annotation.value(); add(Constants.PROVIDE_CAPABILITY, s); }
private void doProvideCapability(Annotation a) throws Exception { ProvideCapability annotation = a.getAnnotation(ProvideCapability.class); Parameters p = new Parameters(); Attrs attrs = getAttributes(a, "ns"); directivesAndVersion(attrs, "uses", "mandatory", "effective"); p.put(annotation.ns(), attrs); String value = attrs.remove("name"); if (value != null) attrs.put(annotation.ns(), value); value = attrs.remove("value"); String s = p.toString(); if (value != null) s += ";" + annotation.value(); add(Constants.PROVIDE_CAPABILITY, s); }