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/03/18 17:01:00 UTC

[camel] branch master updated: Fixed apt compiler plugin to not include inherited endpoint properties.

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


The following commit(s) were added to refs/heads/master by this push:
     new 021dc1a  Fixed apt compiler plugin to not include inherited endpoint properties.
021dc1a is described below

commit 021dc1a707b4dcb9bb3b494c5a164e28cb110fcc
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Mon Mar 18 18:00:24 2019 +0100

    Fixed apt compiler plugin to not include inherited endpoint properties.
---
 .../src/main/docs/atmosphere-websocket-component.adoc   |  3 +--
 .../src/main/docs/netty4-http-component.adoc            | 17 +----------------
 .../ROOT/pages/atmosphere-websocket-component.adoc      |  3 +--
 .../modules/ROOT/pages/netty4-http-component.adoc       | 17 +----------------
 .../camel/tools/apt/EndpointAnnotationProcessor.java    |  9 ++++++++-
 5 files changed, 12 insertions(+), 37 deletions(-)

diff --git a/components/camel-atmosphere-websocket/src/main/docs/atmosphere-websocket-component.adoc b/components/camel-atmosphere-websocket/src/main/docs/atmosphere-websocket-component.adoc
index 3004199..ff14a63 100644
--- a/components/camel-atmosphere-websocket/src/main/docs/atmosphere-websocket-component.adoc
+++ b/components/camel-atmosphere-websocket/src/main/docs/atmosphere-websocket-component.adoc
@@ -66,14 +66,13 @@ atmosphere-websocket:servicePath
 
 with the following path and query parameters:
 
