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/08/23 10:46:31 UTC
[camel] 02/05: CAMEL-13870: Fast property configuration of Camel
endpoints.
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 8072d7380b84fabee59b921214c3c21c82d9463f
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Fri Aug 23 10:16:18 2019 +0200
CAMEL-13870: Fast property configuration of Camel endpoints.
---
.../org/apache/camel/spi/EndpointPropertyConfigurer.java | 10 ++++++++++
.../support/component/EndpointPropertyConfigurerSupport.java | 12 ++++++++++++
2 files changed, 22 insertions(+)
diff --git a/core/camel-api/src/main/java/org/apache/camel/spi/EndpointPropertyConfigurer.java b/core/camel-api/src/main/java/org/apache/camel/spi/EndpointPropertyConfigurer.java
index f0b556b..66b3bc5 100644
--- a/core/camel-api/src/main/java/org/apache/camel/spi/EndpointPropertyConfigurer.java
+++ b/core/camel-api/src/main/java/org/apache/camel/spi/EndpointPropertyConfigurer.java
@@ -18,7 +18,17 @@ package org.apache.camel.spi;
import org.apache.camel.CamelContext;
+/**
+ * Property configurer for Camel {@link org.apache.camel.Endpoint}
+ * which allows fast configurations without using Java reflection.
+ */
public interface EndpointPropertyConfigurer extends PropertyConfigurer<Object> {
+ /**
+ * Configures the endpoint.
+ *
+ * @param endpoint the endpoint
+ * @param camelContext the camel context
+ */
void configure(Object endpoint, CamelContext camelContext);
}
diff --git a/core/camel-support/src/main/java/org/apache/camel/support/component/EndpointPropertyConfigurerSupport.java b/core/camel-support/src/main/java/org/apache/camel/support/component/EndpointPropertyConfigurerSupport.java
index 55a47e1..a5fa652 100644
--- a/core/camel-support/src/main/java/org/apache/camel/support/component/EndpointPropertyConfigurerSupport.java
+++ b/core/camel-support/src/main/java/org/apache/camel/support/component/EndpointPropertyConfigurerSupport.java
@@ -19,8 +19,20 @@ package org.apache.camel.support.component;
import org.apache.camel.CamelContext;
import org.apache.camel.spi.EndpointPropertyConfigurer;
+/**
+ * Base class used by the camel-apt compiler plugin when it generates source code for all
+ * the endpoint configurations.
+ */
public abstract class EndpointPropertyConfigurerSupport implements EndpointPropertyConfigurer {
+ /**
+ * Converts the property to the expected type
+ *
+ * @param camelContext the camel context
+ * @param type the expected type
+ * @param value the value
+ * @return the value converted to the expected type
+ */
public static <T> T property(CamelContext camelContext, Class<T> type, Object value) {
// if the type is not string based and the value is a bean reference, then we need to lookup
// the bean from the registry