Repository: camel Updated Branches: refs/heads/camel-2.15.x d83aea2b1 -> 42d16b70a
CAMEL-8974: Properties component support systemPropertiesMode to control whether JVM system properties are in use. When in Spring bridge mode it uses the spring configured value. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/42d16b70 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/42d16b70 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/42d16b70 Branch: refs/heads/camel-2.15.x Commit: 42d16b70af492b515b546a8701808dc77a39ad9f Parents: d83aea2 Author: Claus Ibsen <[email protected]> Authored: Sat Jul 18 08:38:50 2015 +0200 Committer: Claus Ibsen <[email protected]> Committed: Sat Jul 18 09:06:14 2015 +0200 ---------------------------------------------------------------------- .../camel/component/properties/DefaultPropertiesParser.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/42d16b70/camel-core/src/main/java/org/apache/camel/component/properties/DefaultPropertiesParser.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/component/properties/DefaultPropertiesParser.java b/camel-core/src/main/java/org/apache/camel/component/properties/DefaultPropertiesParser.java index 127b988..a3bbc8d 100644 --- a/camel-core/src/main/java/org/apache/camel/component/properties/DefaultPropertiesParser.java +++ b/camel-core/src/main/java/org/apache/camel/component/properties/DefaultPropertiesParser.java @@ -299,7 +299,10 @@ public class DefaultPropertiesParser implements AugmentedPropertyNameAwareProper private String doGetPropertyValue(String key) { String value = null; - if (propertiesComponent.getSystemPropertiesMode() == PropertiesComponent.SYSTEM_PROPERTIES_MODE_OVERRIDE) { + // override is the default mode + int mode = propertiesComponent != null ? propertiesComponent.getSystemPropertiesMode() : PropertiesComponent.SYSTEM_PROPERTIES_MODE_OVERRIDE; + + if (mode == PropertiesComponent.SYSTEM_PROPERTIES_MODE_OVERRIDE) { value = System.getProperty(key); if (value != null) { log.debug("Found a JVM system property: {} with value: {} to be used.", key, value); @@ -313,7 +316,7 @@ public class DefaultPropertiesParser implements AugmentedPropertyNameAwareProper } } - if (value == null && propertiesComponent.getSystemPropertiesMode() == PropertiesComponent.SYSTEM_PROPERTIES_MODE_FALLBACK) { + if (value == null && mode == PropertiesComponent.SYSTEM_PROPERTIES_MODE_FALLBACK) { value = System.getProperty(key); if (value != null) { log.debug("Found a JVM system property: {} with value: {} to be used.", key, value);
