Package io.openems.common.utils
Class ConfigUtils
java.lang.Object
io.openems.common.utils.ConfigUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
generateReferenceTargetFilter
(String pid, boolean forceEnabled, String... ids) Generates a target filter for a Declarative Service @Reference member.static String
generateReferenceTargetFilter
(String pid, String... ids) Generates a target filter for a Declarative Service @Reference member.
-
Method Details
-
generateReferenceTargetFilter
Generates a target filter for a Declarative Service @Reference member.Usage:
generateReferenceTargetFilter(config.service_pid(), "Controllers", controllersIds);
Generates a 'target' filter on the 'Controllers' member so, that the the expected service to be injected needs to fulfill:
- the service must be enabled
- the service must not have the same PID as the calling component
- the service "id" must be one of the provided "ids"
- Parameters:
pid
- PID of the calling component (use 'config.service_pid()' or '(String)prop.get(Constants.SERVICE_PID)'; if null, PID filter is not added to the resulting target filterids
- Component IDs to be filtered for; for empty list, no ids are added to the target filter- Returns:
- the target filter
-
generateReferenceTargetFilter
Generates a target filter for a Declarative Service @Reference member.Usage:
generateReferenceTargetFilter(config.service_pid(), "Controllers", controllersIds);
Generates a 'target' filter on the 'Controllers' member so, that the the expected service to be injected needs to fulfill:
- the service must be enabled (if 'forceEnabled' is true)
- the service must not have the same PID as the calling component
- the service "id" must be one of the provided "ids"
- Parameters:
pid
- PID of the calling component (use 'config.service_pid()' or '(String)prop.get(Constants.SERVICE_PID)'; if null, PID filter is not added to the resulting target filterforceEnabled
- Allow only target Components that are `enabled=true`ids
- Component IDs to be filtered for; for empty list, no ids are added to the target filter- Returns:
- the target filter
-