Search in sources :

Example 1 with LocalConfiguration

use of org.talend.sdk.component.api.service.configuration.LocalConfiguration in project component-runtime by Talend.

the class ComponentManager method createRawLocalConfigurations.

protected Collection<LocalConfiguration> createRawLocalConfigurations() {
    final List<LocalConfiguration> configurations = new ArrayList<>(2);
    configurations.addAll(toStream(loadServiceProviders(LocalConfiguration.class, LocalConfiguration.class.getClassLoader())).collect(toList()));
    configurations.add(new LocalConfiguration() {

        @Override
        public String get(final String key) {
            return System.getProperty(key);
        }

        @Override
        public Set<String> keys() {
            return System.getProperties().stringPropertyNames();
        }
    });
    configurations.add(new LocalConfiguration() {

        @Override
        public String get(final String key) {
            return System.getenv(key);
        }

        @Override
        public Set<String> keys() {
            return System.getenv().keySet();
        }
    });
    return configurations;
}
Also used : Set(java.util.Set) Collectors.toSet(java.util.stream.Collectors.toSet) Collections.emptySet(java.util.Collections.emptySet) ArrayList(java.util.ArrayList) LocalConfiguration(org.talend.sdk.component.api.service.configuration.LocalConfiguration)

Aggregations

ArrayList (java.util.ArrayList)1 Collections.emptySet (java.util.Collections.emptySet)1 Set (java.util.Set)1 Collectors.toSet (java.util.stream.Collectors.toSet)1 LocalConfiguration (org.talend.sdk.component.api.service.configuration.LocalConfiguration)1