You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2016/05/31 07:16:54 UTC

[4/4] camel git commit: CAMEL-10001: Add support for using any property placeholders on load balancers

CAMEL-10001: Add support for using any property placeholders on load balancers


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/f276b5fb
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/f276b5fb
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/f276b5fb

Branch: refs/heads/camel-2.17.x
Commit: f276b5fbe1aa1d18fbd3bd3ab17fe42d3961f757
Parents: d0186a4
Author: Claus Ibsen <da...@apache.org>
Authored: Tue May 31 08:14:00 2016 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Tue May 31 09:16:30 2016 +0200

----------------------------------------------------------------------
 .../camel/model/LoadBalancerDefinition.java     | 18 +++++++++++++++-
 .../camel/model/config/ResequencerConfig.java   | 22 +++++++++++++++++++-
 2 files changed, 38 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/f276b5fb/camel-core/src/main/java/org/apache/camel/model/LoadBalancerDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/LoadBalancerDefinition.java b/camel-core/src/main/java/org/apache/camel/model/LoadBalancerDefinition.java
index 4d4a37c..a219f9e 100644
--- a/camel-core/src/main/java/org/apache/camel/model/LoadBalancerDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/LoadBalancerDefinition.java
@@ -16,10 +16,13 @@
  */
 package org.apache.camel.model;
 
+import java.util.Map;
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAnyAttribute;
 import javax.xml.bind.annotation.XmlTransient;
 import javax.xml.bind.annotation.XmlType;
+import javax.xml.namespace.QName;
 
 import org.apache.camel.processor.loadbalancer.LoadBalancer;
 import org.apache.camel.spi.Metadata;
@@ -33,11 +36,14 @@ import org.apache.camel.util.ObjectHelper;
 @Metadata(label = "eip,routing")
 @XmlType(name = "loadBalancer")
 @XmlAccessorType(XmlAccessType.FIELD)
-public class LoadBalancerDefinition extends IdentifiedType {
+public class LoadBalancerDefinition extends IdentifiedType implements OtherAttributesAware {
     @XmlTransient
     private LoadBalancer loadBalancer;
     @XmlTransient
     private String loadBalancerTypeName;
+    // use xs:any to support optional property placeholders
+    @XmlAnyAttribute
+    private Map<QName, Object> otherAttributes;
 
     public LoadBalancerDefinition() {
     }
@@ -82,6 +88,16 @@ public class LoadBalancerDefinition extends IdentifiedType {
         this.loadBalancer = loadBalancer;
     }
 
+    @Override
+    public Map<QName, Object> getOtherAttributes() {
+        return otherAttributes;
+    }
+
+    @Override
+    public void setOtherAttributes(Map<QName, Object> otherAttributes) {
+        this.otherAttributes = otherAttributes;
+    }
+
     /**
      * Factory method to create the load balancer from the loadBalancerTypeName
      */

http://git-wip-us.apache.org/repos/asf/camel/blob/f276b5fb/camel-core/src/main/java/org/apache/camel/model/config/ResequencerConfig.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/config/ResequencerConfig.java b/camel-core/src/main/java/org/apache/camel/model/config/ResequencerConfig.java
index 5e55445..624eafa 100644
--- a/camel-core/src/main/java/org/apache/camel/model/config/ResequencerConfig.java
+++ b/camel-core/src/main/java/org/apache/camel/model/config/ResequencerConfig.java
@@ -16,11 +16,31 @@
  */
 package org.apache.camel.model.config;
 
+import java.util.Map;
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAnyAttribute;
 import javax.xml.bind.annotation.XmlType;
+import javax.xml.namespace.QName;
+
+import org.apache.camel.model.OtherAttributesAware;
 
 @XmlType(name = "resequencerConfig")
 @XmlAccessorType(XmlAccessType.FIELD)
-public abstract class ResequencerConfig {
+public abstract class ResequencerConfig implements OtherAttributesAware {
+
+    // use xs:any to support optional property placeholders
+    @XmlAnyAttribute
+    private Map<QName, Object> otherAttributes;
+
+    @Override
+    public Map<QName, Object> getOtherAttributes() {
+        return otherAttributes;
+    }
+
+    @Override
+    public void setOtherAttributes(Map<QName, Object> otherAttributes) {
+        this.otherAttributes = otherAttributes;
+    }
+
 }