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 2020/03/15 11:49:31 UTC

[camel] branch master updated (a3bc85f -> fceba8e)

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 a3bc85f  CAMEL-14575: camel-core - TypeConverter from String to Long - drop time pattern
     new 03a502d  CAMEL-14671: Make PropertiesFunction part of the PropertiesComponent SPI
     new fceba8e  Remove old outdated faqs/docs

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:
 .../org/apache/camel/spi}/PropertiesFunction.java  |   2 +-
 .../src/main/java/org/apache/camel/Expression.java |   6 +-
 .../src/main/java/org/apache/camel/Predicate.java  |   9 +-
 .../org/apache/camel/spi/PropertiesComponent.java  |   5 +
 .../converter/TimePatternConverterLoader.java      |  10 +-
 .../services/org/apache/camel/TypeConverterLoader  |   1 +
 .../properties/DefaultPropertiesParser.java        |   1 +
 .../properties/EnvPropertiesFunction.java          |   3 +-
 .../component/properties/PropertiesComponent.java  |  17 +--
 .../properties/ServiceHostPropertiesFunction.java  |   1 +
 .../properties/ServicePortPropertiesFunction.java  |   3 +-
 .../properties/ServicePropertiesFunction.java      |   3 +-
 .../properties/SysPropertiesFunction.java          |   1 +
 .../src/main/docs/eips/content-filter-eip.adoc     |   3 +-
 .../core/xml/AbstractCamelContextFactoryBean.java  |   4 +-
 .../PropertiesComponentFunctionTest.java           |   3 +-
 docs/user-manual-nav.adoc.template                 |   1 -
 docs/user-manual/modules/ROOT/nav.adoc             |   1 -
 .../modules/ROOT/pages/camel-3x-upgrade-guide.adoc |   5 +
 .../modules/ROOT/pages/content-filter-eip.adoc     |   3 +-
 docs/user-manual/modules/ROOT/pages/faq.adoc       |   1 -
 .../pages/faq/does-camel-work-on-ibms-jdk.adoc     |  32 -----
 docs/user-manual/modules/ROOT/pages/languages.adoc |   2 -
 docs/user-manual/modules/ROOT/pages/predicate.adoc |  21 ---
 .../modules/ROOT/pages/scripting-languages.adoc    | 160 ---------------------
 .../ROOT/pages/using-propertyplaceholder.adoc      |   4 +-
 26 files changed, 46 insertions(+), 256 deletions(-)
 rename core/{camel-base/src/main/java/org/apache/camel/component/properties => camel-api/src/generated/java/org/apache/camel/spi}/PropertiesFunction.java (96%)
 copy components/camel-atom/src/generated/java/org/apache/camel/component/atom/AtomConverterLoader.java => core/camel-base/src/generated/java/org/apache/camel/converter/TimePatternConverterLoader.java (74%)
 delete mode 100644 docs/user-manual/modules/ROOT/pages/faq/does-camel-work-on-ibms-jdk.adoc
 delete mode 100644 docs/user-manual/modules/ROOT/pages/scripting-languages.adoc


[camel] 02/02: Remove old outdated faqs/docs

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 fceba8e11e2cbeceab595ea1ff9538e221c63a62
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sun Mar 15 12:46:46 2020 +0100

    Remove old outdated faqs/docs
---
 .../src/main/java/org/apache/camel/Expression.java |   6 +-
 .../src/main/java/org/apache/camel/Predicate.java  |   9 +-
 .../src/main/docs/eips/content-filter-eip.adoc     |   3 +-
 docs/user-manual-nav.adoc.template                 |   1 -
 docs/user-manual/modules/ROOT/nav.adoc             |   1 -
 .../modules/ROOT/pages/content-filter-eip.adoc     |   3 +-
 docs/user-manual/modules/ROOT/pages/faq.adoc       |   1 -
 .../pages/faq/does-camel-work-on-ibms-jdk.adoc     |  32 -----
 docs/user-manual/modules/ROOT/pages/languages.adoc |   2 -
 docs/user-manual/modules/ROOT/pages/predicate.adoc |  21 ---
 .../modules/ROOT/pages/properties-component.adoc   |   4 +-
 .../modules/ROOT/pages/scripting-languages.adoc    | 160 ---------------------
 12 files changed, 7 insertions(+), 236 deletions(-)

