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/07 20:54:16 UTC

[camel] branch master updated (34762f1 -> ce7e7fb)

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 34762f1  CAMEL-14263: camel-kubernetes should use source code generated configurer to avoid reflection configuration.
     new 5f3f0eb  CAMEL-14272: Configuring endpoint with bean reference should fail if no such bean found when using source code generated configurer.
     new ac43bbe  Polished
     new ecbcfa9  CAMEL-14263: camel-mina should use source code generated configurer to avoid reflection configuration.
     new b86fd0d  CAMEL-14263: camel-nagios should use source code generated configurer to avoid reflection configuration.
     new 5775701  CAMEL-14263: camel-crypto should use source code generated configurer to avoid reflection configuration.
     new 4220221  CAMEL-14263: camel-smpp should use source code generated configurer to avoid reflection configuration.
     new c4f93f2  CAMEL-14263: camel-spark-rest should use source code generated configurer to avoid reflection configuration.
     new ce7e7fb  CAMEL-14263: camel-zookeeper should use source code generated configurer to avoid reflection configuration.

The 8 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:
 .../crypto/DigitalSignatureComponent.java          |  10 +-
 .../apache/camel/component/mina/MinaComponent.java |   6 +-
 .../src/main/docs/nagios-component.adoc            |   3 +-
 .../camel/component/nagios/NagiosComponent.java    |   1 -
 .../component/nagios/NagiosConfiguration.java      |  22 --
 .../component/nagios/NagiosEncryptionMethod.java   |  28 --
 .../camel/component/nagios/NagiosEndpoint.java     |  18 +-
 .../component/nagios/NagiosAsyncSendTest.java      |  51 ---
 .../apache/camel/component/nagios/NagiosTest.java  |  14 +-
 .../component/nagios/NagiosXorEncryptionTest.java  |  13 +-
 .../apache/camel/component/smpp/SmppComponent.java |   2 -
 .../camel/component/smpp/SmppComponentTest.java    |  25 +-
 .../camel/component/sparkrest/SparkComponent.java  |   2 -
 .../component/zookeeper/ZooKeeperComponent.java    |  10 +-
 .../endpoint/dsl/NagiosEndpointBuilderFactory.java |  40 ---
 .../endpoint/dsl/SparkEndpointBuilderFactory.java  | 347 +++++++++++++++------
 core/camel-management/pom.xml                      |   4 +-
 .../component/PropertyConfigurerSupport.java       |   4 +
 .../springboot/NagiosComponentConfiguration.java   |  18 --
 19 files changed, 287 insertions(+), 331 deletions(-)
 delete mode 100644 components/camel-nagios/src/main/java/org/apache/camel/component/nagios/NagiosEncryptionMethod.java
 delete mode 100644 components/camel-nagios/src/test/java/org/apache/camel/component/nagios/NagiosAsyncSendTest.java


[camel] 01/08: CAMEL-14272: Configuring endpoint with bean reference should fail if no such bean found when using source code generated configurer.

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 5f3f0ebd789ce56fbc42284f4322b349124e20c7
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sat Dec 7 21:04:34 2019 +0100

    CAMEL-14272: Configuring endpoint with bean reference should fail if no such bean found when using source code generated configurer.
---
 .../org/apache/camel/support/component/PropertyConfigurerSupport.java | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/core/camel-support/src/main/java/org/apache/camel/support/component/PropertyConfigurerSupport.java b/core/camel-support/src/main/java/org/apache/camel/support/component/PropertyConfigurerSupport.java
index bf5f772..4cdc655 100644
--- a/core/camel-support/src/main/java/org/apache/camel/support/component/PropertyConfigurerSupport.java
+++ b/core/camel-support/src/main/java/org/apache/camel/support/component/PropertyConfigurerSupport.java
@@ -17,6 +17,7 @@
 package org.apache.camel.support.component;
 
 import org.apache.camel.CamelContext;
+import org.apache.camel.NoSuchBeanException;
 
 /**
  * Base class used by the camel-apt compiler plugin when it generates source code for fast
@@ -43,6 +44,9 @@ public abstract class PropertyConfigurerSupport {
                 Object obj = camelContext.getRegistry().lookupByName(ref);
                 if (obj != null) {
                     value = obj;
+                } else {
+                    // no bean found so throw an exception
+                    throw new NoSuchBeanException(ref, type.getName());
                 }
             }
         }


[camel] 03/08: CAMEL-14263: camel-mina should use source code generated configurer to avoid reflection configuration.

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 ecbcfa997932dd6a9cb5b31d1ba9b5908bbdf007
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sat Dec 7 21:04:59 2019 +0100

    CAMEL-14263: camel-mina should use source code generated configurer to avoid reflection configuration.
---
 .../main/java/org/apache/camel/component/mina/MinaComponent.java    | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/components/camel-mina/src/main/java/org/apache/camel/component/mina/MinaComponent.java b/components/camel-mina/src/main/java/org/apache/camel/component/mina/MinaComponent.java
index 99b949f..9572156 100644
--- a/components/camel-mina/src/main/java/org/apache/camel/component/mina/MinaComponent.java
+++ b/components/camel-mina/src/main/java/org/apache/camel/component/mina/MinaComponent.java
@@ -67,13 +67,15 @@ public class MinaComponent extends DefaultComponent implements SSLContextParamet
         config.setPort(u.getPort());
         config.setProtocol(u.getScheme());
         config.setFilters(resolveAndRemoveReferenceListParameter(parameters, "filters", IoFilter.class));
-        setProperties(config, parameters);
+
+        Endpoint endpoint = createEndpoint(uri, config);
+        setProperties(endpoint, parameters);
 
         if (config.getSslContextParameters() == null) {
             config.setSslContextParameters(retrieveGlobalSslContextParameters());
         }
 
-        return createEndpoint(uri, config);
+        return endpoint;
     }
 
     public Endpoint createEndpoint(MinaConfiguration config) throws Exception {


[camel] 07/08: CAMEL-14263: camel-spark-rest should use source code generated configurer to avoid reflection configuration.

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 c4f93f29789686971e7f65abcb4d3a4728b6dae1
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sat Dec 7 21:35:08 2019 +0100

    CAMEL-14263: camel-spark-rest should use source code generated configurer to avoid reflection configuration.
---
 .../camel/component/sparkrest/SparkComponent.java  |   2 -
 .../endpoint/dsl/SparkEndpointBuilderFactory.java  | 347 +++++++++++++++------
 2 files changed, 243 insertions(+), 106 deletions(-)

diff --git a/components/camel-spark-rest/src/main/java/org/apache/camel/component/sparkrest/SparkComponent.java b/components/camel-spark-rest/src/main/java/org/apache/camel/component/sparkrest/SparkComponent.java
index 6446d1c..be537a4 100644
--- a/components/camel-spark-rest/src/main/java/org/apache/camel/component/sparkrest/SparkComponent.java
+++ b/components/camel-spark-rest/src/main/java/org/apache/camel/component/sparkrest/SparkComponent.java
@@ -204,8 +204,6 @@ public class SparkComponent extends DefaultComponent implements RestConsumerFact
     @Override
     protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
         SparkConfiguration config = getSparkConfiguration().copy();
-        //TODO: we need to remove the usage of setProperties for populating the copy of the configuration
-        setProperties(config, parameters);
 
         SparkEndpoint answer = new SparkEndpoint(uri, this);
         answer.setSparkConfiguration(config);
diff --git a/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/SparkEndpointBuilderFactory.java b/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/SparkEndpointBuilderFactory.java
index 1c0237d..c3eea0f 100644
--- a/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/SparkEndpointBuilderFactory.java
+++ b/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/SparkEndpointBuilderFactory.java
@@ -17,13 +17,15 @@
 package org.apache.camel.builder.endpoint.dsl;
 
 import javax.annotation.Generated;
+import org.apache.camel.ExchangePattern;
 import org.apache.camel.builder.EndpointConsumerBuilder;
 import org.apache.camel.builder.EndpointProducerBuilder;
 import org.apache.camel.builder.endpoint.AbstractEndpointBuilder;
+import org.apache.camel.spi.ExceptionHandler;
 
 /**
- * The spark component can be used to send RDD or DataFrame jobs to Apache Spark
- * cluster.
+ * The spark-rest component is used for hosting REST services which has been
+ * defined using Camel rest-dsl.
  * 
  * Generated by camel-package-maven-plugin - do not edit this file!
  */