-==== Path Parameters (2 parameters):
+==== Path Parameters (1 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
 | *servicePath* | *Required* Name of websocket endpoint |  | String
-| *contextPath* | *Required* The context-path to use |  | String
 |===
 
 
diff --git a/components/camel-netty4-http/src/main/docs/netty4-http-component.adoc b/components/camel-netty4-http/src/main/docs/netty4-http-component.adoc
index ee17d42..dbafa93 100644
--- a/components/camel-netty4-http/src/main/docs/netty4-http-component.adoc
+++ b/components/camel-netty4-http/src/main/docs/netty4-http-component.adoc
@@ -126,7 +126,7 @@ with the following path and query parameters:
 |===
 
 
-==== Query Parameters (94 parameters):
+==== Query Parameters (79 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
@@ -207,25 +207,10 @@ with the following path and query parameters:
 | *trustStoreFile* (security) | Server side certificate keystore to be used for encryption |  | File
 | *trustStoreResource* (security) | Server side certificate keystore to be used for encryption. Is loaded by default from classpath, but you can prefix with classpath:, file:, or http: to load the resource from different systems. |  | String
 | *bridgeErrorHandler* (consumer) | 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. | false | boolean
-| *broadcast* (consumer) | Setting to choose Multicast over UDP | false | boolean
-| *clientMode* (consumer) | If the clientMode is true, netty consumer will connect the address as a TCP client. | false | boolean
-| *reconnect* (consumer) | Used only in clientMode in consumer, the consumer will attempt to reconnect on disconnection if this is enabled | true | boolean
-| *reconnectInterval* (consumer) | Used if reconnect and clientMode is enabled. The interval in milli seconds to attempt reconnection | 10000 | int
 | *exceptionHandler* (consumer) | 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. |  | ExceptionHandler
 | *exchangePattern* (consumer) | Sets the exchange pattern when the consumer creates an exchange. |  | ExchangePattern
-| *networkInterface* (consumer) | When using UDP then this option can be used to specify a network interface by its name, such as eth0 to join a multicast group. |  | String
-| *correlationManager* (producer) | To use a custom correlation manager to manage how request and reply messages are mapped when using request/reply with the netty producer. This should only be used if you have a way to map requests together with replies such as if there is correlation ids in both the request and reply messages. This can be used if you want to multiplex concurrent messages on the same channel (aka connection) in netty. When doing this you must have a way to correlate the [...]
-| *udpConnectionlessSending* (producer) | This option supports connection less udp sending which is a real fire and forget. A connected udp send receive the PortUnreachableException if no one is listen on the receiving port. | false | boolean
-| *useByteBuf* (producer) | If the useByteBuf is true, netty producer will turn the message body into ByteBuf before sending it out. | false | boolean
 | *bootstrapConfiguration* (advanced) | To use a custom configured NettyServerBootstrapConfiguration for configuring this endpoint. |  | NettyServerBootstrap Configuration
 | *synchronous* (advanced) | Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported). | false | boolean
-| *udpByteArrayCodec* (advanced) | For UDP only. If enabled the using byte array codec instead of Java serialization protocol. | false | boolean
-| *allowDefaultCodec* (codec) | The netty component installs a default codec if both, encoder/decoder is null and textline is false. Setting allowDefaultCodec to false prevents the netty component from installing a default codec as the first element in the filter chain. | true | boolean
-| *autoAppendDelimiter* (codec) | Whether or not to auto append missing end delimiter when sending using the textline codec. | true | boolean
-| *decoderMaxLineLength* (codec) | The max line length to use for the textline codec. | 1024 | int
-| *delimiter* (codec) | The delimiter to use for the textline codec. Possible values are LINE and NULL. | LINE | TextLineDelimiter
-| *encoding* (codec) | The encoding (a charset name) to use for the textline codec. If not provided, Camel will use the JVM default Charset. |  | String
-| *textline* (codec) | Only used for TCP. If no codec is specified, you can use this flag to indicate a text line based codec; if not specified or the value is false, then Object Serialization is assumed over TCP. | false | boolean
 |===
 // endpoint options: END
 // spring-boot-auto-configure options: START
diff --git a/docs/components/modules/ROOT/pages/atmosphere-websocket-component.adoc b/docs/components/modules/ROOT/pages/atmosphere-websocket-component.adoc
index 3004199..ff14a63 100644
--- a/docs/components/modules/ROOT/pages/atmosphere-websocket-component.adoc
+++ b/docs/components/modules/ROOT/pages/atmosphere-websocket-component.adoc
@@ -66,14 +66,13 @@ atmosphere-websocket:servicePath
 
 with the following path and query parameters:
 
-==== Path Parameters (2 parameters):
+==== Path Parameters (1 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
 | *servicePath* | *Required* Name of websocket endpoint |  | String
-| *contextPath* | *Required* The context-path to use |  | String
 |===
 
 
diff --git a/docs/components/modules/ROOT/pages/netty4-http-component.adoc b/docs/components/modules/ROOT/pages/netty4-http-component.adoc
index ee17d42..dbafa93 100644
--- a/docs/components/modules/ROOT/pages/netty4-http-component.adoc
+++ b/docs/components/modules/ROOT/pages/netty4-http-component.adoc
@@ -126,7 +126,7 @@ with the following path and query parameters:
 |===
 
 
-==== Query Parameters (94 parameters):
+==== Query Parameters (79 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
@@ -207,25 +207,10 @@ with the following path and query parameters:
 | *trustStoreFile* (security) | Server side certificate keystore to be used for encryption |  | File
 | *trustStoreResource* (security) | Server side certificate keystore to be used for encryption. Is loaded by default from classpath, but you can prefix with classpath:, file:, or http: to load the resource from different systems. |  | String
 | *bridgeErrorHandler* (consumer) | 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. | false | boolean
-| *broadcast* (consumer) | Setting to choose Multicast over UDP | false | boolean
-| *clientMode* (consumer) | If the clientMode is true, netty consumer will connect the address as a TCP client. | false | boolean
-| *reconnect* (consumer) | Used only in clientMode in consumer, the consumer will attempt to reconnect on disconnection if this is enabled | true | boolean
-| *reconnectInterval* (consumer) | Used if reconnect and clientMode is enabled. The interval in milli seconds to attempt reconnection | 10000 | int
 | *exceptionHandler* (consumer) | 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. |  | ExceptionHandler
 | *exchangePattern* (consumer) | Sets the exchange pattern when the consumer creates an exchange. |  | ExchangePattern
-| *networkInterface* (consumer) | When using UDP then this option can be used to specify a network interface by its name, such as eth0 to join a multicast group. |  | String
-| *correlationManager* (producer) | To use a custom correlation manager to manage how request and reply messages are mapped when using request/reply with the netty producer. This should only be used if you have a way to map requests together with replies such as if there is correlation ids in both the request and reply messages. This can be used if you want to multiplex concurrent messages on the same channel (aka connection) in netty. When doing this you must have a way to correlate the [...]
-| *udpConnectionlessSending* (producer) | This option supports connection less udp sending which is a real fire and forget. A connected udp send receive the PortUnreachableException if no one is listen on the receiving port. | false | boolean
-| *useByteBuf* (producer) | If the useByteBuf is true, netty producer will turn the message body into ByteBuf before sending it out. | false | boolean
 | *bootstrapConfiguration* (advanced) | To use a custom configured NettyServerBootstrapConfiguration for configuring this endpoint. |  | NettyServerBootstrap Configuration
 | *synchronous* (advanced) | Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported). | false | boolean
-| *udpByteArrayCodec* (advanced) | For UDP only. If enabled the using byte array codec instead of Java serialization protocol. | false | boolean
-| *allowDefaultCodec* (codec) | The netty component installs a default codec if both, encoder/decoder is null and textline is false. Setting allowDefaultCodec to false prevents the netty component from installing a default codec as the first element in the filter chain. | true | boolean
-| *autoAppendDelimiter* (codec) | Whether or not to auto append missing end delimiter when sending using the textline codec. | true | boolean
-| *decoderMaxLineLength* (codec) | The max line length to use for the textline codec. | 1024 | int
-| *delimiter* (codec) | The delimiter to use for the textline codec. Possible values are LINE and NULL. | LINE | TextLineDelimiter
-| *encoding* (codec) | The encoding (a charset name) to use for the textline codec. If not provided, Camel will use the JVM default Charset. |  | String
-| *textline* (codec) | Only used for TCP. If no codec is specified, you can use this flag to indicate a text line based codec; if not specified or the value is false, then Object Serialization is assumed over TCP. | false | boolean
 |===
 // endpoint options: END
 // spring-boot-auto-configure options: START
diff --git a/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java b/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java
index 8e68482..87dd829 100644
--- a/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java
+++ b/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java
@@ -26,7 +26,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.Objects;
 import java.util.Set;
-
 import javax.annotation.processing.RoundEnvironment;
 import javax.annotation.processing.SupportedAnnotationTypes;
 import javax.lang.model.element.Element;
@@ -155,6 +154,14 @@ public class EndpointAnnotationProcessor extends AbstractCamelAnnotationProcesso
             }
         }
 
+        // remove excluded properties from parent as we dont want to inherit them again
+        if (parentData != null && parentData.get("properties") != null) {
+            Map map = (Map<String, Object>) parentData.get("properties");
+            for (String exclude : uriEndpoint.excludeProperties().split(",")) {
+                map.remove(exclude);
+            }
+        }
+
         TypeElement componentClassElement = findTypeElement(processingEnv, roundEnv, componentModel.getJavaType());
         if (componentClassElement != null) {
             findComponentClassProperties(writer, roundEnv, componentModel, componentOptions, componentClassElement, "", parentData);