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 2019/12/12 12:41:28 UTC

[camel] branch master updated (c36f04e -> dc9b027)

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

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


    from c36f04e  CAMEL-14284: Configuring endpoint should set properties on endpoint and not configuration object - spring-ws
     new 08f28a5  CAMEL-14284: Configuring endpoint should set properties on endpoint and not configuration object - jooq
     new dc9b027  jooq upgrade issue

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../apache/camel/component/jooq/JooqComponent.java | 40 +++++++++++++++++-----
 .../apache/camel/component/jooq/JooqEndpoint.java  | 29 ----------------
 parent/pom.xml                                     |  1 +
 3 files changed, 32 insertions(+), 38 deletions(-)


[camel] 02/02: jooq upgrade issue

Posted by da...@apache.org.
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 dc9b0274cfc3e458a3e612c004be799faac95da9
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Thu Dec 12 13:41:07 2019 +0100

    jooq upgrade issue
---
 parent/pom.xml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/parent/pom.xml b/parent/pom.xml
index 755bcb4..253eb9d 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -369,6 +369,7 @@
         <jolt-version>0.1.1</jolt-version>
         <jolt-bundle-version>0.1.1_1</jolt-bundle-version>
         <jool-version>0.9.12</jool-version>
+        <!-- cannot upgrade jooq: https://github.com/jOOQ/jOOQ/issues/9670 -->
         <jooq-version>3.11.12</jooq-version>
         <johnzon-version>1.2.2</johnzon-version>
         <jose4j-version>0.6.4</jose4j-version>


[camel] 01/02: CAMEL-14284: Configuring endpoint should set properties on endpoint and not configuration object - jooq

Posted by da...@apache.org.
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 08f28a568a737aeb160ff118865f7bfa3af4eab1
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Thu Dec 12 13:13:37 2019 +0100

    CAMEL-14284: Configuring endpoint should set properties on endpoint and not configuration object - jooq
---
 .../apache/camel/component/jooq/JooqComponent.java | 40 +++++++++++++++++-----
 .../apache/camel/component/jooq/JooqEndpoint.java  | 29 ----------------
 2 files changed, 31 insertions(+), 38 deletions(-)

diff --git a/components/camel-jooq/src/main/java/org/apache/camel/component/jooq/JooqComponent.java b/components/camel-jooq/src/main/java/org/apache/camel/component/jooq/JooqComponent.java
index 52a3df6..9486e45 100644
--- a/components/camel-jooq/src/main/java/org/apache/camel/component/jooq/JooqComponent.java
+++ b/components/camel-jooq/src/main/java/org/apache/camel/component/jooq/JooqComponent.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.jooq;
 
 import java.util.Map;
 
+import org.apache.camel.CamelContext;
 import org.apache.camel.Endpoint;
 import org.apache.camel.spi.Metadata;
 import org.apache.camel.spi.annotations.Component;
@@ -29,20 +30,13 @@ public class JooqComponent extends DefaultComponent {
     @Metadata(description = "Component configuration (database connection, database entity type, etc.)")
     private JooqConfiguration configuration;
 
-    public JooqComponent() {
-    }
-
-    @Override
-    protected void doStart() throws Exception {
-        super.doStart();
-    }
-
     @Override
     protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
         JooqConfiguration conf = configuration != null ? configuration.copy() : new JooqConfiguration();
-        setProperties(conf, parameters);
 
         JooqEndpoint endpoint = new JooqEndpoint(uri, remaining, this, conf);
+        setProperties(endpoint, parameters);
+        initConfiguration(getCamelContext(), conf, remaining);
         return endpoint;
     }
 
@@ -53,4 +47,32 @@ public class JooqComponent extends DefaultComponent {
     public void setConfiguration(JooqConfiguration jooqConfiguration) {
         this.configuration = jooqConfiguration;
     }
+
+    private static void initConfiguration(CamelContext camelContext, JooqConfiguration configuration, String remaining) {
+        if (remaining == null) {
+            return;
+        }
+
+        String[] parts = remaining.split("/");
+        if (parts.length == 0 || parts.length > 2) {
+            throw new IllegalArgumentException("Unexpected URI format. Expected ... , found '" + remaining + "'");
+        }
+
+        String className = parts[0];
+        Class<?> type = camelContext.getClassResolver().resolveClass(className);
+        if (type != null) {
+            configuration.setEntityType(type);
+        }
+
+        if (parts.length > 1) {
+            String op = parts[1];
+            JooqOperation operation = camelContext.getTypeConverter().convertTo(JooqOperation.class, op);
+            if (operation != null) {
+                configuration.setOperation(operation);
+            } else {
+                throw new IllegalArgumentException("Wrong operation: " + op);
+            }
+        }
+    }
+
 }
diff --git a/components/camel-jooq/src/main/java/org/apache/camel/component/jooq/JooqEndpoint.java b/components/camel-jooq/src/main/java/org/apache/camel/component/jooq/JooqEndpoint.java
index 1cfe595..95b2451 100644
--- a/components/camel-jooq/src/main/java/org/apache/camel/component/jooq/JooqEndpoint.java
+++ b/components/camel-jooq/src/main/java/org/apache/camel/component/jooq/JooqEndpoint.java
@@ -40,35 +40,6 @@ public class JooqEndpoint extends ScheduledPollEndpoint {
     public JooqEndpoint(String uri, String remaining, JooqComponent component, JooqConfiguration configuration) {
         super(uri, component);
         this.configuration = configuration;
-
-        initConfiguration(remaining);
-    }
-
-    private void initConfiguration(String remaining) {
-        if (remaining == null) {
-            return;
-        }
-
-        String[] parts = remaining.split("/");
-        if (parts.length == 0 || parts.length > 2) {
-            throw new IllegalArgumentException("Unexpected URI format. Expected ... , found '" + remaining + "'");
-        }
-
-        String className = parts[0];
-        Class<?> type = getCamelContext().getClassResolver().resolveClass(className);
-        if (type != null) {
-            configuration.setEntityType(type);
-        }
-
-        if (parts.length > 1) {
-            String op = parts[1];
-            JooqOperation operation = getCamelContext().getTypeConverter().convertTo(JooqOperation.class, op);
-            if (operation != null) {
-                configuration.setOperation(operation);
-            } else {
-                throw new IllegalArgumentException("Wrong operation: " + op);
-            }
-        }
     }
 
     @Override