This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/CAMEL-13870 by this push:
     new 1fe47fa  CAMEL-13870: Fast property configuration of Camel endpoints. 
Work in progress.
1fe47fa is described below

commit 1fe47fa76a2ca274b0d3c85041475f19196ef804
Author: Claus Ibsen <claus.ib...@gmail.com>
AuthorDate: Thu Aug 22 08:50:23 2019 +0200

    CAMEL-13870: Fast property configuration of Camel endpoints. Work in 
progress.
---
 .../main/java/org/apache/camel/component/mllp/MllpEndpoint.java    | 2 +-
 .../src/main/java/org/apache/camel/support/DefaultComponent.java   | 7 ++++++-
 .../src/main/java/org/apache/camel/support/DefaultEndpoint.java    | 7 ++++++-
 3 files changed, 13 insertions(+), 3 deletions(-)

diff --git 
a/components/camel-mllp/src/main/java/org/apache/camel/component/mllp/MllpEndpoint.java
 
b/components/camel-mllp/src/main/java/org/apache/camel/component/mllp/MllpEndpoint.java
index 69869d7..8a0c6d4 100644
--- 
a/components/camel-mllp/src/main/java/org/apache/camel/component/mllp/MllpEndpoint.java
+++ 
b/components/camel-mllp/src/main/java/org/apache/camel/component/mllp/MllpEndpoint.java
@@ -45,7 +45,7 @@ import org.slf4j.Logger;
  * <p/>
  */
 @ManagedResource(description = "MLLP Endpoint")
-@UriEndpoint(scheme = "mllp", firstVersion = "2.17.0", title = "MLLP", syntax 
= "mllp:hostname:port", label = "mllp")
+@UriEndpoint(scheme = "mllp", firstVersion = "2.17.0", title = "MLLP", syntax 
= "mllp:hostname:port", label = "mllp", generateConfigurer = false)
 public class MllpEndpoint extends DefaultEndpoint {
     // Use constants from MllpProtocolConstants
     @Deprecated()
diff --git 
a/core/camel-support/src/main/java/org/apache/camel/support/DefaultComponent.java
 
b/core/camel-support/src/main/java/org/apache/camel/support/DefaultComponent.java
index 1b15a29..f802404 100644
--- 
a/core/camel-support/src/main/java/org/apache/camel/support/DefaultComponent.java
+++ 
b/core/camel-support/src/main/java/org/apache/camel/support/DefaultComponent.java
@@ -391,7 +391,12 @@ public abstract class DefaultComponent extends 
ServiceSupport implements Compone
      * @param parameters    properties to set
      */
     protected void setProperties(CamelContext camelContext, Object bean, 
Map<String, Object> parameters) throws Exception {
-        if (basicPropertyBinding) {
+        if (parameters == null || parameters.isEmpty()) {
+            return;
+        }
+
+        boolean basic = basicPropertyBinding || 
"true".equals(parameters.getOrDefault("basicPropertyBinding", "false"));
+        if (basic) {
             // use basic binding
             PropertyBindingSupport.build()
                     
.withPlaceholder(false).withNesting(false).withDeepNesting(false).withReference(false)
diff --git 
a/core/camel-support/src/main/java/org/apache/camel/support/DefaultEndpoint.java
 
b/core/camel-support/src/main/java/org/apache/camel/support/DefaultEndpoint.java
index 14c5900..6ebee7f 100644
--- 
a/core/camel-support/src/main/java/org/apache/camel/support/DefaultEndpoint.java
+++ 
b/core/camel-support/src/main/java/org/apache/camel/support/DefaultEndpoint.java
@@ -410,7 +410,12 @@ public abstract class DefaultEndpoint extends 
ServiceSupport implements Endpoint
      * @param parameters  properties to set
      */
     public void setProperties(Object bean, Map<String, Object> parameters) 
throws Exception {
-        if (basicPropertyBinding) {
+        if (parameters == null || parameters.isEmpty()) {
+            return;
+        }
+
+        boolean basic = basicPropertyBinding || 
"true".equals(parameters.getOrDefault("basicPropertyBinding", "false"));
+        if (basic) {
             // use basic binding
             PropertyBindingSupport.build()
                     
.withPlaceholder(false).withNesting(false).withDeepNesting(false).withReference(false)

Reply via email to