public Map componentProperties()

in cdi-extender/src/main/java/org/apache/aries/cdi/container/internal/model/ExtendedComponentInstanceDTO.java [276:316]


	public Map<String, Object> componentProperties(Map<String, Object> others) {
		_log.debug(l -> l.debug("ComponentProperties: merging"));

		Map<String, Object> props = new HashMap<>();
		if (others != null) {
			props.putAll(others);
			_log.debug(l -> l.debug("ComponentProperties: others {}", props));
		}
		props.putAll(template.properties);
		_log.debug(l -> l.debug("ComponentProperties: template {}", props));

		List<String> servicePids = new ArrayList<>();

		for (ConfigurationTemplateDTO t : template.configurations) {
			configurations.stream().filter(
				c -> c.template.equals(t)
			).findFirst().ifPresent(
				c -> {
					Map<String, Object> copy = new HashMap<>(c.properties);

					Optional.ofNullable(
						copy.remove(Constants.SERVICE_PID)
					).map(String.class::cast).ifPresent(
						v -> servicePids.add(v)
					);

					props.putAll(copy);
					_log.debug(l -> l.debug("ComponentProperties: config {}:{}:{} {}", t.pid, t.policy, t.maximumCardinality, props));
				}
			);
		}

		if (!servicePids.isEmpty()) {
			props.put(Constants.SERVICE_PID, servicePids);
		}
		props.put("component.id", _componentId);
		props.put("component.name", template.name);
		_log.debug(l -> l.debug("ComponentProperties: final {}", props));

		return props;
	}