@@ -32,179 +34,262 @@ public interface SparkEndpointBuilderFactory {
 
 
     /**
-     * Builder for endpoint for the Spark component.
+     * Builder for endpoint for the Spark Rest component.
      */
-    public interface SparkEndpointBuilder extends EndpointProducerBuilder {
+    public interface SparkEndpointBuilder extends EndpointConsumerBuilder {
         default AdvancedSparkEndpointBuilder advanced() {
             return (AdvancedSparkEndpointBuilder) this;
         }
         /**
-         * Indicates if results should be collected or counted.
+         * Accept type such as: 'text/xml', or 'application/json'. By default we
+         * accept all kinds of types.
+         * 
+         * The option is a: <code>java.lang.String</code> type.
+         * 
+         * Group: consumer
+         */
+        default SparkEndpointBuilder accept(String accept) {
+            doSetProperty("accept", accept);
+            return this;
+        }
+        /**
+         * Allows for bridging the consumer to the Camel routing Error Handler,
+         * which mean any exceptions occurred while the consumer is trying to
+         * pickup incoming messages, or the likes, will now be processed as a
+         * message and handled by the routing Error Handler. By default the
+         * consumer will use the org.apache.camel.spi.ExceptionHandler to deal
+         * with exceptions, that will be logged at WARN or ERROR level and
+         * ignored.
          * 
          * The option is a: <code>boolean</code> type.
          * 
-         * Group: producer
+         * Group: consumer
          */
-        default SparkEndpointBuilder collect(boolean collect) {
-            doSetProperty("collect", collect);
+        default SparkEndpointBuilder bridgeErrorHandler(
+                boolean bridgeErrorHandler) {
+            doSetProperty("bridgeErrorHandler", bridgeErrorHandler);
             return this;
         }
         /**
-         * Indicates if results should be collected or counted.
+         * Allows for bridging the consumer to the Camel routing Error Handler,
+         * which mean any exceptions occurred while the consumer is trying to
+         * pickup incoming messages, or the likes, will now be processed as a
+         * message and handled by the routing Error Handler. By default the
+         * consumer will use the org.apache.camel.spi.ExceptionHandler to deal
+         * with exceptions, that will be logged at WARN or ERROR level and
+         * ignored.
          * 
          * The option will be converted to a <code>boolean</code> type.
          * 
-         * Group: producer
+         * Group: consumer
          */
-        default SparkEndpointBuilder collect(String collect) {
-            doSetProperty("collect", collect);
+        default SparkEndpointBuilder bridgeErrorHandler(
+                String bridgeErrorHandler) {
+            doSetProperty("bridgeErrorHandler", bridgeErrorHandler);
             return this;
         }
         /**
-         * DataFrame to compute against.
+         * Determines whether or not the raw input stream from Spark
+         * HttpRequest#getContent() is cached or not (Camel will read the stream
+         * into a in light-weight memory based Stream caching) cache. By default
+         * Camel will cache the Netty input stream to support reading it
+         * multiple times to ensure Camel can retrieve all data from the stream.
+         * However you can set this option to true when you for example need to
+         * access the raw stream, such as streaming it directly to a file or
+         * other persistent store. Mind that if you enable this option, then you
+         * cannot read the Netty stream multiple times out of the box, and you
+         * would need manually to reset the reader index on the Spark raw
+         * stream.
          * 
-         * The option is a:
-         * <code>org.apache.spark.sql.Dataset&lt;org.apache.spark.sql.Row&gt;</code> type.
+         * The option is a: <code>boolean</code> type.
          * 
-         * Group: producer
+         * Group: consumer
          */
-        default SparkEndpointBuilder dataFrame(Object dataFrame) {
-            doSetProperty("dataFrame", dataFrame);
+        default SparkEndpointBuilder disableStreamCache(
+                boolean disableStreamCache) {
+            doSetProperty("disableStreamCache", disableStreamCache);
             return this;
         }
         /**
-         * DataFrame to compute against.
+         * Determines whether or not the raw input stream from Spark
+         * HttpRequest#getContent() is cached or not (Camel will read the stream
+         * into a in light-weight memory based Stream caching) cache. By default
+         * Camel will cache the Netty input stream to support reading it
+         * multiple times to ensure Camel can retrieve all data from the stream.
+         * However you can set this option to true when you for example need to
+         * access the raw stream, such as streaming it directly to a file or
+         * other persistent store. Mind that if you enable this option, then you
+         * cannot read the Netty stream multiple times out of the box, and you
+         * would need manually to reset the reader index on the Spark raw
+         * stream.
          * 
-         * The option will be converted to a
-         * <code>org.apache.spark.sql.Dataset&lt;org.apache.spark.sql.Row&gt;</code> type.
+         * The option will be converted to a <code>boolean</code> type.
          * 
-         * Group: producer
+         * Group: consumer
          */
-        default SparkEndpointBuilder dataFrame(String dataFrame) {
-            doSetProperty("dataFrame", dataFrame);
+        default SparkEndpointBuilder disableStreamCache(
+                String disableStreamCache) {
+            doSetProperty("disableStreamCache", disableStreamCache);
             return this;
         }
         /**
-         * Function performing action against an DataFrame.
+         * If this option is enabled, then during binding from Spark to Camel
+         * Message then the headers will be mapped as well (eg added as header
+         * to the Camel Message as well). You can turn off this option to
+         * disable this. The headers can still be accessed from the
+         * org.apache.camel.component.sparkrest.SparkMessage message with the
+         * method getRequest() that returns the Spark HTTP request instance.
          * 
-         * The option is a:
-         * <code>org.apache.camel.component.spark.DataFrameCallback</code> type.
+         * The option is a: <code>boolean</code> type.
          * 
-         * Group: producer
+         * Group: consumer
          */
-        default SparkEndpointBuilder dataFrameCallback(Object dataFrameCallback) {
-            doSetProperty("dataFrameCallback", dataFrameCallback);
+        default SparkEndpointBuilder mapHeaders(boolean mapHeaders) {
+            doSetProperty("mapHeaders", mapHeaders);
             return this;
         }
         /**
-         * Function performing action against an DataFrame.
+         * If this option is enabled, then during binding from Spark to Camel
+         * Message then the headers will be mapped as well (eg added as header
+         * to the Camel Message as well). You can turn off this option to
+         * disable this. The headers can still be accessed from the
+         * org.apache.camel.component.sparkrest.SparkMessage message with the
+         * method getRequest() that returns the Spark HTTP request instance.
          * 
-         * The option will be converted to a
-         * <code>org.apache.camel.component.spark.DataFrameCallback</code> type.
+         * The option will be converted to a <code>boolean</code> type.
+         * 
+         * Group: consumer
+         */
+        default SparkEndpointBuilder mapHeaders(String mapHeaders) {
+            doSetProperty("mapHeaders", mapHeaders);
+            return this;
+        }
+        /**
+         * If enabled and an Exchange failed processing on the consumer side,
+         * and if the caused Exception was send back serialized in the response
+         * as a application/x-java-serialized-object content type. This is by
+         * default turned off. If you enable this then be aware that Java will
+         * deserialize the incoming data from the request to Java and that can
+         * be a potential security risk.
+         * 
+         * The option is a: <code>boolean</code> type.
+         * 
+         * Group: consumer
+         */
+        default SparkEndpointBuilder transferException(boolean transferException) {
+            doSetProperty("transferException", transferException);
+            return this;
+        }
+        /**
+         * If enabled and an Exchange failed processing on the consumer side,
+         * and if the caused Exception was send back serialized in the response
+         * as a application/x-java-serialized-object content type. This is by
+         * default turned off. If you enable this then be aware that Java will
+         * deserialize the incoming data from the request to Java and that can
+         * be a potential security risk.
+         * 
+         * The option will be converted to a <code>boolean</code> type.
          * 
-         * Group: producer
+         * Group: consumer
          */
-        default SparkEndpointBuilder dataFrameCallback(String dataFrameCallback) {
-            doSetProperty("dataFrameCallback", dataFrameCallback);
+        default SparkEndpointBuilder transferException(String transferException) {
+            doSetProperty("transferException", transferException);
             return this;
         }
         /**
-         * Whether the producer should be started lazy (on the first message).
-         * By starting lazy you can use this to allow CamelContext and routes to
-         * startup in situations where a producer may otherwise fail during
-         * starting and cause the route to fail being started. By deferring this
-         * startup to be lazy then the startup failure can be handled during
-         * routing messages via Camel's routing error handlers. Beware that when
-         * the first message is processed then creating and starting the
-         * producer may take a little time and prolong the total processing time
-         * of the processing.
+         * If this option is enabled, then during binding from Spark to Camel
+         * Message then the header values will be URL decoded (eg %20 will be a
+         * space character.).
          * 
          * The option is a: <code>boolean</code> type.
          * 
-         * Group: producer
+         * Group: consumer
          */
-        default SparkEndpointBuilder lazyStartProducer(boolean lazyStartProducer) {
-            doSetProperty("lazyStartProducer", lazyStartProducer);
+        default SparkEndpointBuilder urlDecodeHeaders(boolean urlDecodeHeaders) {
+            doSetProperty("urlDecodeHeaders", urlDecodeHeaders);
             return this;
         }
         /**
-         * Whether the producer should be started lazy (on the first message).
-         * By starting lazy you can use this to allow CamelContext and routes to
-         * startup in situations where a producer may otherwise fail during
-         * starting and cause the route to fail being started. By deferring this
-         * startup to be lazy then the startup failure can be handled during
-         * routing messages via Camel's routing error handlers. Beware that when
-         * the first message is processed then creating and starting the
-         * producer may take a little time and prolong the total processing time
-         * of the processing.
+         * If this option is enabled, then during binding from Spark to Camel
+         * Message then the header values will be URL decoded (eg %20 will be a
+         * space character.).
          * 
          * The option will be converted to a <code>boolean</code> type.
          * 
-         * Group: producer
+         * Group: consumer
          */
-        default SparkEndpointBuilder lazyStartProducer(String lazyStartProducer) {
-            doSetProperty("lazyStartProducer", lazyStartProducer);
+        default SparkEndpointBuilder urlDecodeHeaders(String urlDecodeHeaders) {
+            doSetProperty("urlDecodeHeaders", urlDecodeHeaders);
             return this;
         }
+    }
+
+    /**
+     * Advanced builder for endpoint for the Spark Rest component.
+     */
+    public interface AdvancedSparkEndpointBuilder
+            extends
+                EndpointConsumerBuilder {
+        default SparkEndpointBuilder basic() {
+            return (SparkEndpointBuilder) this;
+        }
         /**
-         * RDD to compute against.
+         * To let the consumer use a custom ExceptionHandler. Notice if the
+         * option bridgeErrorHandler is enabled then this option is not in use.
+         * By default the consumer will deal with exceptions, that will be
+         * logged at WARN or ERROR level and ignored.
          * 
-         * The option is a: <code>org.apache.spark.api.java.JavaRDDLike</code>
+         * The option is a: <code>org.apache.camel.spi.ExceptionHandler</code>
          * type.
          * 
-         * Group: producer
+         * Group: consumer (advanced)
          */
-        default SparkEndpointBuilder rdd(Object rdd) {
-            doSetProperty("rdd", rdd);
+        default AdvancedSparkEndpointBuilder exceptionHandler(
+                ExceptionHandler exceptionHandler) {
+            doSetProperty("exceptionHandler", exceptionHandler);
             return this;
         }
         /**
-         * RDD to compute against.
+         * To let the consumer use a custom ExceptionHandler. Notice if the
+         * option bridgeErrorHandler is enabled then this option is not in use.
+         * By default the consumer will deal with exceptions, that will be
+         * logged at WARN or ERROR level and ignored.
          * 
          * The option will be converted to a
-         * <code>org.apache.spark.api.java.JavaRDDLike</code> type.
+         * <code>org.apache.camel.spi.ExceptionHandler</code> type.
          * 
-         * Group: producer
+         * Group: consumer (advanced)
          */
-        default SparkEndpointBuilder rdd(String rdd) {
-            doSetProperty("rdd", rdd);
+        default AdvancedSparkEndpointBuilder exceptionHandler(
+                String exceptionHandler) {
+            doSetProperty("exceptionHandler", exceptionHandler);
             return this;
         }
         /**
-         * Function performing action against an RDD.
+         * Sets the exchange pattern when the consumer creates an exchange.
          * 
-         * The option is a:
-         * <code>org.apache.camel.component.spark.RddCallback</code> type.
+         * The option is a: <code>org.apache.camel.ExchangePattern</code> type.
          * 
-         * Group: producer
+         * Group: consumer (advanced)
          */
-        default SparkEndpointBuilder rddCallback(Object rddCallback) {
-            doSetProperty("rddCallback", rddCallback);
+        default AdvancedSparkEndpointBuilder exchangePattern(
+                ExchangePattern exchangePattern) {
+            doSetProperty("exchangePattern", exchangePattern);
             return this;
         }
         /**
-         * Function performing action against an RDD.
+         * Sets the exchange pattern when the consumer creates an exchange.
          * 
          * The option will be converted to a
-         * <code>org.apache.camel.component.spark.RddCallback</code> type.
+         * <code>org.apache.camel.ExchangePattern</code> type.
          * 
-         * Group: producer
+         * Group: consumer (advanced)
          */
-        default SparkEndpointBuilder rddCallback(String rddCallback) {
-            doSetProperty("rddCallback", rddCallback);
+        default AdvancedSparkEndpointBuilder exchangePattern(
+                String exchangePattern) {
+            doSetProperty("exchangePattern", exchangePattern);
             return this;
         }
-    }
-
-    /**
-     * Advanced builder for endpoint for the Spark component.
-     */
-    public interface AdvancedSparkEndpointBuilder
-            extends
-                EndpointProducerBuilder {
-        default SparkEndpointBuilder basic() {
-            return (SparkEndpointBuilder) this;
-        }
         /**
          * Whether the endpoint should use basic property binding (Camel 2.x) or
          * the newer property binding with additional capabilities.
@@ -232,6 +317,56 @@ public interface SparkEndpointBuilderFactory {
             return this;
         }
         /**
+         * Whether or not the consumer should try to find a target consumer by
+         * matching the URI prefix if no exact match is found.
+         * 
+         * The option is a: <code>boolean</code> type.
+         * 
+         * Group: advanced
+         */
+        default AdvancedSparkEndpointBuilder matchOnUriPrefix(
+                boolean matchOnUriPrefix) {
+            doSetProperty("matchOnUriPrefix", matchOnUriPrefix);
+            return this;
+        }
+        /**
+         * Whether or not the consumer should try to find a target consumer by
+         * matching the URI prefix if no exact match is found.
+         * 
+         * The option will be converted to a <code>boolean</code> type.
+         * 
+         * Group: advanced
+         */
+        default AdvancedSparkEndpointBuilder matchOnUriPrefix(
+                String matchOnUriPrefix) {
+            doSetProperty("matchOnUriPrefix", matchOnUriPrefix);
+            return this;
+        }
+        /**
+         * To use a custom SparkBinding to map to/from Camel message.
+         * 
+         * The option is a:
+         * <code>org.apache.camel.component.sparkrest.SparkBinding</code> type.
+         * 
+         * Group: advanced
+         */
+        default AdvancedSparkEndpointBuilder sparkBinding(Object sparkBinding) {
+            doSetProperty("sparkBinding", sparkBinding);
+            return this;
+        }
+        /**
+         * To use a custom SparkBinding to map to/from Camel message.
+         * 
+         * The option will be converted to a
+         * <code>org.apache.camel.component.sparkrest.SparkBinding</code> type.
+         * 
+         * Group: advanced
+         */
+        default AdvancedSparkEndpointBuilder sparkBinding(String sparkBinding) {
+            doSetProperty("sparkBinding", sparkBinding);
+            return this;
+        }
+        /**
          * Sets whether synchronous processing should be strictly used, or Camel
          * is allowed to use asynchronous processing (if supported).
          * 
@@ -257,24 +392,28 @@ public interface SparkEndpointBuilderFactory {
         }
     }
     /**
-     * Spark (camel-spark)
-     * The spark component can be used to send RDD or DataFrame jobs to Apache
-     * Spark cluster.
+     * Spark Rest (camel-spark-rest)
+     * The spark-rest component is used for hosting REST services which has been
+     * defined using Camel rest-dsl.
+     * 
+     * Category: rest
+     * Since: 2.14
+     * Maven coordinates: org.apache.camel:camel-spark-rest
      * 
-     * Category: bigdata,iot
-     * Since: 2.17
-     * Maven coordinates: org.apache.camel:camel-spark
+     * Syntax: <code>spark-rest:verb:path</code>
      * 
-     * Syntax: <code>spark:endpointType</code>
+     * Path parameter: verb (required)
+     * get, post, put, patch, delete, head, trace, connect, or options.
+     * The value can be one of: get, post, put, patch, delete, head, trace,
+     * connect, options
      * 
-     * Path parameter: endpointType (required)
-     * Type of the endpoint (rdd, dataframe, hive).
-     * The value can be one of: rdd, dataframe, hive
+     * Path parameter: path (required)
+     * The content path which support Spark syntax.
      */
-    default SparkEndpointBuilder spark(String path) {
+    default SparkEndpointBuilder sparkRest(String path) {
         class SparkEndpointBuilderImpl extends AbstractEndpointBuilder implements SparkEndpointBuilder, AdvancedSparkEndpointBuilder {
             public SparkEndpointBuilderImpl(String path) {
-                super("spark", path);
+                super("spark-rest", path);
             }
         }
         return new SparkEndpointBuilderImpl(path);


[camel] 04/08: CAMEL-14263: camel-nagios should use source code generated configurer to avoid reflection configuration.

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 b86fd0dfdae5857a5920e66724f2f70e47c4d650
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sat Dec 7 21:20:45 2019 +0100

    CAMEL-14263: camel-nagios should use source code generated configurer to avoid reflection configuration.
---
 .../src/main/docs/nagios-component.adoc            |  3 +-
 .../camel/component/nagios/NagiosComponent.java    |  1 -
 .../component/nagios/NagiosConfiguration.java      | 22 ----------
 .../component/nagios/NagiosEncryptionMethod.java   | 28 ------------
 .../camel/component/nagios/NagiosEndpoint.java     | 18 +++++---
 .../component/nagios/NagiosAsyncSendTest.java      | 51 ----------------------
 .../apache/camel/component/nagios/NagiosTest.java  | 14 ++----
 .../component/nagios/NagiosXorEncryptionTest.java  | 13 ++----
 .../endpoint/dsl/NagiosEndpointBuilderFactory.java | 40 -----------------
 .../springboot/NagiosComponentConfiguration.java   | 18 --------
 10 files changed, 19 insertions(+), 189 deletions(-)

diff --git a/components/camel-nagios/src/main/docs/nagios-component.adoc b/components/camel-nagios/src/main/docs/nagios-component.adoc
index 3b4d84f..89bc709 100644
--- a/components/camel-nagios/src/main/docs/nagios-component.adoc
+++ b/components/camel-nagios/src/main/docs/nagios-component.adoc
@@ -83,7 +83,7 @@ with the following path and query parameters:
 |===
 
 
-=== Query Parameters (9 parameters):
+=== Query Parameters (8 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
@@ -96,7 +96,6 @@ with the following path and query parameters:
 | *basicPropertyBinding* (advanced) | Whether the endpoint should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | boolean
 | *synchronous* (advanced) | Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported). | false | boolean
 | *encryption* (security) | To specify an encryption method. |  | Encryption
-| *encryptionMethod* (security) | *Deprecated* To specify an encryption method. |  | NagiosEncryptionMethod
 | *password* (security) | Password to be authenticated when sending checks to Nagios. |  | String
 |===
 // endpoint options: END
diff --git a/components/camel-nagios/src/main/java/org/apache/camel/component/nagios/NagiosComponent.java b/components/camel-nagios/src/main/java/org/apache/camel/component/nagios/NagiosComponent.java
index ea31810..925e736 100644
--- a/components/camel-nagios/src/main/java/org/apache/camel/component/nagios/NagiosComponent.java
+++ b/components/camel-nagios/src/main/java/org/apache/camel/component/nagios/NagiosComponent.java
@@ -43,7 +43,6 @@ public class NagiosComponent extends DefaultComponent {
         ObjectHelper.notNull(configuration, "configuration");
         NagiosConfiguration config = configuration.copy();
         config.configure(url);
-        setProperties(config, parameters);
 
         NagiosEndpoint endpoint = new NagiosEndpoint(uri, this);
         endpoint.setConfiguration(config);
diff --git a/components/camel-nagios/src/main/java/org/apache/camel/component/nagios/NagiosConfiguration.java b/components/camel-nagios/src/main/java/org/apache/camel/component/nagios/NagiosConfiguration.java
index 0379619..5277eb1 100644
--- a/components/camel-nagios/src/main/java/org/apache/camel/component/nagios/NagiosConfiguration.java
+++ b/components/camel-nagios/src/main/java/org/apache/camel/component/nagios/NagiosConfiguration.java
@@ -42,9 +42,6 @@ public class NagiosConfiguration implements Cloneable {
     private int timeout = 5000;
     @UriParam(label = "security", secret = true)
     private String password;
-    @Deprecated
-    @UriParam(label = "security")
-    private NagiosEncryptionMethod encryptionMethod;
     @UriParam(label = "security")
     private Encryption encryption = Encryption.NONE;
 
@@ -152,19 +149,6 @@ public class NagiosConfiguration implements Cloneable {
         this.password = password;
     }
 
-    public NagiosEncryptionMethod getEncryptionMethod() {
-        return encryptionMethod;
-    }
-
-    /**
-     * To specify an encryption method.
-     * @deprecated use the {@link #encryption} query parameter instead.
-     */
-    @Deprecated
-    public void setEncryptionMethod(NagiosEncryptionMethod encryptionMethod) {
-        this.encryptionMethod = encryptionMethod;
-    }
-
     public Encryption getEncryption() {
         return encryption;
     }
@@ -176,10 +160,4 @@ public class NagiosConfiguration implements Cloneable {
         this.encryption = encryption;
     }
 
-    @Override
-    public String toString() {
-        return "NagiosConfiguration[host=" + host + ":" + port + ", connectionTimeout=" + connectionTimeout
-                + ", timeout=" + timeout + ", encryptionMethod=" + encryptionMethod + ", encryption=" + encryption + "]";
-    }
-
 }
diff --git a/components/camel-nagios/src/main/java/org/apache/camel/component/nagios/NagiosEncryptionMethod.java b/components/camel-nagios/src/main/java/org/apache/camel/component/nagios/NagiosEncryptionMethod.java
deleted file mode 100644
index 3cebeb2..0000000
--- a/components/camel-nagios/src/main/java/org/apache/camel/component/nagios/NagiosEncryptionMethod.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.nagios;
-
-/**
- * Encryption methods supported by nagios.
- * @deprecated use {@link com.googlecode.jsendnsca.encryption.Encryption} instead.
- */
-@Deprecated
-public enum NagiosEncryptionMethod {
-
-    No, Xor, TripleDes
-
-}
diff --git a/components/camel-nagios/src/main/java/org/apache/camel/component/nagios/NagiosEndpoint.java b/components/camel-nagios/src/main/java/org/apache/camel/component/nagios/NagiosEndpoint.java
index 3988a74..62e4fd2 100644
--- a/components/camel-nagios/src/main/java/org/apache/camel/component/nagios/NagiosEndpoint.java
+++ b/components/camel-nagios/src/main/java/org/apache/camel/component/nagios/NagiosEndpoint.java
@@ -78,7 +78,18 @@ public class NagiosEndpoint extends DefaultEndpoint {
         this.sendSync = sendSync;
     }
 
-    public synchronized PassiveCheckSender getSender() {
+    public PassiveCheckSender getSender() {
+        return sender;
+    }
+
+    public void setSender(PassiveCheckSender sender) {
+        this.sender = sender;
+    }
+
+    @Override
+    protected void doInit() throws Exception {
+        super.doInit();
+
         if (sender == null) {
             if (isSendSync()) {
                 sender = new NagiosPassiveCheckSender(getConfiguration().getNagiosSettings());
@@ -87,10 +98,5 @@ public class NagiosEndpoint extends DefaultEndpoint {
                 sender = new NonBlockingNagiosPassiveCheckSender(getConfiguration().getNagiosSettings());
             }
         }
-        return sender;
-    }
-
-    public void setSender(PassiveCheckSender sender) {
-        this.sender = sender;
     }
 }
diff --git a/components/camel-nagios/src/test/java/org/apache/camel/component/nagios/NagiosAsyncSendTest.java b/components/camel-nagios/src/test/java/org/apache/camel/component/nagios/NagiosAsyncSendTest.java
deleted file mode 100644
index 94cc948..0000000
--- a/components/camel-nagios/src/test/java/org/apache/camel/component/nagios/NagiosAsyncSendTest.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.nagios;
-
-import com.googlecode.jsendnsca.NonBlockingNagiosPassiveCheckSender;
-import org.apache.camel.builder.RouteBuilder;
-import org.junit.BeforeClass;
-import org.mockito.Mockito;
-
-public class NagiosAsyncSendTest extends NagiosTest {
-
-    @BeforeClass
-    public static void setSender() {
-        nagiosPassiveCheckSender =  Mockito.mock(NonBlockingNagiosPassiveCheckSender.class);
-    }
-
-    @Override
-    protected RouteBuilder createRouteBuilder() throws Exception {
-        return new RouteBuilder() {
-            @Override
-            public void configure() throws Exception {
-                String uri = "nagios:127.0.0.1:25664?password=secret&sendSync=false";
-
-                NagiosComponent nagiosComponent = new NagiosComponent();
-                nagiosComponent.setCamelContext(context);
-                NagiosEndpoint nagiosEndpoint = (NagiosEndpoint) nagiosComponent.createEndpoint(uri);
-                nagiosEndpoint.setSender(nagiosPassiveCheckSender);
-                nagiosEndpoint.createProducer();
-
-                from("direct:start")
-                        .to(nagiosEndpoint)
-                        .to("mock:result");
-            }
-        };
-    }
-
-}
diff --git a/components/camel-nagios/src/test/java/org/apache/camel/component/nagios/NagiosTest.java b/components/camel-nagios/src/test/java/org/apache/camel/component/nagios/NagiosTest.java
index 749b486..c7302bd 100644
--- a/components/camel-nagios/src/test/java/org/apache/camel/component/nagios/NagiosTest.java
+++ b/components/camel-nagios/src/test/java/org/apache/camel/component/nagios/NagiosTest.java
@@ -23,6 +23,7 @@ import com.googlecode.jsendnsca.Level;
 import com.googlecode.jsendnsca.MessagePayload;
 import com.googlecode.jsendnsca.NagiosPassiveCheckSender;
 import com.googlecode.jsendnsca.PassiveCheckSender;
+import org.apache.camel.BindToRegistry;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.test.junit4.CamelTestSupport;
@@ -36,7 +37,7 @@ import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 
 public class NagiosTest extends CamelTestSupport {
-    @Mock
+    @Mock @BindToRegistry("mySender")
     protected static PassiveCheckSender nagiosPassiveCheckSender;
 
     protected boolean canRun;
@@ -53,7 +54,6 @@ public class NagiosTest extends CamelTestSupport {
         super.setUp();
     }
 
-
     @Test
     public void testSendToNagios() throws Exception {
         if (!canRun) {
@@ -159,16 +159,8 @@ public class NagiosTest extends CamelTestSupport {
         return new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                String uri = "nagios:127.0.0.1:25664?password=secret";
-
-                NagiosComponent nagiosComponent = new NagiosComponent();
-                nagiosComponent.setCamelContext(context);
-                NagiosEndpoint nagiosEndpoint = (NagiosEndpoint) nagiosComponent.createEndpoint(uri);
-                nagiosEndpoint.setSender(nagiosPassiveCheckSender);
-                nagiosEndpoint.createProducer();
-
                 from("direct:start")
-                        .to(nagiosEndpoint)
+                        .to("nagios:127.0.0.1:25664?password=secret&sender=#mySender")
                         .to("mock:result");
             }
         };
diff --git a/components/camel-nagios/src/test/java/org/apache/camel/component/nagios/NagiosXorEncryptionTest.java b/components/camel-nagios/src/test/java/org/apache/camel/component/nagios/NagiosXorEncryptionTest.java
index eb354d3..114549d 100644
--- a/components/camel-nagios/src/test/java/org/apache/camel/component/nagios/NagiosXorEncryptionTest.java
+++ b/components/camel-nagios/src/test/java/org/apache/camel/component/nagios/NagiosXorEncryptionTest.java
@@ -20,6 +20,7 @@ import com.googlecode.jsendnsca.Level;
 import com.googlecode.jsendnsca.MessagePayload;
 import com.googlecode.jsendnsca.NagiosPassiveCheckSender;
 import com.googlecode.jsendnsca.PassiveCheckSender;
+import org.apache.camel.BindToRegistry;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.test.junit4.CamelTestSupport;
@@ -34,7 +35,7 @@ import static org.mockito.Mockito.verify;
 public class NagiosXorEncryptionTest extends CamelTestSupport {
     protected boolean canRun;
 
-    @Mock
+    @Mock @BindToRegistry("mySender")
     private PassiveCheckSender nagiosPassiveCheckSender = Mockito.mock(NagiosPassiveCheckSender.class);
 
     @Before
@@ -67,16 +68,8 @@ public class NagiosXorEncryptionTest extends CamelTestSupport {
         return new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                String uri = "nagios:127.0.0.1:25664?password=secret&encryption=Xor";
-
-                NagiosComponent nagiosComponent = new NagiosComponent();
-                nagiosComponent.setCamelContext(context);
-                NagiosEndpoint nagiosEndpoint = (NagiosEndpoint) nagiosComponent.createEndpoint(uri);
-                nagiosEndpoint.setSender(nagiosPassiveCheckSender);
-                nagiosEndpoint.createProducer();
-
                 from("direct:start")
-                        .to(nagiosEndpoint)
+                        .to("nagios:127.0.0.1:25664?password=secret&encryption=Xor&sender=#mySender")
                         .to("mock:result");
             }
         };
diff --git a/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/NagiosEndpointBuilderFactory.java b/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/NagiosEndpointBuilderFactory.java
index 3ff61d4..3122591 100644
--- a/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/NagiosEndpointBuilderFactory.java
+++ b/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/NagiosEndpointBuilderFactory.java
@@ -171,35 +171,6 @@ public interface NagiosEndpointBuilderFactory {
             return this;
         }
         /**
-         * To specify an encryption method.
-         * 
-         * The option is a:
-         * <code>org.apache.camel.component.nagios.NagiosEncryptionMethod</code>
-         * type.
-         * 
-         * Group: security
-         */
-        @Deprecated
-        default NagiosEndpointBuilder encryptionMethod(
-                NagiosEncryptionMethod encryptionMethod) {
-            doSetProperty("encryptionMethod", encryptionMethod);
-            return this;
-        }
-        /**
-         * To specify an encryption method.
-         * 
-         * The option will be converted to a
-         * <code>org.apache.camel.component.nagios.NagiosEncryptionMethod</code>
-         * type.
-         * 
-         * Group: security
-         */
-        @Deprecated
-        default NagiosEndpointBuilder encryptionMethod(String encryptionMethod) {
-            doSetProperty("encryptionMethod", encryptionMethod);
-            return this;
-        }
-        /**
          * Password to be authenticated when sending checks to Nagios.
          * 
          * The option is a: <code>java.lang.String</code> type.
@@ -286,17 +257,6 @@ public interface NagiosEndpointBuilderFactory {
         RIJNDAEL256,
         BLOWFISH;
     }
-
-    /**
-     * Proxy enum for
-     * <code>org.apache.camel.component.nagios.NagiosEncryptionMethod</code>
-     * enum.
-     */
-    enum NagiosEncryptionMethod {
-        No,
-        Xor,
-        TripleDes;
-    }
     /**
      * Nagios (camel-nagios)
      * To send passive checks to Nagios using JSendNSCA.
diff --git a/platforms/spring-boot/components-starter/camel-nagios-starter/src/main/java/org/apache/camel/component/nagios/springboot/NagiosComponentConfiguration.java b/platforms/spring-boot/components-starter/camel-nagios-starter/src/main/java/org/apache/camel/component/nagios/springboot/NagiosComponentConfiguration.java
index 23489a6..333ec7a 100644
--- a/platforms/spring-boot/components-starter/camel-nagios-starter/src/main/java/org/apache/camel/component/nagios/springboot/NagiosComponentConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-nagios-starter/src/main/java/org/apache/camel/component/nagios/springboot/NagiosComponentConfiguration.java
@@ -19,10 +19,8 @@ package org.apache.camel.component.nagios.springboot;
 import javax.annotation.Generated;
 import com.googlecode.jsendnsca.NagiosSettings;
 import com.googlecode.jsendnsca.encryption.Encryption;
-import org.apache.camel.component.nagios.NagiosEncryptionMethod;
 import org.apache.camel.spring.boot.ComponentConfigurationPropertiesCommon;
 import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.boot.context.properties.DeprecatedConfigurationProperty;
 
 /**
  * To send passive checks to Nagios using JSendNSCA.
@@ -132,11 +130,6 @@ public class NagiosComponentConfiguration
         /**
          * To specify an encryption method.
          */
-        @Deprecated
-        private NagiosEncryptionMethod encryptionMethod;
-        /**
-         * To specify an encryption method.
-         */
         private Encryption encryption;
 
         public NagiosSettings getNagiosSettings() {
@@ -187,17 +180,6 @@ public class NagiosComponentConfiguration
             this.password = password;
         }
 
-        @Deprecated
-        @DeprecatedConfigurationProperty
-        public NagiosEncryptionMethod getEncryptionMethod() {
-            return encryptionMethod;
-        }
-
-        @Deprecated
-        public void setEncryptionMethod(NagiosEncryptionMethod encryptionMethod) {
-            this.encryptionMethod = encryptionMethod;
-        }
-
         public Encryption getEncryption() {
             return encryption;
         }


[camel] 02/08: Polished

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 ac43bbef9ad8948c290a8c5870452e850de0dc16
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sat Dec 7 21:04:44 2019 +0100

    Polished
---
 core/camel-management/pom.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/core/camel-management/pom.xml b/core/camel-management/pom.xml
index 93b3b6a..4102834 100644
--- a/core/camel-management/pom.xml
+++ b/core/camel-management/pom.xml
@@ -30,8 +30,8 @@
     <artifactId>camel-management</artifactId>
     <packaging>jar</packaging>
 
-    <name>Camel :: Management Implementation</name>
-    <description>The Camel Management Implementation</description>
+    <name>Camel :: Management</name>
+    <description>Camel Management</description>
 
     <dependencies>
 


[camel] 06/08: CAMEL-14263: camel-smpp should use source code generated configurer to avoid reflection configuration.

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 42202212c922b9ea87f629f28ff7a3f425bb74ee
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sat Dec 7 21:33:05 2019 +0100

    CAMEL-14263: camel-smpp should use source code generated configurer to avoid reflection configuration.
---
 .../apache/camel/component/smpp/SmppComponent.java |  2 --
 .../camel/component/smpp/SmppComponentTest.java    | 25 ++++++----------------
 2 files changed, 7 insertions(+), 20 deletions(-)

diff --git a/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppComponent.java b/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppComponent.java
index 5959216..f7f17fc 100644
--- a/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppComponent.java
+++ b/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppComponent.java
@@ -52,9 +52,7 @@ public class SmppComponent extends DefaultComponent {
 
         // create a copy of the configuration as other endpoints can adjust their copy as well
         SmppConfiguration config = this.configuration.copy();
-
         config.configureFromURI(new URI(uri));
-        setProperties(config, parameters);
 
         SmppEndpoint answer = new SmppEndpoint(uri, this, config);
         setProperties(answer, parameters);
diff --git a/components/camel-smpp/src/test/java/org/apache/camel/component/smpp/SmppComponentTest.java b/components/camel-smpp/src/test/java/org/apache/camel/component/smpp/SmppComponentTest.java
index fba696d..f246754 100644
--- a/components/camel-smpp/src/test/java/org/apache/camel/component/smpp/SmppComponentTest.java
+++ b/components/camel-smpp/src/test/java/org/apache/camel/component/smpp/SmppComponentTest.java
@@ -46,7 +46,9 @@ public class SmppComponentTest {
     @Before
     public void setUp() {
         context = new DefaultCamelContext();
+        context.start();
         component = new SmppComponent(context);
+        component.start();
     }
 
     @Test
@@ -68,12 +70,15 @@ public class SmppComponentTest {
     @Test
     public void createEndpointStringStringMapShouldReturnASmppEndpoint() throws Exception {
         CamelContext context = new DefaultCamelContext();
+        context.start();
         component = new SmppComponent(context);
+        component.start();
+
         Map<String, String> parameters = new HashMap<>();
         parameters.put("password", "secret");
         Endpoint endpoint = component.createEndpoint("smpp://smppclient@localhost:2775", "?password=secret", parameters);
         SmppEndpoint smppEndpoint = (SmppEndpoint) endpoint;
-        
+
         assertEquals("smpp://smppclient@localhost:2775", smppEndpoint.getEndpointUri());
         assertEquals("smpp://smppclient@localhost:2775", smppEndpoint.getEndpointKey());
         assertSame(component, smppEndpoint.getComponent());
@@ -87,8 +92,6 @@ public class SmppComponentTest {
 
     @Test
     public void createEndpointStringStringMapShouldReturnASmppsEndpoint() throws Exception {
-        CamelContext context = new DefaultCamelContext();
-        component = new SmppComponent(context);
         Map<String, String> parameters = new HashMap<>();
         parameters.put("password", "secret");
         Endpoint endpoint = component.createEndpoint("smpps://smppclient@localhost:2775", "?password=secret", parameters);
@@ -174,19 +177,5 @@ public class SmppComponentTest {
         
         assertSame(configuration, component.getConfiguration());
     }
-    
-    @Test
-    public void createEndpointWithSessionStateListener() throws Exception {
-        SimpleRegistry registry = new SimpleRegistry();
-        registry.bind("sessionStateListener", new SessionStateListener() {
-            @Override
-            public void onStateChange(SessionState arg0, SessionState arg1, Session arg2) {
-            }
-        });
-        context.setRegistry(registry);
-        component = new SmppComponent(context);
-        SmppEndpoint endpoint = (SmppEndpoint) component.createEndpoint("smpp://smppclient@localhost:2775?password=password&sessionStateListener=#sessionStateListener");
-        
-        assertNotNull(endpoint.getConfiguration().getSessionStateListener());
-    }
+
 }


[camel] 05/08: CAMEL-14263: camel-crypto should use source code generated configurer to avoid reflection configuration.

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 577570105381a110982ed1715abb620556329e2e
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sat Dec 7 21:27:00 2019 +0100

    CAMEL-14263: camel-crypto should use source code generated configurer to avoid reflection configuration.
---
 .../camel/component/crypto/DigitalSignatureComponent.java      | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/components/camel-crypto/src/main/java/org/apache/camel/component/crypto/DigitalSignatureComponent.java b/components/camel-crypto/src/main/java/org/apache/camel/component/crypto/DigitalSignatureComponent.java
index d7d3f71..b6d7d35 100644
--- a/components/camel-crypto/src/main/java/org/apache/camel/component/crypto/DigitalSignatureComponent.java
+++ b/components/camel-crypto/src/main/java/org/apache/camel/component/crypto/DigitalSignatureComponent.java
@@ -31,7 +31,7 @@ import org.apache.camel.util.ObjectHelper;
 public class DigitalSignatureComponent extends DefaultComponent {
 
     @Metadata(label = "advanced")
-    private DigitalSignatureConfiguration configuration;
+    private DigitalSignatureConfiguration configuration = new DigitalSignatureConfiguration();
 
     public DigitalSignatureComponent() {
     }
@@ -46,7 +46,6 @@ public class DigitalSignatureComponent extends DefaultComponent {
 
         DigitalSignatureConfiguration config = getConfiguration().copy();
 
-        setProperties(config, parameters);
         config.setCamelContext(getCamelContext());
         try {
             config.setCryptoOperation(new URI(remaining).getScheme());
@@ -54,13 +53,12 @@ public class DigitalSignatureComponent extends DefaultComponent {
             throw new MalformedURLException(String.format("An invalid crypto uri was provided '%s'."
                     + " Check the uri matches the format crypto:sign or crypto:verify", uri));
         }
-        return new DigitalSignatureEndpoint(uri, this, config);
+        Endpoint endpoint = new DigitalSignatureEndpoint(uri, this, config);
+        setProperties(endpoint, parameters);
+        return endpoint;
     }
 
     public DigitalSignatureConfiguration getConfiguration() {
-        if (configuration == null) {
-            configuration = new DigitalSignatureConfiguration();
-        }
         return configuration;
     }
 


[camel] 08/08: CAMEL-14263: camel-zookeeper should use source code generated configurer to avoid reflection configuration.

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 ce7e7fbcd1d4bdf518d4b4634bda426413c8c174
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sat Dec 7 21:53:44 2019 +0100

    CAMEL-14263: camel-zookeeper should use source code generated configurer to avoid reflection configuration.
---
 .../apache/camel/component/zookeeper/ZooKeeperComponent.java   | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperComponent.java b/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperComponent.java
index 04f37ed..2483993 100644
--- a/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperComponent.java
+++ b/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperComponent.java
@@ -33,7 +33,7 @@ import org.apache.camel.support.DefaultComponent;
 public class ZooKeeperComponent extends DefaultComponent {
 
     @Metadata(label = "advanced")
-    private ZooKeeperConfiguration configuration;
+    private ZooKeeperConfiguration configuration = new ZooKeeperConfiguration();
 
     public ZooKeeperComponent() {
     }
@@ -50,9 +50,10 @@ public class ZooKeeperComponent extends DefaultComponent {
 
         ZooKeeperConfiguration config = getConfiguration().copy();
         extractConfigFromUri(uri, config);
-        setProperties(config, parameters);
 
-        return new ZooKeeperEndpoint(uri, this, config);
+        Endpoint endpoint = new ZooKeeperEndpoint(uri, this, config);
+        setProperties(endpoint, parameters);
+        return endpoint;
     }
 
     private void extractConfigFromUri(String remaining, ZooKeeperConfiguration config) throws URISyntaxException {
@@ -65,9 +66,6 @@ public class ZooKeeperComponent extends DefaultComponent {
     }
 
     public ZooKeeperConfiguration getConfiguration() {
-        if (configuration == null) {
-            configuration = new ZooKeeperConfiguration();
-        }
         return configuration;
     }