Repository: camel Updated Branches: refs/heads/master 8cb2e8468 -> 805efdf57
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/805efdf5 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/805efdf5 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/805efdf5 Branch: refs/heads/master Commit: 805efdf575f292636b1524c9cc3d75dc5d9bdeb4 Parents: 8cb2e84 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:37 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/805efdf5/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 1714d29..c19f165 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);
