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:57 UTC

[3/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/de0296c3
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/de0296c3
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/de0296c3

Branch: refs/heads/camel-2.12.x
Commit: de0296c37d5f3c3be81fc9df3b3004ff107d86d3
Parents: 609998b
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:18:59 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/de0296c3/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 b88d148..3dae289 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
@@ -269,6 +269,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() {