camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [camel] 02/02: CAMEL-13557: Add property binding support to make it convenient to configure components and whatnot.
Date Sun, 26 May 2019 07:16:29 GMT
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit ea0e43499221032d535827dce41cb4b0ec9e5af5
Author: Claus Ibsen <claus.ibsen@gmail.com>
AuthorDate: Sun May 26 09:16:13 2019 +0200

    CAMEL-13557: Add property binding support to make it convenient to configure components
and whatnot.
---
 .../apache/camel/model/LoadBalancerDefinition.java | 11 --------
 .../camel/model/ProcessorDefinitionHelper.java     |  7 +++--
 .../camel/model/language/ExpressionDefinition.java |  4 +--
 .../camel/model/language/JsonPathExpression.java   | 24 ++++++++--------
 .../camel/model/language/MethodCallExpression.java |  8 +++---
 .../model/language/XMLTokenizerExpression.java     | 12 ++++----
 .../camel/model/language/XPathExpression.java      | 32 +++++++++++-----------
 .../camel/model/language/XQueryExpression.java     |  8 +++---
 .../org/apache/camel/reifier/ChoiceReifier.java    |  2 +-
 .../org/apache/camel/reifier/ProcessorReifier.java |  8 +++---
 .../reifier/dataformat/DataFormatReifier.java      |  2 +-
 .../runtimecatalog/impl/JSonSchemaHelperTest.java  |  9 +++---
 .../camel/support/builder/ExpressionBuilder.java   | 18 ++++++------
 13 files changed, 68 insertions(+), 77 deletions(-)

