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/20 19:05:21 UTC

[camel] 01/12: CAMEL-13870: Fast property configuration of Camel endpoints. Work in progress.

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

davsclaus pushed a commit to branch CAMEL-13870
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 273d192d96c69a828223a5877492f6a170460b6f
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Mon Aug 19 20:44:10 2019 +0200

    CAMEL-13870: Fast property configuration of Camel endpoints. Work in progress.
---
 ...lderConfigurer.java => PropertyConfigurer.java} | 12 ++++++++---
 .../camel/spi/PropertyPlaceholderConfigurer.java   | 25 ++++------------------
 2 files changed, 13 insertions(+), 24 deletions(-)

diff --git a/core/camel-api/src/main/java/org/apache/camel/spi/PropertyPlaceholderConfigurer.java b/core/camel-api/src/main/java/org/apache/camel/spi/PropertyConfigurer.java
similarity index 76%
copy from core/camel-api/src/main/java/org/apache/camel/spi/PropertyPlaceholderConfigurer.java
copy to core/camel-api/src/main/java/org/apache/camel/spi/PropertyConfigurer.java
index e502ed7..774c614 100644
--- a/core/camel-api/src/main/java/org/apache/camel/spi/PropertyPlaceholderConfigurer.java
+++ b/core/camel-api/src/main/java/org/apache/camel/spi/PropertyConfigurer.java
@@ -22,7 +22,13 @@ import java.util.function.Supplier;
 
 import org.apache.camel.CamelContext;
 
-public interface PropertyPlaceholderConfigurer {
+/**
+ * A configurer for properties on a given object.
+ * <p/>
+ * This is used in Camel to have fast property configuration of Camel components & endpoints,
+ * and for EIP patterns as well.
+ */
+public interface PropertyConfigurer<T> {
 
     /**
      * Gets the options which supports property placeholders and can be resolved.
@@ -30,12 +36,12 @@ public interface PropertyPlaceholderConfigurer {
      *
      * @return key/values of options
      */
-    Map<String, Supplier<String>> getReadPropertyPlaceholderOptions(CamelContext camelContext);
+    Map<String, Supplier<T>> getReadPropertyPlaceholderOptions(CamelContext camelContext);
 
     /**
      * To update an existing property using the function with the key/value and returning the changed value
      * This will be all the string based options.
      */
-    Map<String, Consumer<String>> getWritePropertyPlaceholderOptions(CamelContext camelContext);
+    Map<String, Consumer<T>> getWritePropertyPlaceholderOptions(CamelContext camelContext);
 
 }
diff --git a/core/camel-api/src/main/java/org/apache/camel/spi/PropertyPlaceholderConfigurer.java b/core/camel-api/src/main/java/org/apache/camel/spi/PropertyPlaceholderConfigurer.java
index e502ed7..19e4cbd 100644
--- a/core/camel-api/src/main/java/org/apache/camel/spi/PropertyPlaceholderConfigurer.java
+++ b/core/camel-api/src/main/java/org/apache/camel/spi/PropertyPlaceholderConfigurer.java
@@ -16,26 +16,9 @@
  */
 package org.apache.camel.spi;
 
-import java.util.Map;
-import java.util.function.Consumer;
-import java.util.function.Supplier;
-
-import org.apache.camel.CamelContext;
-
-public interface PropertyPlaceholderConfigurer {
-
-    /**
-     * Gets the options which supports property placeholders and can be resolved.
-     * This will be all the string based options.
-     *
-     * @return key/values of options
-     */
-    Map<String, Supplier<String>> getReadPropertyPlaceholderOptions(CamelContext camelContext);
-
-    /**
-     * To update an existing property using the function with the key/value and returning the changed value
-     * This will be all the string based options.
-     */
-    Map<String, Consumer<String>> getWritePropertyPlaceholderOptions(CamelContext camelContext);
+/**
+ * A {@link PropertyConfigurer} which is used for property placeholders which are string based values only.
+ */
+public interface PropertyPlaceholderConfigurer extends PropertyConfigurer<String> {
 
 }