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 2013/10/28 13:18:59 UTC

[5/6] git commit: CAMEL-6907: Added setProperties method to DefaultEndpoint just like we have in DefaultComponent that comes handy for component developers.

CAMEL-6907: Added setProperties method to DefaultEndpoint just like we have in DefaultComponent that comes handy for component developers.


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

Branch: refs/heads/camel-2.11.x
Commit: 86e6d54c687a266a0c715b29e1553a5d58cc7500
Parents: a01324c
Author: Claus Ibsen <da...@apache.org>
Authored: Mon Oct 28 13:17:35 2013 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Mon Oct 28 13:19:18 2013 +0100

----------------------------------------------------------------------
 .../java/org/apache/camel/impl/DefaultEndpoint.java   | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/86e6d54c/camel-core/src/main/java/org/apache/camel/impl/DefaultEndpoint.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/impl/DefaultEndpoint.java b/camel-core/src/main/java/org/apache/camel/impl/DefaultEndpoint.java
index 3b12a40..3273229 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/DefaultEndpoint.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/DefaultEndpoint.java
@@ -266,6 +266,20 @@ public abstract class DefaultEndpoint extends ServiceSupport implements Endpoint
     }
 
     /**
+     * Sets the bean properties on the given bean.
+     * <p/>
+     * This is the same logical implementation as {@link DefaultComponent#setProperties(Object, java.util.Map)}
+     *
+     * @param bean  the bean
+     * @param parameters  properties to set
+     */
+    protected void setProperties(Object bean, Map<String, Object> parameters) throws Exception {
+        // set reference properties first as they use # syntax that fools the regular properties setter
+        EndpointHelper.setReferenceProperties(getCamelContext(), bean, parameters);
+        EndpointHelper.setProperties(getCamelContext(), bean, parameters);
+    }
+
+    /**
      * A factory method to lazily create the endpointUri if none is specified
      */
     protected String createEndpointUri() {