diff --git a/core/camel-core/src/main/java/org/apache/camel/model/LoadBalancerDefinition.java
b/core/camel-core/src/main/java/org/apache/camel/model/LoadBalancerDefinition.java
index 4e5996f..7948897 100644
--- a/core/camel-core/src/main/java/org/apache/camel/model/LoadBalancerDefinition.java
+++ b/core/camel-core/src/main/java/org/apache/camel/model/LoadBalancerDefinition.java
@@ -56,17 +56,6 @@ public class LoadBalancerDefinition extends IdentifiedType implements OtherAttri
     }
 
     /**
-     * Sets a named property on the data format instance using introspection
-     */
-    protected void setProperty(Object bean, String name, Object value) {
-        try {
-            IntrospectionSupport.setProperty(bean, name, value);
-        } catch (Exception e) {
-            throw new IllegalArgumentException("Failed to set property " + name + " on "
+ bean + ". Reason: " + e, e);
-        }
-    }
-
-    /**
      * Maximum number of outputs, as some load balancers only support 1 processor
      */
     public int getMaximumNumberOfOutputs() {
diff --git a/core/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinitionHelper.java
b/core/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinitionHelper.java
index b0f55c5..19df7cc 100644
--- a/core/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinitionHelper.java
+++ b/core/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinitionHelper.java
@@ -755,9 +755,10 @@ public final class ProcessorDefinitionHelper {
      * This implementation will check all the getter/setter pairs on this instance and for
all the values
      * (which is a String type) will check if it refers to a known field (such as on Exchange).
      *
-     * @param definition the definition
+     * @param camelContext the camel context
+     * @param definition   the definition
      */
-    public static void resolveKnownConstantFields(Object definition) throws Exception {
+    public static void resolveKnownConstantFields(CamelContext camelContext, Object definition)
throws Exception {
         LOG.trace("Resolving known fields for: {}", definition);
 
         // find all String getter/setter
@@ -782,7 +783,7 @@ public final class ProcessorDefinitionHelper {
                         String constant = ObjectHelper.lookupConstantFieldValue(Exchange.class,
field);
                         if (constant != null) {
                             // invoke setter as the text has changed
-                            IntrospectionSupport.setProperty(definition, name, constant);
+                            IntrospectionSupport.setProperty(camelContext, definition, name,
constant);
                             changedProperties.put(name, value);
                             if (LOG.isDebugEnabled()) {
                                 LOG.debug("Changed property [{}] from: {} to: {}", name,
value, constant);
diff --git a/core/camel-core/src/main/java/org/apache/camel/model/language/ExpressionDefinition.java
b/core/camel-core/src/main/java/org/apache/camel/model/language/ExpressionDefinition.java
index 3facfaf..3669bd8 100644
--- a/core/camel-core/src/main/java/org/apache/camel/model/language/ExpressionDefinition.java
+++ b/core/camel-core/src/main/java/org/apache/camel/model/language/ExpressionDefinition.java
@@ -323,9 +323,9 @@ public class ExpressionDefinition implements Expression, Predicate, OtherAttribu
     /**
      * Sets a named property on the object instance using introspection
      */
-    protected void setProperty(Object bean, String name, Object value) {
+    protected void setProperty(CamelContext camelContext, Object bean, String name, Object
value) {
         try {
-            IntrospectionSupport.setProperty(bean, name, value);
+            IntrospectionSupport.setProperty(camelContext, bean, name, value);
         } catch (Exception e) {
             throw new IllegalArgumentException("Failed to set property " + name + " on "
+ bean
                                                + ". Reason: " + e, e);
diff --git a/core/camel-core/src/main/java/org/apache/camel/model/language/JsonPathExpression.java
b/core/camel-core/src/main/java/org/apache/camel/model/language/JsonPathExpression.java
index da729ab..eb28775 100644
--- a/core/camel-core/src/main/java/org/apache/camel/model/language/JsonPathExpression.java
+++ b/core/camel-core/src/main/java/org/apache/camel/model/language/JsonPathExpression.java
@@ -154,22 +154,22 @@ public class JsonPathExpression extends ExpressionDefinition {
     @Override
     protected void configureExpression(CamelContext camelContext, Expression expression)
{
         if (resultType != null) {
-            setProperty(expression, "resultType", resultType);
+            setProperty(camelContext, expression, "resultType", resultType);
         }
         if (suppressExceptions != null) {
-            setProperty(expression, "suppressExceptions", suppressExceptions);
+            setProperty(camelContext, expression, "suppressExceptions", suppressExceptions);
         }
         if (allowSimple != null) {
-            setProperty(expression, "allowSimple", allowSimple);
+            setProperty(camelContext, expression, "allowSimple", allowSimple);
         }
         if (allowEasyPredicate != null) {
-            setProperty(expression, "allowEasyPredicate", allowEasyPredicate);
+            setProperty(camelContext, expression, "allowEasyPredicate", allowEasyPredicate);
         }
         if (writeAsString != null) {
-            setProperty(expression, "writeAsString", writeAsString);
+            setProperty(camelContext, expression, "writeAsString", writeAsString);
         }
         if (headerName != null) {
-            setProperty(expression, "headerName", headerName);
+            setProperty(camelContext, expression, "headerName", headerName);
         }
         super.configureExpression(camelContext, expression);
     }
@@ -177,22 +177,22 @@ public class JsonPathExpression extends ExpressionDefinition {
     @Override
     protected void configurePredicate(CamelContext camelContext, Predicate predicate) {
         if (resultType != null) {
-            setProperty(predicate, "resultType", resultType);
+            setProperty(camelContext, predicate, "resultType", resultType);
         }
         if (suppressExceptions != null) {
-            setProperty(predicate, "suppressExceptions", suppressExceptions);
+            setProperty(camelContext, predicate, "suppressExceptions", suppressExceptions);
         }
         if (allowSimple != null) {
-            setProperty(predicate, "allowSimple", allowSimple);
+            setProperty(camelContext, predicate, "allowSimple", allowSimple);
         }
         if (allowEasyPredicate != null) {
-            setProperty(predicate, "allowEasyPredicate", allowEasyPredicate);
+            setProperty(camelContext, predicate, "allowEasyPredicate", allowEasyPredicate);
         }
         if (writeAsString != null) {
-            setProperty(predicate, "writeAsString", writeAsString);
+            setProperty(camelContext, predicate, "writeAsString", writeAsString);
         }
         if (headerName != null) {
-            setProperty(predicate, "headerName", headerName);
+            setProperty(camelContext, predicate, "headerName", headerName);
         }
         super.configurePredicate(camelContext, predicate);
     }
diff --git a/core/camel-core/src/main/java/org/apache/camel/model/language/MethodCallExpression.java
b/core/camel-core/src/main/java/org/apache/camel/model/language/MethodCallExpression.java
index 68520ba..4d5e8ce 100644
--- a/core/camel-core/src/main/java/org/apache/camel/model/language/MethodCallExpression.java
+++ b/core/camel-core/src/main/java/org/apache/camel/model/language/MethodCallExpression.java
@@ -173,16 +173,16 @@ public class MethodCallExpression extends ExpressionDefinition {
 
     protected void configureLanguage(CamelContext camelContext, Language language) {
         if (instance != null) {
-            setProperty(language, "bean", instance);
+            setProperty(camelContext, language, "bean", instance);
         }
         if (beanType != null) {
-            setProperty(language, "beanType", beanType);
+            setProperty(camelContext, language, "beanType", beanType);
         }
         if (ref != null) {
-            setProperty(language, "ref", ref);
+            setProperty(camelContext, language, "ref", ref);
         }
         if (method != null) {
-            setProperty(language, "method", method);
+            setProperty(camelContext, language, "method", method);
         }
     }
 
diff --git a/core/camel-core/src/main/java/org/apache/camel/model/language/XMLTokenizerExpression.java
b/core/camel-core/src/main/java/org/apache/camel/model/language/XMLTokenizerExpression.java
index 7c09111..1cd75a5 100644
--- a/core/camel-core/src/main/java/org/apache/camel/model/language/XMLTokenizerExpression.java
+++ b/core/camel-core/src/main/java/org/apache/camel/model/language/XMLTokenizerExpression.java
@@ -96,13 +96,13 @@ public class XMLTokenizerExpression extends NamespaceAwareExpression {
     @Override
     protected void configureExpression(CamelContext camelContext, Expression expression)
{
         if (headerName != null) {
-            setProperty(expression, "headerName", headerName);
+            setProperty(camelContext, expression, "headerName", headerName);
         }
         if (mode != null) {
-            setProperty(expression, "mode", mode);
+            setProperty(camelContext, expression, "mode", mode);
         }
         if (group != null) {
-            setProperty(expression, "group", group);
+            setProperty(camelContext, expression, "group", group);
         }
         super.configureExpression(camelContext, expression);
     }
@@ -110,13 +110,13 @@ public class XMLTokenizerExpression extends NamespaceAwareExpression
{
     @Override
     protected void configurePredicate(CamelContext camelContext, Predicate predicate) {
         if (headerName != null) {
-            setProperty(predicate, "headerName", headerName);
+            setProperty(camelContext, predicate, "headerName", headerName);
         }
         if (mode != null) {
-            setProperty(predicate, "mode", mode);
+            setProperty(camelContext, predicate, "mode", mode);
         }
         if (group != null) {
-            setProperty(predicate, "group", group);
+            setProperty(camelContext, predicate, "group", group);
         }
         super.configurePredicate(camelContext, predicate);
     }
diff --git a/core/camel-core/src/main/java/org/apache/camel/model/language/XPathExpression.java
b/core/camel-core/src/main/java/org/apache/camel/model/language/XPathExpression.java
index 7ac65e0..00c7c42 100644
--- a/core/camel-core/src/main/java/org/apache/camel/model/language/XPathExpression.java
+++ b/core/camel-core/src/main/java/org/apache/camel/model/language/XPathExpression.java
@@ -240,28 +240,28 @@ public class XPathExpression extends NamespaceAwareExpression {
         boolean isLogNamespaces = getLogNamespaces() != null && getLogNamespaces();
 
         if (documentType != null) {
-            setProperty(expression, "documentType", documentType);
+            setProperty(camelContext, expression, "documentType", documentType);
         }
         if (resultType != null) {
-            setProperty(expression, "resultType", resultType);
+            setProperty(camelContext, expression, "resultType", resultType);
         }
         if (isSaxon) {
-            setProperty(expression, "useSaxon", true);
+            setProperty(camelContext, expression, "useSaxon", true);
         }
         if (xpathFactory != null) {
-            setProperty(expression, "xPathFactory", xpathFactory);
+            setProperty(camelContext, expression, "xPathFactory", xpathFactory);
         }
         if (objectModel != null) {
-            setProperty(expression, "objectModelUri", objectModel);
+            setProperty(camelContext, expression, "objectModelUri", objectModel);
         }
         if (threadSafety != null) {
-            setProperty(expression, "threadSafety", threadSafety);
+            setProperty(camelContext, expression, "threadSafety", threadSafety);
         }
         if (isLogNamespaces) {
-            setProperty(expression, "logNamespaces", true);
+            setProperty(camelContext, expression, "logNamespaces", true);
         }
         if (ObjectHelper.isNotEmpty(getHeaderName())) {
-            setProperty(expression, "headerName", getHeaderName());
+            setProperty(camelContext, expression, "headerName", getHeaderName());
         }
         // moved the super configuration to the bottom so that the namespace init picks up
the newly set XPath Factory
         super.configureExpression(camelContext, expression);
@@ -273,28 +273,28 @@ public class XPathExpression extends NamespaceAwareExpression {
         boolean isLogNamespaces = getLogNamespaces() != null && getLogNamespaces();
 
         if (documentType != null) {
-            setProperty(predicate, "documentType", documentType);
+            setProperty(camelContext, predicate, "documentType", documentType);
         }
         if (resultType != null) {
-            setProperty(predicate, "resultType", resultType);
+            setProperty(camelContext, predicate, "resultType", resultType);
         }
         if (isSaxon) {
-            setProperty(predicate, "useSaxon", true);
+            setProperty(camelContext, predicate, "useSaxon", true);
         }
         if (xpathFactory != null) {
-            setProperty(predicate, "xPathFactory", xpathFactory);
+            setProperty(camelContext, predicate, "xPathFactory", xpathFactory);
         }
         if (objectModel != null) {
-            setProperty(predicate, "objectModelUri", objectModel);
+            setProperty(camelContext, predicate, "objectModelUri", objectModel);
         }
         if (threadSafety != null) {
-            setProperty(predicate, "threadSafety", threadSafety);
+            setProperty(camelContext, predicate, "threadSafety", threadSafety);
         }
         if (isLogNamespaces) {
-            setProperty(predicate, "logNamespaces", true);
+            setProperty(camelContext, predicate, "logNamespaces", true);
         }
         if (ObjectHelper.isNotEmpty(getHeaderName())) {
-            setProperty(predicate, "headerName", getHeaderName());
+            setProperty(camelContext, predicate, "headerName", getHeaderName());
         }
         // moved the super configuration to the bottom so that the namespace init picks up
the newly set XPath Factory
         super.configurePredicate(camelContext, predicate);
diff --git a/core/camel-core/src/main/java/org/apache/camel/model/language/XQueryExpression.java
b/core/camel-core/src/main/java/org/apache/camel/model/language/XQueryExpression.java
index 37fbf96..615188f 100644
--- a/core/camel-core/src/main/java/org/apache/camel/model/language/XQueryExpression.java
+++ b/core/camel-core/src/main/java/org/apache/camel/model/language/XQueryExpression.java
@@ -107,10 +107,10 @@ public class XQueryExpression extends NamespaceAwareExpression {
     @Override
     protected void configureExpression(CamelContext camelContext, Expression expression)
{
         if (resultType != null) {
-            setProperty(expression, "resultType", resultType);
+            setProperty(camelContext, expression, "resultType", resultType);
         }
         if (ObjectHelper.isNotEmpty(getHeaderName())) {
-            setProperty(expression, "headerName", getHeaderName());
+            setProperty(camelContext, expression, "headerName", getHeaderName());
         }
         super.configureExpression(camelContext, expression);
     }
@@ -118,10 +118,10 @@ public class XQueryExpression extends NamespaceAwareExpression {
     @Override
     protected void configurePredicate(CamelContext camelContext, Predicate predicate) {
         if (resultType != null) {
-            setProperty(predicate, "resultType", resultType);
+            setProperty(camelContext, predicate, "resultType", resultType);
         }
         if (ObjectHelper.isNotEmpty(getHeaderName())) {
-            setProperty(predicate, "headerName", getHeaderName());
+            setProperty(camelContext, predicate, "headerName", getHeaderName());
         }
         super.configurePredicate(camelContext, predicate);
     }
diff --git a/core/camel-core/src/main/java/org/apache/camel/reifier/ChoiceReifier.java b/core/camel-core/src/main/java/org/apache/camel/reifier/ChoiceReifier.java
index 11fa17e..272d79f 100644
--- a/core/camel-core/src/main/java/org/apache/camel/reifier/ChoiceReifier.java
+++ b/core/camel-core/src/main/java/org/apache/camel/reifier/ChoiceReifier.java
@@ -68,7 +68,7 @@ class ChoiceReifier extends ProcessorReifier<ChoiceDefinition> {
                 ProcessorDefinitionHelper.resolvePropertyPlaceholders(routeContext.getCamelContext(),
exp);
 
                 // resolve constant fields (eg Exchange.FILE_NAME)
-                ProcessorDefinitionHelper.resolveKnownConstantFields(exp);
+                ProcessorDefinitionHelper.resolveKnownConstantFields(routeContext.getCamelContext(),
exp);
             }
 
             FilterProcessor filter = (FilterProcessor) createProcessor(routeContext, whenClause);
diff --git a/core/camel-core/src/main/java/org/apache/camel/reifier/ProcessorReifier.java
b/core/camel-core/src/main/java/org/apache/camel/reifier/ProcessorReifier.java
index 891ca43..e42afe1 100644
--- a/core/camel-core/src/main/java/org/apache/camel/reifier/ProcessorReifier.java
+++ b/core/camel-core/src/main/java/org/apache/camel/reifier/ProcessorReifier.java
@@ -432,7 +432,7 @@ public abstract class ProcessorReifier<T extends ProcessorDefinition<?>>
{
             ProcessorDefinitionHelper.resolvePropertyPlaceholders(routeContext.getCamelContext(),
output);
 
             // resolve constant fields (eg Exchange.FILE_NAME)
-            ProcessorDefinitionHelper.resolveKnownConstantFields(output);
+            ProcessorDefinitionHelper.resolveKnownConstantFields(routeContext.getCamelContext(),
output);
 
             // also resolve properties and constant fields on embedded expressions
             ProcessorDefinition<?> me = (ProcessorDefinition<?>) output;
@@ -444,7 +444,7 @@ public abstract class ProcessorReifier<T extends ProcessorDefinition<?>>
{
                     ProcessorDefinitionHelper.resolvePropertyPlaceholders(routeContext.getCamelContext(),
expressionDefinition);
 
                     // resolve constant fields (eg Exchange.FILE_NAME)
-                    ProcessorDefinitionHelper.resolveKnownConstantFields(expressionDefinition);
+                    ProcessorDefinitionHelper.resolveKnownConstantFields(routeContext.getCamelContext(),
expressionDefinition);
                 }
             }
 
@@ -515,7 +515,7 @@ public abstract class ProcessorReifier<T extends ProcessorDefinition<?>>
{
         ProcessorDefinitionHelper.resolvePropertyPlaceholders(routeContext.getCamelContext(),
definition);
 
         // resolve constant fields (eg Exchange.FILE_NAME)
-        ProcessorDefinitionHelper.resolveKnownConstantFields(definition);
+        ProcessorDefinitionHelper.resolveKnownConstantFields(routeContext.getCamelContext(),
definition);
 
         // also resolve properties and constant fields on embedded expressions
         ProcessorDefinition<?> me = definition;
@@ -527,7 +527,7 @@ public abstract class ProcessorReifier<T extends ProcessorDefinition<?>>
{
                 ProcessorDefinitionHelper.resolvePropertyPlaceholders(routeContext.getCamelContext(),
expressionDefinition);
 
                 // resolve constant fields (eg Exchange.FILE_NAME)
-                ProcessorDefinitionHelper.resolveKnownConstantFields(expressionDefinition);
+                ProcessorDefinitionHelper.resolveKnownConstantFields(routeContext.getCamelContext(),
expressionDefinition);
             }
         }
 
diff --git a/core/camel-core/src/main/java/org/apache/camel/reifier/dataformat/DataFormatReifier.java
b/core/camel-core/src/main/java/org/apache/camel/reifier/dataformat/DataFormatReifier.java
index 635f7f5..df57391 100644
--- a/core/camel-core/src/main/java/org/apache/camel/reifier/dataformat/DataFormatReifier.java
+++ b/core/camel-core/src/main/java/org/apache/camel/reifier/dataformat/DataFormatReifier.java
@@ -228,7 +228,7 @@ public abstract class DataFormatReifier<T extends DataFormatDefinition>
{
             if (isReferenceParameter(ref) && camelContext != null) {
                 IntrospectionSupport.setProperty(camelContext, camelContext.getTypeConverter(),
bean, name, null, ref, true);
             } else {
-                IntrospectionSupport.setProperty(bean, name, value);
+                IntrospectionSupport.setProperty(camelContext, bean, name, value);
             }
         } catch (Exception e) {
             throw new IllegalArgumentException("Failed to set property: " + name + " on:
" + bean + ". Reason: " + e, e);
diff --git a/core/camel-core/src/test/java/org/apache/camel/runtimecatalog/impl/JSonSchemaHelperTest.java
b/core/camel-core/src/test/java/org/apache/camel/runtimecatalog/impl/JSonSchemaHelperTest.java
index 578229f..24c7461 100644
--- a/core/camel-core/src/test/java/org/apache/camel/runtimecatalog/impl/JSonSchemaHelperTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/runtimecatalog/impl/JSonSchemaHelperTest.java
@@ -54,12 +54,13 @@ public class JSonSchemaHelperTest extends ContextTestSupport {
         assertEquals("version", rows.get(16).keySet().iterator().next());
 
         rows = JSonSchemaHelper.parseJsonSchema("properties", json, true);
-        assertEquals(5, rows.size());
+        assertEquals(6, rows.size());
         assertEquals("beanName", rows.get(0).values().iterator().next());
         assertEquals("method", rows.get(1).values().iterator().next());
-        assertEquals("cache", rows.get(2).values().iterator().next());
-        assertEquals("parameters", rows.get(3).values().iterator().next());
-        assertEquals("synchronous", rows.get(4).values().iterator().next());
+        assertEquals("basicPropertyBinding", rows.get(2).values().iterator().next());
+        assertEquals("cache", rows.get(3).values().iterator().next());
+        assertEquals("parameters", rows.get(4).values().iterator().next());
+        assertEquals("synchronous", rows.get(5).values().iterator().next());
     }
 
     @Test
diff --git a/core/camel-support/src/main/java/org/apache/camel/support/builder/ExpressionBuilder.java
b/core/camel-support/src/main/java/org/apache/camel/support/builder/ExpressionBuilder.java
index e97813c..de302e6 100644
--- a/core/camel-support/src/main/java/org/apache/camel/support/builder/ExpressionBuilder.java
+++ b/core/camel-support/src/main/java/org/apache/camel/support/builder/ExpressionBuilder.java
@@ -1525,8 +1525,8 @@ public class ExpressionBuilder {
         return new ExpressionAdapter() {
             public Object evaluate(Exchange exchange) {
                 Language language = exchange.getContext().resolveLanguage("bean");
-                setProperty(language, "bean", bean);
-                setProperty(language, "method", expression);
+                setProperty(exchange.getContext(), language, "bean", bean);
+                setProperty(exchange.getContext(), language, "method", expression);
                 return language.createExpression(null).evaluate(exchange, Object.class);
             }
 
@@ -1618,18 +1618,18 @@ public class ExpressionBuilder {
             public Object evaluate(Exchange exchange) {
                 Language language = exchange.getContext().resolveLanguage("xtokenize");
                 if (headerName != null) {
-                    setProperty(language, "headerName", headerName);
+                    setProperty(exchange.getContext(), language, "headerName", headerName);
                 }
                 if (mode != 'i') {
-                    setProperty(language, "mode", mode);
+                    setProperty(exchange.getContext(), language, "mode", mode);
                 }
                 if (group > 1) {
-                    setProperty(language, "group", group);
+                    setProperty(exchange.getContext(), language, "group", group);
                 }
                 if (namespaces != null) {
-                    setProperty(language, "namespaces", namespaces);
+                    setProperty(exchange.getContext(), language, "namespaces", namespaces);
                 }
-                setProperty(language, "path", path);
+                setProperty(exchange.getContext(), language, "path", path);
                 return language.createExpression(null).evaluate(exchange, Object.class);
             }
 
@@ -1640,9 +1640,9 @@ public class ExpressionBuilder {
         };
     }
 
-    protected static void setProperty(Object bean, String name, Object value) {
+    protected static void setProperty(CamelContext camelContext, Object bean, String name,
Object value) {
         try {
-            IntrospectionSupport.setProperty(bean, name, value);
+            IntrospectionSupport.setProperty(camelContext, bean, name, value);
         } catch (Exception e) {
             throw new IllegalArgumentException("Failed to set property " + name + " on "
+ bean + ". Reason: " + e, e);
         }


Mime
View raw message