diff --git a/core/camel-api/src/main/java/org/apache/camel/Expression.java b/core/camel-api/src/main/java/org/apache/camel/Expression.java
index 30fdfbb..4995d0b 100644
--- a/core/camel-api/src/main/java/org/apache/camel/Expression.java
+++ b/core/camel-api/src/main/java/org/apache/camel/Expression.java
@@ -18,11 +18,7 @@ package org.apache.camel;
 
 /**
  * An <a href="http://camel.apache.org/expression.html">expression</a>
- * provides a plugin strategy for evaluating expressions on a message exchange to support things like
- * <a href="http://camel.apache.org/scripting-languages.html">scripting languages</a>,
- * <a href="http://camel.apache.org/xquery.html">XQuery</a>
- * or <a href="http://camel.apache.org/sql.html">SQL</a> as well
- * as any arbitrary Java expression.
+ * provides a plugin strategy for evaluating expressions on a message exchange.
  */
 public interface Expression {
 
diff --git a/core/camel-api/src/main/java/org/apache/camel/Predicate.java b/core/camel-api/src/main/java/org/apache/camel/Predicate.java
index f8a67e4..d6a81c0 100644
--- a/core/camel-api/src/main/java/org/apache/camel/Predicate.java
+++ b/core/camel-api/src/main/java/org/apache/camel/Predicate.java
@@ -17,13 +17,8 @@
 package org.apache.camel;
 
 /**
- * Evaluates a binary <a
- * href="http://camel.apache.org/predicate.html">predicate</a> on the
- * message exchange to support things like <a
- * href="http://camel.apache.org/scripting-languages.html">scripting
- * languages</a>, <a href="http://camel.apache.org/xquery.html">XQuery</a>
- * or <a href="http://camel.apache.org/sql.html">SQL</a> as well as
- * any arbitrary Java expression.
+ * Evaluates a binary <a href="http://camel.apache.org/predicate.html">predicate</a> on the
+ * message exchange.
  */
 public interface Predicate {
 
diff --git a/core/camel-core-engine/src/main/docs/eips/content-filter-eip.adoc b/core/camel-core-engine/src/main/docs/eips/content-filter-eip.adoc
index 5d106e7..6251f51 100644
--- a/core/camel-core-engine/src/main/docs/eips/content-filter-eip.adoc
+++ b/core/camel-core-engine/src/main/docs/eips/content-filter-eip.adoc
@@ -16,8 +16,7 @@ image::eip/ContentFilter.gif[image]
 
 A common way to filter messages is to use an
 xref:expression.adoc[Expression] in the xref:dsl.adoc[DSL] like
-xref:components::xquery-language.adoc[XQuery] or one of the supported
-xref:scripting-languages.adoc[Scripting Languages].
+xref:components::xquery-language.adoc[XQuery].
 
 == Using the xref:fluent-builders.adoc[Fluent Builders]
 
diff --git a/docs/user-manual-nav.adoc.template b/docs/user-manual-nav.adoc.template
index d7d41ee..eb3a348 100644
--- a/docs/user-manual-nav.adoc.template
+++ b/docs/user-manual-nav.adoc.template
@@ -58,7 +58,6 @@
 <!-- endinject -->
 * Frequently asked questions
  ** xref:faq/can-i-get-commercial-support.adoc[Can I get commercial support?]
- ** xref:faq/does-camel-work-on-ibms-jdk.adoc[Does Camel work on IBM's JDK?]
  ** xref:support.adoc[How can I get help?]
  ** xref:faq/how-can-i-get-the-source-code.adoc[How can I get the source code?]
  ** xref:faq/how-does-camel-compare-to-mule.adoc[How does Camel compare to Mule?]
diff --git a/docs/user-manual/modules/ROOT/nav.adoc b/docs/user-manual/modules/ROOT/nav.adoc
index cee82b6..2c6e325 100644
--- a/docs/user-manual/modules/ROOT/nav.adoc
+++ b/docs/user-manual/modules/ROOT/nav.adoc
@@ -127,7 +127,6 @@
  ** xref:wireTap-eip.adoc[Wire Tap EIP]
 * Frequently asked questions
  ** xref:faq/can-i-get-commercial-support.adoc[Can I get commercial support?]
- ** xref:faq/does-camel-work-on-ibms-jdk.adoc[Does Camel work on IBM's JDK?]
  ** xref:support.adoc[How can I get help?]
  ** xref:faq/how-can-i-get-the-source-code.adoc[How can I get the source code?]
  ** xref:faq/how-does-camel-compare-to-mule.adoc[How does Camel compare to Mule?]
diff --git a/docs/user-manual/modules/ROOT/pages/content-filter-eip.adoc b/docs/user-manual/modules/ROOT/pages/content-filter-eip.adoc
index b3cdb81..1153984 100644
--- a/docs/user-manual/modules/ROOT/pages/content-filter-eip.adoc
+++ b/docs/user-manual/modules/ROOT/pages/content-filter-eip.adoc
@@ -17,8 +17,7 @@ image::eip/ContentFilter.gif[image]
 
 A common way to filter messages is to use an
 xref:expression.adoc[Expression] in the xref:dsl.adoc[DSL] like
-xref:components::xquery-language.adoc[XQuery] or one of the supported
-xref:scripting-languages.adoc[Scripting Languages].
+xref:components::xquery-language.adoc[XQuery].
 
 == Using the xref:fluent-builders.adoc[Fluent Builders]
 
diff --git a/docs/user-manual/modules/ROOT/pages/faq.adoc b/docs/user-manual/modules/ROOT/pages/faq.adoc
index 004e73b..c4d2768 100644
--- a/docs/user-manual/modules/ROOT/pages/faq.adoc
+++ b/docs/user-manual/modules/ROOT/pages/faq.adoc
@@ -16,7 +16,6 @@ so please join in and help us make the documentation better!
 General questions about Camel
 
 * xref:faq/can-i-get-commercial-support.adoc[Can I get commercial support?]
-* xref:faq/does-camel-work-on-ibms-jdk.adoc[Does Camel work on IBM's JDK?]
 * xref:support.adoc[How can I get help?]
 * xref:faq/how-can-i-get-the-source-code.adoc[How can I get the source code?]
 * xref:faq/how-does-camel-compare-to-mule.adoc[How does Camel compare to
diff --git a/docs/user-manual/modules/ROOT/pages/faq/does-camel-work-on-ibms-jdk.adoc b/docs/user-manual/modules/ROOT/pages/faq/does-camel-work-on-ibms-jdk.adoc
deleted file mode 100644
index 420ccff..0000000
--- a/docs/user-manual/modules/ROOT/pages/faq/does-camel-work-on-ibms-jdk.adoc
+++ /dev/null
@@ -1,32 +0,0 @@
-[[DoesCamelworkonIBMsJDK-DoesCamelworkonIBMsJDK]]
-= Does Camel work on IBM's JDK?
-
-Yes, we've tested Camel with IBM's JDK on the AIX and Linux platforms.
-There are a few things to look out for though.
-
-[[DoesCamelworkonIBMsJDK-Exceptionusingcamel-http]]
-== Exception using camel-http
-
-You may get a `sun.io.MalformedInputException` when using camel-http on
-IBM's JDK.
-http://www-128.ibm.com/developerworks/java/jdk/linux/142/runtimeguide.lnx.en.html
-lists a possible solution: if `LANG=en_US.UTF-8`, just set it to
-`LANG=en_US`.
-
-[[DoesCamelworkonIBMsJDK-Buildingcamel-springcomponent]]
-== Building camel-spring component
-
-The schema generation portion of camel-spring uses Sun specific tools
-and thus cannot run on IBM's JDK. It will currently try to download an
-XSD generated from a previous build and then run the tests against that.
-So, if you need to change Camel's model, you will need to rebuild
-camel-spring on another JDK (preferably a Sun JDK).
-
-[[DoesCamelworkonIBMsJDK-Rubyscriptingsupport]]
-== Ruby scripting support
-
-Ruby scripting on IBM's JDK works for Camel 2.0 and onward. For earlier
-versions you'll need to use one of the other
-xref:scripting-languages.adoc[Scripting Languages]. See
-https://issues.apache.org/activemq/browse/CAMEL-1030[CAMEL-1030] for
-more details.
diff --git a/docs/user-manual/modules/ROOT/pages/languages.adoc b/docs/user-manual/modules/ROOT/pages/languages.adoc
index 675b26a..337b2f0 100644
--- a/docs/user-manual/modules/ROOT/pages/languages.adoc
+++ b/docs/user-manual/modules/ROOT/pages/languages.adoc
@@ -27,7 +27,6 @@ For more information, see xref:predicate.adoc[Compound Predicates].
 * xref:components::ognl-language.adoc[OGNL]
 * xref:ref-language.adoc[Ref Language]
 * xref:exchangeProperty-language.adoc[ExchangeProperty]
-* xref:scripting-languages.adoc[Scripting Languages] such as:
 ** xref:components::groovy-language.adoc[Groovy]
 * xref:simple-language.adoc[Simple]
 ** xref:file-language.adoc[File Language]
@@ -35,7 +34,6 @@ For more information, see xref:predicate.adoc[Compound Predicates].
 * xref:tokenize-language.adoc[Tokenizer]
 * xref:components::xpath-language.adoc[XPath]
 * xref:components::xquery-language.adoc[XQuery]
-* https://github.com/camel-extra/camel-extra/blob/master/components/camel-vtdxml/src/main/docs/vtdxml-component.adoc[VTD-XML]
 
 Most of these languages are also supported used as
 xref:parameter-binding-annotations.adoc[Annotation Based
diff --git a/docs/user-manual/modules/ROOT/pages/predicate.adoc b/docs/user-manual/modules/ROOT/pages/predicate.adoc
index 3217415..d3b7c8b 100644
--- a/docs/user-manual/modules/ROOT/pages/predicate.adoc
+++ b/docs/user-manual/modules/ROOT/pages/predicate.adoc
@@ -160,7 +160,6 @@ out of the box
 * xref:components::ognl-language.adoc[OGNL]
 * xref:ref-language.adoc[Ref Language]
 * xref:exchangeProperty-language.adoc[ExchangeProperty]
-* xref:scripting-languages.adoc[Scripting Languages] such as
 ** xref:components::groovy-language.adoc[Groovy]
 * xref:simple-language.adoc[Simple]
 ** xref:file-language.adoc[File Language]
@@ -168,7 +167,6 @@ out of the box
 * xref:tokenize-language.adoc[Tokenizer]
 * xref:components::xpath-language.adoc[XPath]
 * xref:components::xquery-language.adoc[XQuery]
-* https://github.com/camel-extra/camel-extra/blob/master/components/camel-vtdxml/src/main/docs/vtdxml-component.adoc[VTD-XML]
 
 Most of these languages is also supported used as
 xref:parameter-binding-annotations.adoc[Annotation Based
@@ -182,22 +180,3 @@ There are also a number of helper builders available such as the
 https://github.com/apache/camel/blob/master/core/camel-core/src/main/java/org/apache/camel/builder/PredicateBuilder.java[PredicateBuilder
 class]
 
-[[Predicate-UsingPredicatesinyourIDE]]
-== Using Predicates in your IDE
-
-To use different expression and predicates in your IDE you need to
-perform a static import of the builder class for the language(s) you
-wish to use.
-
-[width="100%",cols="50%,50%",options="header",]
-|=======================================================================
-|Language(s) |Builder class to import
-|xref:scripting-languages.adoc[Scripting Languages] such as xref:components::groovy-language.adoc[Groovy]
-
-|xref:components::xpath-language.adoc[XPath]
-|https://github.com/apache/camel/blob/master/components/camel-xpath/src/main/java/org/apache/camel/language/xpath/XPathBuilder.java[org.apache.camel.builder.xml.XPathBuilder]
-
-|xref:components::xquery-language.adoc[XQuery]
-|https://github.com/apache/camel/blob/master/components/camel-saxon/src/main/java/org/apache/camel/component/xquery/XQueryBuilder.java[org.apache.camel.builder.saxon.XQueryBuilder]
-|=======================================================================
-
diff --git a/docs/user-manual/modules/ROOT/pages/properties-component.adoc b/docs/user-manual/modules/ROOT/pages/properties-component.adoc
index b2d438d..3bd3121 100644
--- a/docs/user-manual/modules/ROOT/pages/properties-component.adoc
+++ b/docs/user-manual/modules/ROOT/pages/properties-component.adoc
@@ -792,7 +792,7 @@ public static final class MyBeerFunction implements PropertiesFunction {
 ----
 
 The function must implement
-the `org.apache.camel.spi.PropertiesFunction`
+the `org.apache.camel.component.properties.PropertiesFunction`
 interface. The method `getName` is  the name of the function, eg beer.
 And the `apply` method is where we implement the custom logic to do. As
 the sample code is from an unit test, it just returns a value to refer
@@ -802,7 +802,7 @@ To register a custom function from Java code is as shown below:
 
 [source,java]
 ----
-PropertiesComponent pc = context.getPropertiesComponent();
+PropertiesComponent pc = (org.apache.camel.componennt.properties.PropertiesComponent) context.getPropertiesComponent();
 pc.addFunction(new MyBeerFunction());
 ----
  
diff --git a/docs/user-manual/modules/ROOT/pages/scripting-languages.adoc b/docs/user-manual/modules/ROOT/pages/scripting-languages.adoc
deleted file mode 100644
index dc631d3..0000000
--- a/docs/user-manual/modules/ROOT/pages/scripting-languages.adoc
+++ /dev/null
@@ -1,160 +0,0 @@
-[[ScriptingLanguages-ScriptingLanguages]]
-= Scripting Languages
-
-Camel supports a number of scripting languages which can be used to
-create an Expression or
-Predicate via the standard
-http://jcp.org/en/jsr/detail?id=223[JSR 223] which is a standard part of
-Java 6.
-
-The following scripting languages are integrated into the DSL:
-
-[width="100%",cols="50%,50%",options="header",]
-|=======================================================================
-|Language |DSL keyword
-
-|EL |`el`
-
-|Groovy |`groovy`
-
-|JavaScript |`javaScript`
-
-|JoSQL |`sql`
-
-|JXPath |`jxpath`
-
-|MVEL |`mvel`
-
-|OGNL |`ognl`
-
-|PHP |`php`
-
-|Python |`python`
-
-|Ruby |`ruby`
-
-|XPath |`xpath`
-
-|XQuery |`xquery`
-|=======================================================================
-
-However any http://jcp.org/en/jsr/detail?id=223[JSR 223] scripting
-language can be used using the generic DSL methods.
-
-[[ScriptingLanguages-ScriptContext]]
-== ScriptContext
-
-The JSR-223 scripting languages ScriptContext is pre configured with the
-following attributes all set at `ENGINE_SCOPE`:
-
-[width="100%",cols="30%,30%,40%",options="header",]
-|=======================================================================
-|Attribute |Type |Value
-
-|context |`org.apache.camel.CamelContext` |The Camel Context ( It cannot be used in groovy)
-
-|camelContext |`org.apache.camel.CamelContext` |The Camel Context
-
-|exchange |`org.apache.camel.Exchange` |The current Exchange
-
-|request |`org.apache.camel.Message` |The message (IN message)
-
-|response |`org.apache.camel.Message` |*Deprecated*: The OUT message. The OUT message if null by default. Use
-IN message instead.
-
-|properties |`org.apache.camel.builder.script.PropertiesFunction` |*Camel 2.9:* Function with a `resolve` method to make it easier to use
-Camels xref:components::properties-component.adoc[Properties] component from scripts. See
-further below for example.
-|=======================================================================
-
-See Scripting Languages for the list of
-languages with explicit DSL support.
-
-[[ScriptingLanguages-AdditionalargumentstoScriptingEngine]]
-== Additional arguments to ScriptingEngine
-
-*Since Camel 2.8*
-
-You can provide additional arguments to the `ScriptingEngine` using a
-header on the Camel message with the key `CamelScriptArguments`. 
-See this example:
-
-[[ScriptingLanguages-Usingpropertiesfunction]]
-== Using properties function
-
-*Since Camel 2.9*
-
-If you need to use the xref:components::properties-component.adoc[Properties] component from a
-script to lookup property placeholders, then its a bit cumbersome to do
-so. For example to set a header name myHeader with a value from a property
-placeholder, which key is provided in a header named "foo".
-
-[source,java]
---------------------------------------------------------------------------------------------------------------
-.setHeader("myHeader").groovy("context.resolvePropertyPlaceholders('{{' + request.headers.get('foo') + '}}')")
---------------------------------------------------------------------------------------------------------------
-
-From Camel 2.9 onwards you can now use the properties function and the
-same example is simpler:
-
-[source,java]
--------------------------------------------------------------------------------
-.setHeader("myHeader").groovy("properties.resolve(request.headers.get('foo'))")
--------------------------------------------------------------------------------
-
-[[ScriptingLanguages-Loadingscriptfromexternalresource]]
-== Loading script from external resource
-
-*Since Camel 2.11*
-
-You can externalize the script and have Camel load it from a resource
-such as `"classpath:"`, `"file:"`, or `"http:"`. +
- This is done using the following syntax: `"resource:scheme:location"`,
-eg to refer to a file on the classpath you can do:
-
-[source,java]
--------------------------------------------------------------------
-.setHeader("myHeader").groovy("resource:classpath:mygroovy.groovy")
--------------------------------------------------------------------
-
-[[ScriptingLanguages-Howtogettheresultfrommultiplestatementsscript]]
-== How to get the result from multiple statements script
-
-*Since Camel 2.14*
-
-As the scripteengine evale method just return a Null if it runs a
-multiple statments script. Camel now look up the value of script result
-by using the key of "result" from the value set. If you have multiple
-statements script, you need to make sure you set the value of result
-variable as the script return value.
-
-[source,text]
--------------------------------------------------------------
-bar = "baz";
-# some other statements ... 
-# camel take the result value as the script evaluation result
-result = body * 2 + 1
--------------------------------------------------------------
-
- 
-
-[[ScriptingLanguages-Dependencies]]
-== Dependencies
-
-To use scripting languages in your camel routes you need to add the a
-dependency on *camel-script* which integrates the JSR-223 scripting
-engine.
-
-If you use maven you could just add the following to your pom.xml,
-substituting the version number for the latest & greatest release (see
-the download page for the latest versions).
-
-[source,xml]
----------------------------------------
-<dependency>
-  <groupId>org.apache.camel</groupId>
-  <artifactId>camel-script</artifactId>
-  <version>x.x.x</version>
-</dependency>
----------------------------------------
-


[camel] 01/02: CAMEL-14671: Make PropertiesFunction part of the PropertiesComponent SPI

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 03a502d1ce22c25039a06edd295c72f74ffa2a83
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sun Mar 15 12:38:00 2020 +0100

    CAMEL-14671: Make PropertiesFunction part of the PropertiesComponent SPI
---
 .../org/apache/camel/spi}/PropertiesFunction.java  |  2 +-
 .../org/apache/camel/spi/PropertiesComponent.java  |  5 +++
 .../converter/TimePatternConverterLoader.java      | 36 ++++++++++++++++++++++
 .../services/org/apache/camel/TypeConverterLoader  |  1 +
 .../properties/DefaultPropertiesParser.java        |  1 +
 .../properties/EnvPropertiesFunction.java          |  3 +-
 .../component/properties/PropertiesComponent.java  | 17 +++++-----
 .../properties/ServiceHostPropertiesFunction.java  |  1 +
 .../properties/ServicePortPropertiesFunction.java  |  3 +-
 .../properties/ServicePropertiesFunction.java      |  3 +-
 .../properties/SysPropertiesFunction.java          |  1 +
 .../core/xml/AbstractCamelContextFactoryBean.java  |  4 +--
 .../PropertiesComponentFunctionTest.java           |  3 +-
 .../modules/ROOT/pages/camel-3x-upgrade-guide.adoc |  5 +++
 .../modules/ROOT/pages/properties-component.adoc   |  4 +--
 .../ROOT/pages/using-propertyplaceholder.adoc      |  4 +--
 16 files changed, 74 insertions(+), 19 deletions(-)

diff --git a/core/camel-base/src/main/java/org/apache/camel/component/properties/PropertiesFunction.java b/core/camel-api/src/generated/java/org/apache/camel/spi/PropertiesFunction.java
similarity index 96%
rename from core/camel-base/src/main/java/org/apache/camel/component/properties/PropertiesFunction.java
rename to core/camel-api/src/generated/java/org/apache/camel/spi/PropertiesFunction.java
index c5977bf..111efec 100644
--- a/core/camel-base/src/main/java/org/apache/camel/component/properties/PropertiesFunction.java
+++ b/core/camel-api/src/generated/java/org/apache/camel/spi/PropertiesFunction.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.component.properties;
+package org.apache.camel.spi;
 
 /**
  * A function that is applied instead of looking up a property placeholder.
diff --git a/core/camel-api/src/main/java/org/apache/camel/spi/PropertiesComponent.java b/core/camel-api/src/main/java/org/apache/camel/spi/PropertiesComponent.java
index ff73a77..1dfa693 100644
--- a/core/camel-api/src/main/java/org/apache/camel/spi/PropertiesComponent.java
+++ b/core/camel-api/src/main/java/org/apache/camel/spi/PropertiesComponent.java
@@ -105,6 +105,11 @@ public interface PropertiesComponent extends StaticService {
     void addPropertiesSource(PropertiesSource propertiesSource);
 
     /**
+     * Registers the {@link PropertiesFunction} as a function to this component.
+     */
+    void addPropertiesFunction(PropertiesFunction function);
+
+    /**
      * Whether to silently ignore if a location cannot be located, such as a properties file not found.
      */
     void setIgnoreMissingLocation(boolean ignoreMissingLocation);
diff --git a/core/camel-base/src/generated/java/org/apache/camel/converter/TimePatternConverterLoader.java b/core/camel-base/src/generated/java/org/apache/camel/converter/TimePatternConverterLoader.java
new file mode 100644
index 0000000..4f26a00
--- /dev/null
+++ b/core/camel-base/src/generated/java/org/apache/camel/converter/TimePatternConverterLoader.java
@@ -0,0 +1,36 @@
+/* Generated by camel build tools - do NOT edit this file! */
+package org.apache.camel.converter;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.TypeConversionException;
+import org.apache.camel.TypeConverterLoaderException;
+import org.apache.camel.spi.TypeConverterLoader;
+import org.apache.camel.spi.TypeConverterRegistry;
+import org.apache.camel.support.SimpleTypeConverter;
+import org.apache.camel.support.TypeConverterSupport;
+import org.apache.camel.util.DoubleMap;
+
+/**
+ * Generated by camel build tools - do NOT edit this file!
+ */
+@SuppressWarnings("unchecked")
+public final class TimePatternConverterLoader implements TypeConverterLoader {
+
+    public TimePatternConverterLoader() {
+    }
+
+    @Override
+    public void load(TypeConverterRegistry registry) throws TypeConverterLoaderException {
+        registerConverters(registry);
+    }
+
+    private void registerConverters(TypeConverterRegistry registry) {
+        addTypeConverter(registry, long.class, java.lang.String.class, false,
+            (type, exchange, value) -> org.apache.camel.converter.TimePatternConverter.toMilliSeconds((java.lang.String) value));
+    }
+
+    private static void addTypeConverter(TypeConverterRegistry registry, Class<?> toType, Class<?> fromType, boolean allowNull, SimpleTypeConverter.ConversionMethod method) { 
+        registry.addTypeConverter(toType, fromType, new SimpleTypeConverter(allowNull, method));
+    }
+
+}
diff --git a/core/camel-base/src/generated/resources/META-INF/services/org/apache/camel/TypeConverterLoader b/core/camel-base/src/generated/resources/META-INF/services/org/apache/camel/TypeConverterLoader
index a16a584..b0702fe 100644
--- a/core/camel-base/src/generated/resources/META-INF/services/org/apache/camel/TypeConverterLoader
+++ b/core/camel-base/src/generated/resources/META-INF/services/org/apache/camel/TypeConverterLoader
@@ -7,4 +7,5 @@ org.apache.camel.converter.IOConverterLoader
 org.apache.camel.converter.NIOConverterLoader
 org.apache.camel.converter.ObjectConverterLoader
 org.apache.camel.converter.SQLConverterLoader
+org.apache.camel.converter.TimePatternConverterLoader
 org.apache.camel.impl.converter.UriTypeConverterLoader
diff --git a/core/camel-base/src/main/java/org/apache/camel/component/properties/DefaultPropertiesParser.java b/core/camel-base/src/main/java/org/apache/camel/component/properties/DefaultPropertiesParser.java
index a72e178..2ec35aa 100644
--- a/core/camel-base/src/main/java/org/apache/camel/component/properties/DefaultPropertiesParser.java
+++ b/core/camel-base/src/main/java/org/apache/camel/component/properties/DefaultPropertiesParser.java
@@ -19,6 +19,7 @@ package org.apache.camel.component.properties;
 import java.util.HashSet;
 import java.util.Set;
 
+import org.apache.camel.spi.PropertiesFunction;
 import org.apache.camel.util.ObjectHelper;
 import org.apache.camel.util.StringHelper;
 import org.slf4j.Logger;
diff --git a/core/camel-base/src/main/java/org/apache/camel/component/properties/EnvPropertiesFunction.java b/core/camel-base/src/main/java/org/apache/camel/component/properties/EnvPropertiesFunction.java
index 5febc96..905c9e4 100644
--- a/core/camel-base/src/main/java/org/apache/camel/component/properties/EnvPropertiesFunction.java
+++ b/core/camel-base/src/main/java/org/apache/camel/component/properties/EnvPropertiesFunction.java
@@ -16,10 +16,11 @@
  */
 package org.apache.camel.component.properties;
 
+import org.apache.camel.spi.PropertiesFunction;
 import org.apache.camel.util.StringHelper;
 
 /**
- * A {@link org.apache.camel.component.properties.PropertiesFunction} that lookup the property value from
+ * A {@link PropertiesFunction} that lookup the property value from
  * OS environment variables.
  */
 public class EnvPropertiesFunction implements PropertiesFunction {
diff --git a/core/camel-base/src/main/java/org/apache/camel/component/properties/PropertiesComponent.java b/core/camel-base/src/main/java/org/apache/camel/component/properties/PropertiesComponent.java
index 78feca3..138d223 100644
--- a/core/camel-base/src/main/java/org/apache/camel/component/properties/PropertiesComponent.java
+++ b/core/camel-base/src/main/java/org/apache/camel/component/properties/PropertiesComponent.java
@@ -35,6 +35,7 @@ import org.apache.camel.api.management.ManagedAttribute;
 import org.apache.camel.api.management.ManagedResource;
 import org.apache.camel.spi.FactoryFinder;
 import org.apache.camel.spi.LoadablePropertiesSource;
+import org.apache.camel.spi.PropertiesFunction;
 import org.apache.camel.spi.PropertiesSource;
 import org.apache.camel.spi.annotations.JdkService;
 import org.apache.camel.support.OrderedComparator;
@@ -117,11 +118,11 @@ public class PropertiesComponent extends ServiceSupport implements org.apache.ca
 
     public PropertiesComponent() {
         // include out of the box functions
-        addFunction(new EnvPropertiesFunction());
-        addFunction(new SysPropertiesFunction());
-        addFunction(new ServicePropertiesFunction());
-        addFunction(new ServiceHostPropertiesFunction());
-        addFunction(new ServicePortPropertiesFunction());
+        addPropertiesFunction(new EnvPropertiesFunction());
+        addPropertiesFunction(new SysPropertiesFunction());
+        addPropertiesFunction(new ServicePropertiesFunction());
+        addPropertiesFunction(new ServiceHostPropertiesFunction());
+        addPropertiesFunction(new ServicePortPropertiesFunction());
     }
 
     /**
@@ -441,14 +442,14 @@ public class PropertiesComponent extends ServiceSupport implements org.apache.ca
     }
 
     /**
-     * Registers the {@link org.apache.camel.component.properties.PropertiesFunction} as a function to this component.
+     * Registers the {@link PropertiesFunction} as a function to this component.
      */
-    public void addFunction(PropertiesFunction function) {
+    public void addPropertiesFunction(PropertiesFunction function) {
         this.functions.put(function.getName(), function);
     }
 
     /**
-     * Is there a {@link org.apache.camel.component.properties.PropertiesFunction} with the given name?
+     * Is there a {@link PropertiesFunction} with the given name?
      */
     public boolean hasFunction(String name) {
         return functions.containsKey(name);
diff --git a/core/camel-base/src/main/java/org/apache/camel/component/properties/ServiceHostPropertiesFunction.java b/core/camel-base/src/main/java/org/apache/camel/component/properties/ServiceHostPropertiesFunction.java
index de2b03e..502c97e 100644
--- a/core/camel-base/src/main/java/org/apache/camel/component/properties/ServiceHostPropertiesFunction.java
+++ b/core/camel-base/src/main/java/org/apache/camel/component/properties/ServiceHostPropertiesFunction.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.properties;
 
 import java.util.Locale;
 
+import org.apache.camel.spi.PropertiesFunction;
 import org.apache.camel.util.StringHelper;
 
 /**
diff --git a/core/camel-base/src/main/java/org/apache/camel/component/properties/ServicePortPropertiesFunction.java b/core/camel-base/src/main/java/org/apache/camel/component/properties/ServicePortPropertiesFunction.java
index 1c80de4..bdafb96 100644
--- a/core/camel-base/src/main/java/org/apache/camel/component/properties/ServicePortPropertiesFunction.java
+++ b/core/camel-base/src/main/java/org/apache/camel/component/properties/ServicePortPropertiesFunction.java
@@ -18,10 +18,11 @@ package org.apache.camel.component.properties;
 
 import java.util.Locale;
 
+import org.apache.camel.spi.PropertiesFunction;
 import org.apache.camel.util.StringHelper;
 
 /**
- * A {@link org.apache.camel.component.properties.PropertiesFunction} that lookup the property value from
+ * A {@link PropertiesFunction} that lookup the property value from
  * OS environment variables using the service idiom.
  * <p/>
  * A service is defined using two environment variables where name is name of the service:
diff --git a/core/camel-base/src/main/java/org/apache/camel/component/properties/ServicePropertiesFunction.java b/core/camel-base/src/main/java/org/apache/camel/component/properties/ServicePropertiesFunction.java
index cb9691f..fdd5078 100644
--- a/core/camel-base/src/main/java/org/apache/camel/component/properties/ServicePropertiesFunction.java
+++ b/core/camel-base/src/main/java/org/apache/camel/component/properties/ServicePropertiesFunction.java
@@ -18,10 +18,11 @@ package org.apache.camel.component.properties;
 
 import java.util.Locale;
 
+import org.apache.camel.spi.PropertiesFunction;
 import org.apache.camel.util.StringHelper;
 
 /**
- * A {@link org.apache.camel.component.properties.PropertiesFunction} that lookup the property value from
+ * A {@link PropertiesFunction} that lookup the property value from
  * OS environment variables using the service idiom.
  * <p/>
  * A service is defined using two environment variables where name is name of the service:
diff --git a/core/camel-base/src/main/java/org/apache/camel/component/properties/SysPropertiesFunction.java b/core/camel-base/src/main/java/org/apache/camel/component/properties/SysPropertiesFunction.java
index 0b0400d..57ba7f2 100644
--- a/core/camel-base/src/main/java/org/apache/camel/component/properties/SysPropertiesFunction.java
+++ b/core/camel-base/src/main/java/org/apache/camel/component/properties/SysPropertiesFunction.java
@@ -16,6 +16,7 @@
  */
 package org.apache.camel.component.properties;
 
+import org.apache.camel.spi.PropertiesFunction;
 import org.apache.camel.util.StringHelper;
 
 /**
diff --git a/core/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelContextFactoryBean.java b/core/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelContextFactoryBean.java
index a0df2b1..b2f22c5 100644
--- a/core/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelContextFactoryBean.java
+++ b/core/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelContextFactoryBean.java
@@ -46,7 +46,7 @@ import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.cloud.ServiceRegistry;
 import org.apache.camel.cluster.CamelClusterService;
 import org.apache.camel.component.properties.PropertiesComponent;
-import org.apache.camel.component.properties.PropertiesFunction;
+import org.apache.camel.spi.PropertiesFunction;
 import org.apache.camel.component.properties.PropertiesLocation;
 import org.apache.camel.component.properties.PropertiesParser;
 import org.apache.camel.health.HealthCheckRegistry;
@@ -694,7 +694,7 @@ public abstract class AbstractCamelContextFactoryBean<T extends ModelCamelContex
                 for (CamelPropertyPlaceholderFunctionDefinition function : def.getFunctions()) {
                     String ref = function.getRef();
                     PropertiesFunction pf = CamelContextHelper.mandatoryLookup(getContext(), ref, PropertiesFunction.class);
-                    pc.addFunction(pf);
+                    pc.addPropertiesFunction(pf);
                 }
             }
 
diff --git a/core/camel-core/src/test/java/org/apache/camel/component/properties/PropertiesComponentFunctionTest.java b/core/camel-core/src/test/java/org/apache/camel/component/properties/PropertiesComponentFunctionTest.java
index a110c26..ac34e34 100644
--- a/core/camel-core/src/test/java/org/apache/camel/component/properties/PropertiesComponentFunctionTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/component/properties/PropertiesComponentFunctionTest.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.properties;
 
 import org.apache.camel.ContextTestSupport;
 import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.spi.PropertiesFunction;
 import org.junit.Test;
 
 public class PropertiesComponentFunctionTest extends ContextTestSupport {
@@ -43,7 +44,7 @@ public class PropertiesComponentFunctionTest extends ContextTestSupport {
     @Test
     public void testFunction() throws Exception {
         PropertiesComponent pc = (PropertiesComponent) context.getPropertiesComponent();
-        pc.addFunction(new MyFunction());
+        pc.addPropertiesFunction(new MyFunction());
 
         context.addRoutes(new RouteBuilder() {
             @Override
diff --git a/docs/user-manual/modules/ROOT/pages/camel-3x-upgrade-guide.adoc b/docs/user-manual/modules/ROOT/pages/camel-3x-upgrade-guide.adoc
index ddef34b..5ea257c 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-3x-upgrade-guide.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-3x-upgrade-guide.adoc
@@ -813,3 +813,8 @@ within an `FailedToResolveEndpoint`.
 The `org.apache.camel.impl.engine.JavaUuidGenerator` class has been removed.
 Its a very slow UUID generator and its not recommended to be used.
 
+==== PropertiesComponent
+
+The `org.apache.camel.component.properties.PropertiesFunction` has been moved to `org.apache.camel.spi.PropertiesFunction`
+and its now possible to add custom functions on the `org.apache.camel.spi.PropertiesComponent` interface.
+
diff --git a/docs/user-manual/modules/ROOT/pages/properties-component.adoc b/docs/user-manual/modules/ROOT/pages/properties-component.adoc
index 3bd3121..b2d438d 100644
--- a/docs/user-manual/modules/ROOT/pages/properties-component.adoc
+++ b/docs/user-manual/modules/ROOT/pages/properties-component.adoc
@@ -792,7 +792,7 @@ public static final class MyBeerFunction implements PropertiesFunction {
 ----
 
 The function must implement
-the `org.apache.camel.component.properties.PropertiesFunction`
+the `org.apache.camel.spi.PropertiesFunction`
 interface. The method `getName` is  the name of the function, eg beer.
 And the `apply` method is where we implement the custom logic to do. As
 the sample code is from an unit test, it just returns a value to refer
@@ -802,7 +802,7 @@ To register a custom function from Java code is as shown below:
 
 [source,java]
 ----
-PropertiesComponent pc = (org.apache.camel.componennt.properties.PropertiesComponent) context.getPropertiesComponent();
+PropertiesComponent pc = context.getPropertiesComponent();
 pc.addFunction(new MyBeerFunction());
 ----
  
diff --git a/docs/user-manual/modules/ROOT/pages/using-propertyplaceholder.adoc b/docs/user-manual/modules/ROOT/pages/using-propertyplaceholder.adoc
index cc8fabe..f11ef69 100644
--- a/docs/user-manual/modules/ROOT/pages/using-propertyplaceholder.adoc
+++ b/docs/user-manual/modules/ROOT/pages/using-propertyplaceholder.adoc
@@ -1083,7 +1083,7 @@ public static final class MyBeerFunction implements PropertiesFunction {
 ----
 
 The function must implement
-the `org.apache.camel.component.properties.PropertiesFunction`
+the `org.apache.camel.spi.PropertiesFunction`
 interface. The method `getName` is  the name of the function, e.g.,
 `beer`. And the `apply` method is where we implement the custom
 logic to do. As the sample code is from an unit test, it just returns a
@@ -1093,7 +1093,7 @@ To register a custom function from Java code is as shown below:
 
 [source,java]
 ----
-PropertiesComponent pc = (org.apache.camel.componennt.properties.PropertiesComponent) context.getPropertiesComponent();
+PropertiesComponent pc = context.getPropertiesComponent();
 pc.addFunction(new MyBeerFunction());
 ----