[camel] branch master updated (a989d6b -> ac8c86d)

classic Classic list List threaded Threaded
19 messages Options
Reply | Threaded
Open this post in threaded view
|

[camel] branch master updated (a989d6b -> ac8c86d)

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

gnodet pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git.


    from a989d6b  Merge pull request #3571 from valdar/CAMEL-14535
     new 797f64d  Make RouteContext / CamelContext a constructor argument of the reifiers
     new 6a10928  Fix unit test
     new 52451f1  Move a few methods from ProcessorDefinitionHelper to ProcessorDefinition
     new cf948db  Make RouteContext / CamelContext a constructor argument of the reifiers
     new 351013b  Introduce reifiers for expressions
     new ce995a7  Add hand-written property configurers for languages
     new ab60f40  Fix support for extra properties on dataformat
     new 0ef4475  Fix support for other properties on expressions
     new 764bf19  Fix support for extra properties on dataformat
     new 6894ca0  Fix generation process
     new 87be48b  Remove placeholder configurers completely
     new 92aa432  Configure specific options sooner rather than later
     new 869ce74  Initialize component to leverage the endpoint configurer
     new 0fac7a1  Remove reflection calls used for merging rest configurations
     new 9f399cd  [CAMEL-14445] Remove the property placeholder resolution inside definitions
     new e009f2b  Fix blueprint using the removed "other attributes" support
     new aab471a  Fix rest tests
     new ac8c86d  Merge branch 'CAMEL-14445'

The 18 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:
 .../apache/camel/language/bean/BeanLanguage.java   |  20 +-
 .../cdi/transaction/JtaTransactionPolicy.java      |   2 +-
 .../hystrix/processor/HystrixProcessorFactory.java |   2 +-
 .../hystrix/processor/HystrixReifier.java          |  18 +-
 .../processor/HystrixHierarchicalConfigTest.java   |  17 +-
 .../SpringHystrixRouteHierarchicalConfigTest.java  |   9 +-
 .../apache/camel/component/jpa/JpaEndpoint.java    |   2 +-
 .../apache/camel/jsonpath/JsonPathExpression.java  |  29 +-
 .../resilience4j/ResilienceProcessorFactory.java   |   2 +-
 .../component/resilience4j/ResilienceReifier.java  |  49 +--
 .../apache/camel/component/rest/RestComponent.java |  78 ++--
 .../camel/component/xquery/XQueryBuilder.java      |  19 +-
 components/camel-spring/pom.xml                    |  19 -
 .../camel/component/cron/SpringCronEndpoint.java   |   2 +-
 .../camel/spring/spi/SpringTransactionPolicy.java  |   2 +-
 .../spring/spi/TransactionErrorHandlerReifier.java |   7 +-
 .../properties/SpringOptionalPropertiesDslTest.xml |   2 +-
 .../SpringOptionalPropertiesDslTokenizeTest.xml    |   2 +-
 ...RecipientListParallelOptionalPropertiesTest.xml |   4 +-
 .../BlueprintOptionalPropertiesDslTest.xml         |   4 +-
 .../apache/camel/language/xpath/XPathBuilder.java  |  31 +-
 .../camel/spi/GeneratedPropertyConfigurer.java     |  14 -
 .../org/apache/camel/spi/PropertyConfigurer.java   |  14 +
 .../camel/spi/PropertyPlaceholderConfigurer.java   |  47 --
 .../camel/impl/engine/AbstractCamelContext.java    |  13 +
 .../camel/language/tokenizer/TokenizeLanguage.java |  33 +-
 .../ASN1DataFormatPropertyPlaceholderProvider.java |  41 --
 ...egateDefinitionPropertyPlaceholderProvider.java |  51 ---
 ...Any23DataFormatPropertyPlaceholderProvider.java |  41 --
 .../AvroDataFormatPropertyPlaceholderProvider.java |  41 --
 ...rcodeDataFormatPropertyPlaceholderProvider.java |  43 --
 ...ase64DataFormatPropertyPlaceholderProvider.java |  41 --
 .../BeanDefinitionPropertyPlaceholderProvider.java |  47 --
 ...eanioDataFormatPropertyPlaceholderProvider.java |  47 --
 ...BindyDataFormatPropertyPlaceholderProvider.java |  43 --
 .../CBORDataFormatPropertyPlaceholderProvider.java |  49 ---
 ...CatchDefinitionPropertyPlaceholderProvider.java |  39 --
 ...hoiceDefinitionPropertyPlaceholderProvider.java |  39 --
 ...eakerDefinitionPropertyPlaceholderProvider.java |  41 --
 ...CheckDefinitionPropertyPlaceholderProvider.java |  47 --
 ...stantExpressionPropertyPlaceholderProvider.java |  41 --
 ...tBodyDefinitionPropertyPlaceholderProvider.java |  43 --
 ...ryptoDataFormatPropertyPlaceholderProvider.java |  51 ---
 .../CsvDataFormatPropertyPlaceholderProvider.java  |  63 ---
 ...ustomDataFormatPropertyPlaceholderProvider.java |  41 --
 ...initionPropertiesPlaceholderProviderHelper.java | 322 --------------
 ...DelayDefinitionPropertyPlaceholderProvider.java |  45 --
 ...eVerbDefinitionPropertyPlaceholderProvider.java |  63 ---
 ...outerDefinitionPropertyPlaceholderProvider.java |  45 --
 ...nrichDefinitionPropertyPlaceholderProvider.java |  53 ---
 ...pertyExpressionPropertyPlaceholderProvider.java |  41 --
 ...ssionDefinitionPropertyPlaceholderProvider.java |  41 --
 ...rJsonDataFormatPropertyPlaceholderProvider.java |  43 --
 ...irXmlDataFormatPropertyPlaceholderProvider.java |  43 --
 ...ilterDefinitionPropertyPlaceholderProvider.java |  39 --
 ...nallyDefinitionPropertyPlaceholderProvider.java |  39 --
 ...tpackDataFormatPropertyPlaceholderProvider.java |  47 --
 .../FromDefinitionPropertyPlaceholderProvider.java |  41 --
 ...tVerbDefinitionPropertyPlaceholderProvider.java |  63 ---
 .../GrokDataFormatPropertyPlaceholderProvider.java |  41 --
 ...roovyExpressionPropertyPlaceholderProvider.java |  41 --
 .../GzipDataFormatPropertyPlaceholderProvider.java |  39 --
 .../HL7DataFormatPropertyPlaceholderProvider.java  |  39 --
 ...dVerbDefinitionPropertyPlaceholderProvider.java |  63 ---
 ...eaderExpressionPropertyPlaceholderProvider.java |  41 --
 ...erserExpressionPropertyPlaceholderProvider.java |  41 --
 .../IcalDataFormatPropertyPlaceholderProvider.java |  39 --
 ...sumerDefinitionPropertyPlaceholderProvider.java |  49 ---
 ...nOnlyDefinitionPropertyPlaceholderProvider.java |  41 --
 ...InOutDefinitionPropertyPlaceholderProvider.java |  41 --
 ...rceptDefinitionPropertyPlaceholderProvider.java |  39 --
 ...tFromDefinitionPropertyPlaceholderProvider.java |  41 --
 ...pointDefinitionPropertyPlaceholderProvider.java |  45 --
 ...onXMLDataFormatPropertyPlaceholderProvider.java |  55 ---
 .../JaxbDataFormatPropertyPlaceholderProvider.java |  59 ---
 ...onApiDataFormatPropertyPlaceholderProvider.java |  39 --
 .../JsonDataFormatPropertyPlaceholderProvider.java |  59 ---
 ...nPathExpressionPropertyPlaceholderProvider.java |  45 --
 .../LZFDataFormatPropertyPlaceholderProvider.java  |  39 --
 ...guageExpressionPropertyPlaceholderProvider.java |  43 --
 ...lanceDefinitionPropertyPlaceholderProvider.java |  39 --
 .../LogDefinitionPropertyPlaceholderProvider.java  |  49 ---
 .../LoopDefinitionPropertyPlaceholderProvider.java |  43 --
 ...rshalDefinitionPropertyPlaceholderProvider.java |  39 --
 ...dCallExpressionPropertyPlaceholderProvider.java |  45 --
 ...ipartDataFormatPropertyPlaceholderProvider.java |  43 --
 ...icastDefinitionPropertyPlaceholderProvider.java |  63 ---
 .../MvelExpressionPropertyPlaceholderProvider.java |  41 --
 .../OgnlExpressionPropertyPlaceholderProvider.java |  41 --
 ...etionDefinitionPropertyPlaceholderProvider.java |  49 ---
 ...ptionDefinitionPropertyPlaceholderProvider.java |  49 ---
 ...lbackDefinitionPropertyPlaceholderProvider.java |  41 --
 ...rwiseDefinitionPropertyPlaceholderProvider.java |  39 --
 .../PGPDataFormatPropertyPlaceholderProvider.java  |  57 ---
 ...hVerbDefinitionPropertyPlaceholderProvider.java |  63 ---
 ...elineDefinitionPropertyPlaceholderProvider.java |  39 --
 ...olicyDefinitionPropertyPlaceholderProvider.java |  41 --
 ...nrichDefinitionPropertyPlaceholderProvider.java |  53 ---
 ...tVerbDefinitionPropertyPlaceholderProvider.java |  63 ---
 ...ocessDefinitionPropertyPlaceholderProvider.java |  41 --
 ...tobufDataFormatPropertyPlaceholderProvider.java |  43 --
 ...tVerbDefinitionPropertyPlaceholderProvider.java |  63 ---
 ...tListDefinitionPropertyPlaceholderProvider.java |  69 ---
 .../RefExpressionPropertyPlaceholderProvider.java  |  41 --
 ...eaderDefinitionPropertyPlaceholderProvider.java |  41 --
 ...adersDefinitionPropertyPlaceholderProvider.java |  43 --
 ...rtiesDefinitionPropertyPlaceholderProvider.java |  43 --
 ...pertyDefinitionPropertyPlaceholderProvider.java |  41 --
 ...uenceDefinitionPropertyPlaceholderProvider.java |  39 --
 ...ndingDefinitionPropertyPlaceholderProvider.java |  57 ---
 ...ationDefinitionPropertyPlaceholderProvider.java |  65 ---
 .../RestDefinitionPropertyPlaceholderProvider.java |  57 ---
 ...ParamDefinitionPropertyPlaceholderProvider.java |  49 ---
 ...eaderDefinitionPropertyPlaceholderProvider.java |  49 ---
 ...seMsgDefinitionPropertyPlaceholderProvider.java |  43 --
 ...pertyDefinitionPropertyPlaceholderProvider.java |  41 --
 ...itiesDefinitionPropertyPlaceholderProvider.java |  38 --
 ...tSecurityApiKeyPropertyPlaceholderProvider.java |  43 --
 ...curityBasicAuthPropertyPlaceholderProvider.java |  41 --
 ...tSecurityOAuth2PropertyPlaceholderProvider.java |  47 --
 ...RestsDefinitionPropertyPlaceholderProvider.java |  39 --
 ...lbackDefinitionPropertyPlaceholderProvider.java |  45 --
 ...RouteDefinitionPropertyPlaceholderProvider.java |  57 ---
 ...gSlipDefinitionPropertyPlaceholderProvider.java |  45 --
 .../RssDataFormatPropertyPlaceholderProvider.java  |  39 --
 .../SagaDefinitionPropertyPlaceholderProvider.java |  41 --
 ...plingDefinitionPropertyPlaceholderProvider.java |  39 --
 ...criptDefinitionPropertyPlaceholderProvider.java |  39 --
 ...urityDefinitionPropertyPlaceholderProvider.java |  41 --
 ...eCallDefinitionPropertyPlaceholderProvider.java |  57 ---
 ...tBodyDefinitionPropertyPlaceholderProvider.java |  39 --
 ...tternDefinitionPropertyPlaceholderProvider.java |  39 --
 ...eaderDefinitionPropertyPlaceholderProvider.java |  41 --
 ...pertyDefinitionPropertyPlaceholderProvider.java |  41 --
 ...impleExpressionPropertyPlaceholderProvider.java |  43 --
 ...pJaxbDataFormatPropertyPlaceholderProvider.java |  51 ---
 .../SortDefinitionPropertyPlaceholderProvider.java |  41 --
 .../SpELExpressionPropertyPlaceholderProvider.java |  41 --
 ...SplitDefinitionPropertyPlaceholderProvider.java |  47 --
 .../StepDefinitionPropertyPlaceholderProvider.java |  39 --
 .../StopDefinitionPropertyPlaceholderProvider.java |  39 --
 ...yslogDataFormatPropertyPlaceholderProvider.java |  39 --
 ...rFileDataFormatPropertyPlaceholderProvider.java |  39 --
 ...readsDefinitionPropertyPlaceholderProvider.java |  57 ---
 ...hriftDataFormatPropertyPlaceholderProvider.java |  43 --
 ...ottleDefinitionPropertyPlaceholderProvider.java |  41 --
 ...ptionDefinitionPropertyPlaceholderProvider.java |  45 --
 ...arkupDataFormatPropertyPlaceholderProvider.java |  41 --
 .../ToDefinitionPropertyPlaceholderProvider.java   |  43 --
 ...namicDefinitionPropertyPlaceholderProvider.java |  49 ---
 ...nizerExpressionPropertyPlaceholderProvider.java |  51 ---
 ...actedDefinitionPropertyPlaceholderProvider.java |  41 --
 ...sformDefinitionPropertyPlaceholderProvider.java |  39 --
 .../TryDefinitionPropertyPlaceholderProvider.java  |  39 --
 ...tyCsvDataFormatPropertyPlaceholderProvider.java |  55 ---
 ...WidthDataFormatPropertyPlaceholderProvider.java |  51 ---
 ...tyTsvDataFormatPropertyPlaceholderProvider.java |  51 ---
 ...rshalDefinitionPropertyPlaceholderProvider.java |  39 --
 ...idateDefinitionPropertyPlaceholderProvider.java |  39 --
 .../VerbDefinitionPropertyPlaceholderProvider.java |  63 ---
 .../WhenDefinitionPropertyPlaceholderProvider.java |  39 --
 ...pointDefinitionPropertyPlaceholderProvider.java |  39 --
 ...reTapDefinitionPropertyPlaceholderProvider.java |  59 ---
 ...urityDataFormatPropertyPlaceholderProvider.java |  57 ---
 ...nizerExpressionPropertyPlaceholderProvider.java |  43 --
 ...XPathExpressionPropertyPlaceholderProvider.java |  51 ---
 ...QueryExpressionPropertyPlaceholderProvider.java |  45 --
 ...treamDataFormatPropertyPlaceholderProvider.java |  49 ---
 ...mlRpcDataFormatPropertyPlaceholderProvider.java |  39 --
 .../YAMLDataFormatPropertyPlaceholderProvider.java |  49 ---
 ...laterDataFormatPropertyPlaceholderProvider.java |  39 --
 ...pFileDataFormatPropertyPlaceholderProvider.java |  39 --
 .../resources/org/apache/camel/model/saga.json     |   4 +-
 .../camel/builder/ErrorHandlerBuilderRef.java      |   2 +-
 .../camel/builder/ErrorHandlerBuilderSupport.java  |   2 +-
 .../org/apache/camel/builder/RouteBuilder.java     |   4 +-
 .../org/apache/camel/builder/SimpleBuilder.java    |  17 +-
 .../camel/impl/AbstractModelCamelContext.java      |   2 +-
 .../java/org/apache/camel/impl/DefaultModel.java   |   2 +-
 .../apache/camel/model/DataFormatDefinition.java   |  22 +-
 .../DefinitionPropertyPlaceholderConfigurer.java   |  53 ---
 .../model/ExpressionSubElementDefinition.java      |  48 +-
 .../model/InterceptSendToEndpointDefinition.java   |   1 -
 .../apache/camel/model/LoadBalancerDefinition.java |  19 +-
 .../apache/camel/model/MulticastDefinition.java    |  42 +-
 .../apache/camel/model/OnExceptionDefinition.java  |   6 +-
 .../camel/model/OptionalIdentifiedDefinition.java  |   2 +-
 .../apache/camel/model/OtherAttributesAware.java   |  42 --
 .../apache/camel/model/ProcessorDefinition.java    |  45 +-
 .../camel/model/ProcessorDefinitionHelper.java     | 485 ---------------------
 .../model/Resilience4jConfigurationCommon.java     | 120 ++---
 .../model/Resilience4jConfigurationDefinition.java |  30 +-
 .../apache/camel/model/RouteDefinitionHelper.java  |  44 +-
 .../org/apache/camel/model/SagaDefinition.java     |  29 +-
 .../org/apache/camel/model/SamplingDefinition.java |  45 +-
 .../org/apache/camel/model/SplitDefinition.java    |  79 ++--
 .../org/apache/camel/model/ThrottleDefinition.java |  38 +-
 .../camel/model/config/ResequencerConfig.java      |  22 +-
 .../camel/model/language/ExpressionDefinition.java | 181 ++------
 .../camel/model/language/JsonPathExpression.java   |  62 ---
 .../camel/model/language/MethodCallExpression.java |  48 --
 .../model/language/NamespaceAwareExpression.java   |  18 -
 .../camel/model/language/SimpleExpression.java     |  31 --
 .../camel/model/language/TokenizerExpression.java  |  43 --
 .../model/language/XMLTokenizerExpression.java     |  31 +-
 .../camel/model/language/XPathExpression.java      | 112 +----
 .../camel/model/language/XQueryExpression.java     |  40 +-
 .../apache/camel/model/rest/RestDefinition.java    |  10 -
 .../org/apache/camel/reifier/AbstractReifier.java  |  95 +++-
 .../org/apache/camel/reifier/AggregateReifier.java | 129 +++---
 .../java/org/apache/camel/reifier/BeanReifier.java |  16 +-
 .../org/apache/camel/reifier/CatchReifier.java     |  12 +-
 .../org/apache/camel/reifier/ChoiceReifier.java    |  22 +-
 .../camel/reifier/CircuitBreakerReifier.java       |   6 +-
 .../apache/camel/reifier/ClaimCheckReifier.java    |  23 +-
 .../apache/camel/reifier/ConvertBodyReifier.java   |  28 +-
 .../org/apache/camel/reifier/DelayReifier.java     |  31 +-
 .../apache/camel/reifier/DynamicRouterReifier.java |  16 +-
 .../org/apache/camel/reifier/EnrichReifier.java    |  24 +-
 .../apache/camel/reifier/ExpressionReifier.java    |  16 +-
 .../org/apache/camel/reifier/FilterReifier.java    |  14 +-
 .../org/apache/camel/reifier/FinallyReifier.java   |   8 +-
 .../camel/reifier/IdempotentConsumerReifier.java   |  20 +-
 .../apache/camel/reifier/InterceptFromReifier.java |   8 +-
 .../org/apache/camel/reifier/InterceptReifier.java |   8 +-
 .../reifier/InterceptSendToEndpointReifier.java    |  24 +-
 .../apache/camel/reifier/LoadBalanceReifier.java   |  14 +-
 .../java/org/apache/camel/reifier/LogReifier.java  |  18 +-
 .../java/org/apache/camel/reifier/LoopReifier.java |  18 +-
 .../org/apache/camel/reifier/MarshalReifier.java   |   8 +-
 .../org/apache/camel/reifier/MulticastReifier.java |  51 ++-
 .../apache/camel/reifier/OnCompletionReifier.java  |  29 +-
 .../apache/camel/reifier/OnExceptionReifier.java   |  66 +--
 .../apache/camel/reifier/OnFallbackReifier.java    |   8 +-
 .../org/apache/camel/reifier/OtherwiseReifier.java |   8 +-
 .../org/apache/camel/reifier/PipelineReifier.java  |   8 +-
 .../org/apache/camel/reifier/PolicyReifier.java    |   8 +-
 .../apache/camel/reifier/PollEnrichReifier.java    |  30 +-
 .../org/apache/camel/reifier/ProcessReifier.java   |   6 +-
 .../org/apache/camel/reifier/ProcessorReifier.java | 446 ++++++++++++++-----
 .../apache/camel/reifier/RecipientListReifier.java |  55 ++-
 .../apache/camel/reifier/RemoveHeaderReifier.java  |   8 +-
 .../apache/camel/reifier/RemoveHeadersReifier.java |  18 +-
 .../camel/reifier/RemovePropertiesReifier.java     |  18 +-
 .../camel/reifier/RemovePropertyReifier.java       |   8 +-
 .../apache/camel/reifier/ResequenceReifier.java    |  77 ++--
 .../org/apache/camel/reifier/RollbackReifier.java  |  10 +-
 .../org/apache/camel/reifier/RouteReifier.java     |  39 +-
 .../apache/camel/reifier/RoutingSlipReifier.java   |  21 +-
 .../java/org/apache/camel/reifier/SagaReifier.java |  36 +-
 .../org/apache/camel/reifier/SamplingReifier.java  |  12 +-
 .../org/apache/camel/reifier/ScriptReifier.java    |   8 +-
 .../java/org/apache/camel/reifier/SendReifier.java |   8 +-
 .../apache/camel/reifier/ServiceCallReifier.java   |   6 +-
 .../org/apache/camel/reifier/SetBodyReifier.java   |   8 +-
 .../camel/reifier/SetExchangePatternReifier.java   |   6 +-
 .../org/apache/camel/reifier/SetHeaderReifier.java |  10 +-
 .../apache/camel/reifier/SetPropertyReifier.java   |  10 +-
 .../java/org/apache/camel/reifier/SortReifier.java |  10 +-
 .../org/apache/camel/reifier/SplitReifier.java     |  46 +-
 .../java/org/apache/camel/reifier/StepReifier.java |  12 +-
 .../java/org/apache/camel/reifier/StopReifier.java |   6 +-
 .../org/apache/camel/reifier/ThreadsReifier.java   |  33 +-
 .../org/apache/camel/reifier/ThrottleReifier.java  |  40 +-
 .../camel/reifier/ThrowExceptionReifier.java       |  26 +-
 .../org/apache/camel/reifier/ToDynamicReifier.java |  20 +-
 .../apache/camel/reifier/TransactedReifier.java    |   8 +-
 .../org/apache/camel/reifier/TransformReifier.java |   8 +-
 .../java/org/apache/camel/reifier/TryReifier.java  |  14 +-
 .../org/apache/camel/reifier/UnmarshalReifier.java |   8 +-
 .../org/apache/camel/reifier/ValidateReifier.java  |   8 +-
 .../java/org/apache/camel/reifier/WhenReifier.java |   8 +-
 .../reifier/WhenSkipSendToEndpointReifier.java     |  12 +-
 .../org/apache/camel/reifier/WireTapReifier.java   |  45 +-
 .../reifier/dataformat/ASN1DataFormatReifier.java  |   5 +-
 .../reifier/dataformat/Any23DataFormatReifier.java |   5 +-
 .../reifier/dataformat/AvroDataFormatReifier.java  |   5 +-
 .../dataformat/BarcodeDataFormatReifier.java       |   5 +-
 .../dataformat/Base64DataFormatReifier.java        |   5 +-
 .../dataformat/BeanioDataFormatReifier.java        |   5 +-
 .../reifier/dataformat/BindyDataFormatReifier.java |   8 +-
 .../reifier/dataformat/CBORDataFormatReifier.java  |   5 +-
 .../dataformat/CryptoDataFormatReifier.java        |   5 +-
 .../reifier/dataformat/CsvDataFormatReifier.java   |   5 +-
 .../dataformat/CustomDataFormatReifier.java        |   6 +-
 .../reifier/dataformat/DataFormatReifier.java      |  41 +-
 .../reifier/dataformat/FhirDataFormatReifier.java  |   5 +-
 .../dataformat/FhirJsonDataFormatReifier.java      |   5 +-
 .../dataformat/FhirXmlDataFormatReifier.java       |   5 +-
 .../dataformat/FlatpackDataFormatReifier.java      |   5 +-
 .../reifier/dataformat/GrokDataFormatReifier.java  |   5 +-
 .../reifier/dataformat/GzipDataFormatReifier.java  |   5 +-
 .../reifier/dataformat/HL7DataFormatReifier.java   |   5 +-
 .../reifier/dataformat/IcalDataFormatReifier.java  |   5 +-
 .../dataformat/JacksonXMLDataFormatReifier.java    |   5 +-
 .../reifier/dataformat/JaxbDataFormatReifier.java  |   5 +-
 .../dataformat/JsonApiDataFormatReifier.java       |   5 +-
 .../reifier/dataformat/JsonDataFormatReifier.java  |   5 +-
 .../reifier/dataformat/LZFDataFormatReifier.java   |   5 +-
 .../dataformat/MimeMultipartDataFormatReifier.java |   5 +-
 .../reifier/dataformat/PGPDataFormatReifier.java   |   5 +-
 .../dataformat/ProtobufDataFormatReifier.java      |   5 +-
 .../reifier/dataformat/RssDataFormatReifier.java   |   5 +-
 .../dataformat/SoapJaxbDataFormatReifier.java      |   5 +-
 .../dataformat/SyslogDataFormatReifier.java        |   5 +-
 .../dataformat/TarFileDataFormatReifier.java       |   5 +-
 .../dataformat/ThriftDataFormatReifier.java        |   5 +-
 .../dataformat/TidyMarkupDataFormatReifier.java    |   5 +-
 .../UniVocityAbstractDataFormatReifier.java        |   5 +-
 .../dataformat/UniVocityCsvDataFormatReifier.java  |   5 +-
 .../UniVocityFixedWidthDataFormatReifier.java      |   5 +-
 .../dataformat/UniVocityTsvDataFormatReifier.java  |   5 +-
 .../dataformat/XMLSecurityDataFormatReifier.java   |   5 +-
 .../dataformat/XStreamDataFormatReifier.java       |   5 +-
 .../dataformat/XmlRpcDataFormatReifier.java        |   5 +-
 .../reifier/dataformat/YAMLDataFormatReifier.java  |   5 +-
 .../reifier/dataformat/ZipDataFormatReifier.java   |   5 +-
 .../dataformat/ZipFileDataFormatReifier.java       |   5 +-
 .../errorhandler/DeadLetterChannelReifier.java     |  18 +-
 .../errorhandler/DefaultErrorHandlerReifier.java   |  10 +-
 .../errorhandler/ErrorHandlerRefReifier.java       |   6 +-
 .../reifier/errorhandler/ErrorHandlerReifier.java  |  60 ++-
 .../errorhandler/NoErrorHandlerReifier.java        |   6 +-
 .../camel/reifier/language/ExpressionReifier.java  | 206 +++++++++
 .../language/JsonPathExpressionReifier.java        |  58 +++
 .../language/MethodCallExpressionReifier.java      |  50 +++
 .../reifier/language/SimpleExpressionReifier.java  |  57 +++
 .../language/TokenizerExpressionReifier.java       |  65 +++
 .../language/XMLTokenizerExpressionReifier.java    |  65 +++
 .../reifier/language/XPathExpressionReifier.java   |  69 +++
 .../reifier/language/XQueryExpressionReifier.java  |  63 +++
 .../loadbalancer/CustomLoadBalancerReifier.java    |   8 +-
 .../loadbalancer/FailoverLoadBalancerReifier.java  |  14 +-
 .../reifier/loadbalancer/LoadBalancerReifier.java  |  20 +-
 .../loadbalancer/RandomLoadBalancerReifier.java    |   6 +-
 .../RoundRobinLoadBalancerReifier.java             |   6 +-
 .../loadbalancer/StickyLoadBalancerReifier.java    |   8 +-
 .../loadbalancer/TopicLoadBalancerReifier.java     |   6 +-
 .../loadbalancer/WeightedLoadBalancerReifier.java  |  10 +-
 .../camel/reifier/rest/RestBindingReifier.java     |  84 ++--
 .../transformer/CustomTransformeReifier.java       |  14 +-
 .../transformer/DataFormatTransformeReifier.java   |  10 +-
 .../transformer/EndpointTransformeReifier.java     |  14 +-
 .../reifier/transformer/TransformerReifier.java    |  24 +-
 .../reifier/validator/CustomValidatorReifier.java  |  14 +-
 .../validator/EndpointValidatorReifier.java        |  10 +-
 .../validator/PredicateValidatorReifier.java       |  10 +-
 .../camel/reifier/validator/ValidatorReifier.java  |  26 +-
 .../core/xml/AbstractCamelContextFactoryBean.java  |   4 +-
 .../OptionalPropertiesDslInvalidSyntaxTest.java    |  21 +-
 .../properties/OptionalPropertiesDslTest.java      |   3 +-
 .../properties/PropertiesRouteIdTest.java          |   2 +-
 .../validator/CustomSchemaFactoryFeatureTest.java  |   1 +
 .../ValidatorEndpointClearCachedSchemaTest.java    |  19 +-
 ...RouteWithConstantFieldFromExchangeFailTest.java |   1 +
 .../camel/reifier/DataFormatReifierTest.java       |   4 +-
 .../apache/camel/reifier/ProcessorReifierTest.java |   7 +-
 .../apache/camel/support/CamelContextHelper.java   |  26 +-
 .../org/apache/camel/support/DefaultComponent.java |   9 +-
 .../support/ExpressionToPredicateAdapter.java      |  15 +-
 .../camel/support/PropertyBindingSupport.java      |   9 +-
 .../camel/support/ScheduledPollEndpoint.java       |   2 +-
 .../java/org/apache/camel/xml/in/ModelParser.java  |  66 +--
 .../java/org/apache/camel/xml/in/BaseParser.java   |  14 +-
 .../xtokenizer/XMLTokenExpressionIterator.java     |  33 +-
 .../language/xtokenizer/XMLTokenizeLanguage.java   |   2 +-
 .../packaging/EndpointSchemaGeneratorMojo.java     |  80 ----
 .../apache/camel/maven/packaging/GenerateMojo.java |   2 +
 .../packaging/ModelXmlParserGeneratorMojo.java     |  11 +
 .../maven/packaging/PackageDataFormatMojo.java     |   3 -
 .../packaging/PropertyPlaceholderGenerator.java    | 176 --------
 .../camel/maven/packaging/SchemaGeneratorMojo.java |  73 +---
 372 files changed, 2773 insertions(+), 10109 deletions(-)
 delete mode 100644 core/camel-api/src/main/java/org/apache/camel/spi/PropertyPlaceholderConfigurer.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/ASN1DataFormatPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/AggregateDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/Any23DataFormatPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/AvroDataFormatPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/BarcodeDataFormatPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/Base64DataFormatPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/BeanDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/BeanioDataFormatPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/BindyDataFormatPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/CBORDataFormatPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/CatchDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/ChoiceDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/CircuitBreakerDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/ClaimCheckDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/ConstantExpressionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/ConvertBodyDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/CryptoDataFormatPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/CsvDataFormatPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/CustomDataFormatPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/DefinitionPropertiesPlaceholderProviderHelper.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/DelayDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/DeleteVerbDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/DynamicRouterDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/EnrichDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/ExchangePropertyExpressionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/ExpressionDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/FhirJsonDataFormatPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/FhirXmlDataFormatPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/FilterDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/FinallyDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/FlatpackDataFormatPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/FromDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/GetVerbDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/GrokDataFormatPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/GroovyExpressionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/GzipDataFormatPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/HL7DataFormatPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/HeadVerbDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/HeaderExpressionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/Hl7TerserExpressionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/IcalDataFormatPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/IdempotentConsumerDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/InOnlyDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/InOutDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/InterceptDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/InterceptFromDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/InterceptSendToEndpointDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/JacksonXMLDataFormatPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/JaxbDataFormatPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/JsonApiDataFormatPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/JsonDataFormatPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/JsonPathExpressionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/LZFDataFormatPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/LanguageExpressionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/LoadBalanceDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/LogDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/LoopDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/MarshalDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/MethodCallExpressionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/MimeMultipartDataFormatPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/MulticastDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/MvelExpressionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/OgnlExpressionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/OnCompletionDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/OnExceptionDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/OnFallbackDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/OtherwiseDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/PGPDataFormatPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/PatchVerbDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/PipelineDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/PolicyDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/PollEnrichDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/PostVerbDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/ProcessDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/ProtobufDataFormatPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/PutVerbDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/RecipientListDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/RefExpressionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/RemoveHeaderDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/RemoveHeadersDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/RemovePropertiesDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/RemovePropertyDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/ResequenceDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/RestBindingDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/RestConfigurationDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/RestDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/RestOperationParamDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/RestOperationResponseHeaderDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/RestOperationResponseMsgDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/RestPropertyDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/RestSecuritiesDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/RestSecurityApiKeyPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/RestSecurityBasicAuthPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/RestSecurityOAuth2PropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/RestsDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/RollbackDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/RouteDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/RoutingSlipDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/RssDataFormatPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/SagaDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/SamplingDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/ScriptDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/SecurityDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/ServiceCallDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/SetBodyDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/SetExchangePatternDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/SetHeaderDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/SetPropertyDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/SimpleExpressionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/SoapJaxbDataFormatPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/SortDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/SpELExpressionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/SplitDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/StepDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/StopDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/SyslogDataFormatPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/TarFileDataFormatPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/ThreadsDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/ThriftDataFormatPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/ThrottleDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/ThrowExceptionDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/TidyMarkupDataFormatPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/ToDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/ToDynamicDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/TokenizerExpressionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/TransactedDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/TransformDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/TryDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/UniVocityCsvDataFormatPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/UniVocityFixedWidthDataFormatPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/UniVocityTsvDataFormatPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/UnmarshalDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/ValidateDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/VerbDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/WhenDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/WhenSkipSendToEndpointDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/WireTapDefinitionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/XMLSecurityDataFormatPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/XMLTokenizerExpressionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/XPathExpressionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/XQueryExpressionPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/XStreamDataFormatPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/XmlRpcDataFormatPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/YAMLDataFormatPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/ZipDeflaterDataFormatPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/ZipFileDataFormatPropertyPlaceholderProvider.java
 delete mode 100644 core/camel-core-engine/src/main/java/org/apache/camel/model/DefinitionPropertyPlaceholderConfigurer.java
 delete mode 100644 core/camel-core-engine/src/main/java/org/apache/camel/model/OtherAttributesAware.java
 create mode 100644 core/camel-core-engine/src/main/java/org/apache/camel/reifier/language/ExpressionReifier.java
 create mode 100644 core/camel-core-engine/src/main/java/org/apache/camel/reifier/language/JsonPathExpressionReifier.java
 create mode 100644 core/camel-core-engine/src/main/java/org/apache/camel/reifier/language/MethodCallExpressionReifier.java
 create mode 100644 core/camel-core-engine/src/main/java/org/apache/camel/reifier/language/SimpleExpressionReifier.java
 create mode 100644 core/camel-core-engine/src/main/java/org/apache/camel/reifier/language/TokenizerExpressionReifier.java
 create mode 100644 core/camel-core-engine/src/main/java/org/apache/camel/reifier/language/XMLTokenizerExpressionReifier.java
 create mode 100644 core/camel-core-engine/src/main/java/org/apache/camel/reifier/language/XPathExpressionReifier.java
 create mode 100644 core/camel-core-engine/src/main/java/org/apache/camel/reifier/language/XQueryExpressionReifier.java
 delete mode 100644 tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PropertyPlaceholderGenerator.java

Reply | Threaded
Open this post in threaded view
|

[camel] 01/18: Make RouteContext / CamelContext a constructor argument of the reifiers

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

gnodet pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 797f64dac5b4a4e4df7f7e008194aaa591475273
Author: Guillaume Nodet <[hidden email]>
AuthorDate: Mon Feb 10 10:06:29 2020 +0100

    Make RouteContext / CamelContext a constructor argument of the reifiers
---
 .../cdi/transaction/JtaTransactionPolicy.java      |  2 +-
 .../hystrix/processor/HystrixProcessorFactory.java |  2 +-
 .../hystrix/processor/HystrixReifier.java          | 16 ++--
 .../processor/HystrixHierarchicalConfigTest.java   | 17 ++--
 .../SpringHystrixRouteHierarchicalConfigTest.java  |  9 +-
 .../resilience4j/ResilienceProcessorFactory.java   |  2 +-
 .../component/resilience4j/ResilienceReifier.java  | 12 +--
 .../camel/spring/spi/SpringTransactionPolicy.java  |  2 +-
 .../spring/spi/TransactionErrorHandlerReifier.java |  7 +-
 .../camel/builder/ErrorHandlerBuilderRef.java      |  2 +-
 .../camel/builder/ErrorHandlerBuilderSupport.java  |  2 +-
 .../camel/impl/AbstractModelCamelContext.java      |  2 +-
 .../java/org/apache/camel/impl/DefaultModel.java   |  2 +-
 .../org/apache/camel/reifier/AbstractReifier.java  | 32 ++++---
 .../org/apache/camel/reifier/AggregateReifier.java | 72 ++++++++--------
 .../java/org/apache/camel/reifier/BeanReifier.java | 10 +--
 .../org/apache/camel/reifier/CatchReifier.java     | 10 +--
 .../org/apache/camel/reifier/ChoiceReifier.java    | 12 +--
 .../camel/reifier/CircuitBreakerReifier.java       |  6 +-
 .../apache/camel/reifier/ClaimCheckReifier.java    | 10 +--
 .../apache/camel/reifier/ConvertBodyReifier.java   |  8 +-
 .../org/apache/camel/reifier/DelayReifier.java     | 10 +--
 .../apache/camel/reifier/DynamicRouterReifier.java | 10 +--
 .../org/apache/camel/reifier/EnrichReifier.java    | 12 +--
 .../apache/camel/reifier/ExpressionReifier.java    |  6 +-
 .../org/apache/camel/reifier/FilterReifier.java    |  8 +-
 .../org/apache/camel/reifier/FinallyReifier.java   |  8 +-
 .../camel/reifier/IdempotentConsumerReifier.java   |  8 +-
 .../apache/camel/reifier/InterceptFromReifier.java |  8 +-
 .../org/apache/camel/reifier/InterceptReifier.java |  8 +-
 .../reifier/InterceptSendToEndpointReifier.java    | 24 +++---
 .../apache/camel/reifier/LoadBalanceReifier.java   | 10 +--
 .../java/org/apache/camel/reifier/LogReifier.java  | 16 ++--
 .../java/org/apache/camel/reifier/LoopReifier.java | 14 ++--
 .../org/apache/camel/reifier/MarshalReifier.java   |  8 +-
 .../org/apache/camel/reifier/MulticastReifier.java | 42 +++++-----
 .../apache/camel/reifier/OnCompletionReifier.java  | 22 ++---
 .../apache/camel/reifier/OnExceptionReifier.java   | 40 ++++-----
 .../apache/camel/reifier/OnFallbackReifier.java    |  8 +-
 .../org/apache/camel/reifier/OtherwiseReifier.java |  8 +-
 .../org/apache/camel/reifier/PipelineReifier.java  |  8 +-
 .../org/apache/camel/reifier/PolicyReifier.java    |  8 +-
 .../apache/camel/reifier/PollEnrichReifier.java    | 24 +++---
 .../org/apache/camel/reifier/ProcessReifier.java   |  6 +-
 .../org/apache/camel/reifier/ProcessorReifier.java | 98 ++++++++++++----------
 .../apache/camel/reifier/RecipientListReifier.java | 42 +++++-----
 .../apache/camel/reifier/RemoveHeaderReifier.java  |  6 +-
 .../apache/camel/reifier/RemoveHeadersReifier.java |  6 +-
 .../camel/reifier/RemovePropertiesReifier.java     |  6 +-
 .../camel/reifier/RemovePropertyReifier.java       |  6 +-
 .../apache/camel/reifier/ResequenceReifier.java    | 44 +++++-----
 .../org/apache/camel/reifier/RollbackReifier.java  | 10 +--
 .../org/apache/camel/reifier/RouteReifier.java     | 34 ++++----
 .../apache/camel/reifier/RoutingSlipReifier.java   | 14 ++--
 .../java/org/apache/camel/reifier/SagaReifier.java | 12 +--
 .../org/apache/camel/reifier/SamplingReifier.java  |  6 +-
 .../org/apache/camel/reifier/ScriptReifier.java    |  6 +-
 .../java/org/apache/camel/reifier/SendReifier.java |  8 +-
 .../apache/camel/reifier/ServiceCallReifier.java   |  6 +-
 .../org/apache/camel/reifier/SetBodyReifier.java   |  6 +-
 .../camel/reifier/SetExchangePatternReifier.java   |  6 +-
 .../org/apache/camel/reifier/SetHeaderReifier.java |  8 +-
 .../apache/camel/reifier/SetPropertyReifier.java   |  8 +-
 .../java/org/apache/camel/reifier/SortReifier.java |  6 +-
 .../org/apache/camel/reifier/SplitReifier.java     | 18 ++--
 .../java/org/apache/camel/reifier/StepReifier.java | 12 +--
 .../java/org/apache/camel/reifier/StopReifier.java |  6 +-
 .../org/apache/camel/reifier/ThreadsReifier.java   | 24 +++---
 .../org/apache/camel/reifier/ThrottleReifier.java  |  8 +-
 .../camel/reifier/ThrowExceptionReifier.java       |  8 +-
 .../org/apache/camel/reifier/ToDynamicReifier.java | 20 ++---
 .../apache/camel/reifier/TransactedReifier.java    |  8 +-
 .../org/apache/camel/reifier/TransformReifier.java |  6 +-
 .../java/org/apache/camel/reifier/TryReifier.java  | 14 ++--
 .../org/apache/camel/reifier/UnmarshalReifier.java |  8 +-
 .../org/apache/camel/reifier/ValidateReifier.java  |  6 +-
 .../java/org/apache/camel/reifier/WhenReifier.java |  6 +-
 .../reifier/WhenSkipSendToEndpointReifier.java     |  6 +-
 .../org/apache/camel/reifier/WireTapReifier.java   | 24 +++---
 .../reifier/dataformat/ASN1DataFormatReifier.java  |  5 +-
 .../reifier/dataformat/Any23DataFormatReifier.java |  5 +-
 .../reifier/dataformat/AvroDataFormatReifier.java  |  5 +-
 .../dataformat/BarcodeDataFormatReifier.java       |  5 +-
 .../dataformat/Base64DataFormatReifier.java        |  5 +-
 .../dataformat/BeanioDataFormatReifier.java        |  5 +-
 .../reifier/dataformat/BindyDataFormatReifier.java |  8 +-
 .../reifier/dataformat/CBORDataFormatReifier.java  |  5 +-
 .../dataformat/CryptoDataFormatReifier.java        |  5 +-
 .../reifier/dataformat/CsvDataFormatReifier.java   |  5 +-
 .../dataformat/CustomDataFormatReifier.java        |  6 +-
 .../reifier/dataformat/DataFormatReifier.java      | 27 +++---
 .../reifier/dataformat/FhirDataFormatReifier.java  |  5 +-
 .../dataformat/FhirJsonDataFormatReifier.java      |  5 +-
 .../dataformat/FhirXmlDataFormatReifier.java       |  5 +-
 .../dataformat/FlatpackDataFormatReifier.java      |  5 +-
 .../reifier/dataformat/GrokDataFormatReifier.java  |  5 +-
 .../reifier/dataformat/GzipDataFormatReifier.java  |  5 +-
 .../reifier/dataformat/HL7DataFormatReifier.java   |  5 +-
 .../reifier/dataformat/IcalDataFormatReifier.java  |  5 +-
 .../dataformat/JacksonXMLDataFormatReifier.java    |  5 +-
 .../reifier/dataformat/JaxbDataFormatReifier.java  |  5 +-
 .../dataformat/JsonApiDataFormatReifier.java       |  5 +-
 .../reifier/dataformat/JsonDataFormatReifier.java  |  5 +-
 .../reifier/dataformat/LZFDataFormatReifier.java   |  5 +-
 .../dataformat/MimeMultipartDataFormatReifier.java |  5 +-
 .../reifier/dataformat/PGPDataFormatReifier.java   |  5 +-
 .../dataformat/ProtobufDataFormatReifier.java      |  5 +-
 .../reifier/dataformat/RssDataFormatReifier.java   |  5 +-
 .../dataformat/SoapJaxbDataFormatReifier.java      |  5 +-
 .../dataformat/SyslogDataFormatReifier.java        |  5 +-
 .../dataformat/TarFileDataFormatReifier.java       |  5 +-
 .../dataformat/ThriftDataFormatReifier.java        |  5 +-
 .../dataformat/TidyMarkupDataFormatReifier.java    |  5 +-
 .../UniVocityAbstractDataFormatReifier.java        |  5 +-
 .../dataformat/UniVocityCsvDataFormatReifier.java  |  5 +-
 .../UniVocityFixedWidthDataFormatReifier.java      |  5 +-
 .../dataformat/UniVocityTsvDataFormatReifier.java  |  5 +-
 .../dataformat/XMLSecurityDataFormatReifier.java   |  5 +-
 .../dataformat/XStreamDataFormatReifier.java       |  5 +-
 .../dataformat/XmlRpcDataFormatReifier.java        |  5 +-
 .../reifier/dataformat/YAMLDataFormatReifier.java  |  5 +-
 .../reifier/dataformat/ZipDataFormatReifier.java   |  5 +-
 .../dataformat/ZipFileDataFormatReifier.java       |  5 +-
 .../errorhandler/DeadLetterChannelReifier.java     | 18 ++--
 .../errorhandler/DefaultErrorHandlerReifier.java   | 10 +--
 .../errorhandler/ErrorHandlerRefReifier.java       |  6 +-
 .../reifier/errorhandler/ErrorHandlerReifier.java  | 30 +++----
 .../errorhandler/NoErrorHandlerReifier.java        |  6 +-
 .../loadbalancer/CustomLoadBalancerReifier.java    |  8 +-
 .../loadbalancer/FailoverLoadBalancerReifier.java  | 14 ++--
 .../reifier/loadbalancer/LoadBalancerReifier.java  | 20 +++--
 .../loadbalancer/RandomLoadBalancerReifier.java    |  6 +-
 .../RoundRobinLoadBalancerReifier.java             |  6 +-
 .../loadbalancer/StickyLoadBalancerReifier.java    |  6 +-
 .../loadbalancer/TopicLoadBalancerReifier.java     |  6 +-
 .../loadbalancer/WeightedLoadBalancerReifier.java  | 10 +--
 .../camel/reifier/rest/RestBindingReifier.java     | 74 ++++++++--------
 .../camel/reifier/DataFormatReifierTest.java       |  4 +-
 .../apache/camel/reifier/ProcessorReifierTest.java |  7 +-
 .../apache/camel/support/CamelContextHelper.java   | 14 +++-
 140 files changed, 820 insertions(+), 736 deletions(-)

diff --git a/components/camel-cdi/src/main/java/org/apache/camel/cdi/transaction/JtaTransactionPolicy.java b/components/camel-cdi/src/main/java/org/apache/camel/cdi/transaction/JtaTransactionPolicy.java
index eaa00c6..e19d650 100644
--- a/components/camel-cdi/src/main/java/org/apache/camel/cdi/transaction/JtaTransactionPolicy.java
+++ b/components/camel-cdi/src/main/java/org/apache/camel/cdi/transaction/JtaTransactionPolicy.java
@@ -128,7 +128,7 @@ public abstract class JtaTransactionPolicy implements TransactedPolicy {
             ErrorHandlerBuilder builder) {
         JtaTransactionErrorHandler answer;
         try {
-            answer = (JtaTransactionErrorHandler) ErrorHandlerReifier.reifier(builder).createErrorHandler(routeContext, processor);
+            answer = (JtaTransactionErrorHandler) ErrorHandlerReifier.reifier(routeContext, builder).createErrorHandler(processor);
         } catch (Exception e) {
             throw RuntimeCamelException.wrapRuntimeCamelException(e);
         }
diff --git a/components/camel-hystrix/src/main/java/org/apache/camel/component/hystrix/processor/HystrixProcessorFactory.java b/components/camel-hystrix/src/main/java/org/apache/camel/component/hystrix/processor/HystrixProcessorFactory.java
index 0a06abb..bb12022 100644
--- a/components/camel-hystrix/src/main/java/org/apache/camel/component/hystrix/processor/HystrixProcessorFactory.java
+++ b/components/camel-hystrix/src/main/java/org/apache/camel/component/hystrix/processor/HystrixProcessorFactory.java
@@ -32,7 +32,7 @@ public class HystrixProcessorFactory extends TypedProcessorFactory<CircuitBreake
 
     @Override
     public Processor doCreateProcessor(RouteContext routeContext, CircuitBreakerDefinition definition) throws Exception {
-        return new HystrixReifier(definition).createProcessor(routeContext);
+        return new HystrixReifier(routeContext, definition).createProcessor();
     }
 
 }
diff --git a/components/camel-hystrix/src/main/java/org/apache/camel/component/hystrix/processor/HystrixReifier.java b/components/camel-hystrix/src/main/java/org/apache/camel/component/hystrix/processor/HystrixReifier.java
index ffd8eb0..ce3b6f6 100644
--- a/components/camel-hystrix/src/main/java/org/apache/camel/component/hystrix/processor/HystrixReifier.java
+++ b/components/camel-hystrix/src/main/java/org/apache/camel/component/hystrix/processor/HystrixReifier.java
@@ -43,20 +43,20 @@ import static org.apache.camel.support.CamelContextHelper.mandatoryLookup;
 
 public class HystrixReifier extends ProcessorReifier<CircuitBreakerDefinition> {
 
-    public HystrixReifier(CircuitBreakerDefinition definition) {
-        super(definition);
+    public HystrixReifier(RouteContext routeContext, CircuitBreakerDefinition definition) {
+        super(routeContext, definition);
     }
 
     @Override
-    public Processor createProcessor(RouteContext routeContext) throws Exception {
+    public Processor createProcessor() throws Exception {
         // create the regular and fallback processors
-        Processor processor = createChildProcessor(routeContext, true);
+        Processor processor = createChildProcessor(true);
         Processor fallback = null;
         if (definition.getOnFallback() != null) {
-            fallback = ProcessorReifier.reifier(definition.getOnFallback()).createProcessor(routeContext);
+            fallback = ProcessorReifier.reifier(routeContext, definition.getOnFallback()).createProcessor();
         }
 
-        final HystrixConfigurationDefinition config = buildHystrixConfiguration(routeContext.getCamelContext());
+        final HystrixConfigurationDefinition config = buildHystrixConfiguration();
         final String id = getId(definition, routeContext);
 
         // group and thread pool keys to use they can be configured on configRef and config, so look there first, and if none then use default
@@ -94,7 +94,7 @@ public class HystrixReifier extends ProcessorReifier<CircuitBreakerDefinition> {
 
         // create setter for fallback via network
         HystrixCommand.Setter fallbackSetter = null;
-        boolean fallbackViaNetwork = definition.getOnFallback() != null && parseBoolean(routeContext, definition.getOnFallback().getFallbackViaNetwork());
+        boolean fallbackViaNetwork = definition.getOnFallback() != null && parseBoolean(definition.getOnFallback().getFallbackViaNetwork());
         if (fallbackViaNetwork) {
             // use a different thread pool that is for fallback (should never use the same thread pool as the regular command)
             HystrixThreadPoolKey tpFallbackKey = HystrixThreadPoolKey.Factory.asKey(threadPoolKey + "-fallback");
@@ -211,7 +211,7 @@ public class HystrixReifier extends ProcessorReifier<CircuitBreakerDefinition> {
     // Helpers
     // *******************************
 
-    HystrixConfigurationDefinition buildHystrixConfiguration(CamelContext camelContext) throws Exception {
+    HystrixConfigurationDefinition buildHystrixConfiguration() throws Exception {
         Map<String, Object> properties = new HashMap<>();
 
         // Extract properties from default configuration, the one configured on
diff --git a/components/camel-hystrix/src/test/java/org/apache/camel/component/hystrix/processor/HystrixHierarchicalConfigTest.java b/components/camel-hystrix/src/test/java/org/apache/camel/component/hystrix/processor/HystrixHierarchicalConfigTest.java
index 0f1e0c4..11f8415 100644
--- a/components/camel-hystrix/src/test/java/org/apache/camel/component/hystrix/processor/HystrixHierarchicalConfigTest.java
+++ b/components/camel-hystrix/src/test/java/org/apache/camel/component/hystrix/processor/HystrixHierarchicalConfigTest.java
@@ -18,9 +18,11 @@ package org.apache.camel.component.hystrix.processor;
 
 import org.apache.camel.CamelContext;
 import org.apache.camel.impl.DefaultCamelContext;
+import org.apache.camel.impl.engine.DefaultRouteContext;
 import org.apache.camel.model.CircuitBreakerDefinition;
 import org.apache.camel.model.HystrixConfigurationDefinition;
 import org.apache.camel.model.Model;
+import org.apache.camel.spi.RouteContext;
 import org.apache.camel.support.SimpleRegistry;
 import org.junit.Assert;
 import org.junit.Test;
@@ -31,6 +33,7 @@ public class HystrixHierarchicalConfigTest {
     public void testRegistryConfiguration() throws Exception {
         final SimpleRegistry registry = new SimpleRegistry();
         final CamelContext context = new DefaultCamelContext(registry);
+        final RouteContext routeContext = new DefaultRouteContext(context, null, null);
 
         HystrixConfigurationDefinition def = new HystrixConfigurationDefinition();
         def.setGroupKey("global-group-key");
@@ -44,7 +47,7 @@ public class HystrixHierarchicalConfigTest {
         registry.bind(HystrixConstants.DEFAULT_HYSTRIX_CONFIGURATION_ID, def);
         registry.bind("ref-hystrix", ref);
 
-        final HystrixReifier reifier = new HystrixReifier(
+        final HystrixReifier reifier = new HystrixReifier(routeContext,
                 new CircuitBreakerDefinition()
                         .configuration("ref-hystrix")
                         .hystrixConfiguration()
@@ -52,7 +55,7 @@ public class HystrixHierarchicalConfigTest {
                         .requestLogEnabled(false)
                         .end()
         );
-        final HystrixConfigurationDefinition config = reifier.buildHystrixConfiguration(context);
+        final HystrixConfigurationDefinition config = reifier.buildHystrixConfiguration();
 
         Assert.assertEquals("local-conf-group-key", config.getGroupKey());
         Assert.assertEquals("global-thread-key", config.getThreadPoolKey());
@@ -62,6 +65,7 @@ public class HystrixHierarchicalConfigTest {
     @Test
     public void testContextConfiguration() throws Exception {
         final CamelContext context = new DefaultCamelContext();
+        final RouteContext routeContext = new DefaultRouteContext(context, null, null);
 
         HystrixConfigurationDefinition def = new HystrixConfigurationDefinition();
         def.setGroupKey("global-group-key");
@@ -75,7 +79,7 @@ public class HystrixHierarchicalConfigTest {
         context.getExtension(Model.class).setHystrixConfiguration(def);
         context.getExtension(Model.class).addHystrixConfiguration("ref-hystrix", ref);
 
-        final HystrixReifier reifier = new HystrixReifier(
+        final HystrixReifier reifier = new HystrixReifier(routeContext,
                 new CircuitBreakerDefinition()
                         .configuration("ref-hystrix")
                         .hystrixConfiguration()
@@ -83,7 +87,7 @@ public class HystrixHierarchicalConfigTest {
                         .requestLogEnabled(false)
                         .end()
         );
-        final HystrixConfigurationDefinition config = reifier.buildHystrixConfiguration(context);
+        final HystrixConfigurationDefinition config = reifier.buildHystrixConfiguration();
 
         Assert.assertEquals("local-conf-group-key", config.getGroupKey());
         Assert.assertEquals("global-thread-key", config.getThreadPoolKey());
@@ -94,6 +98,7 @@ public class HystrixHierarchicalConfigTest {
     public void testMixedConfiguration() throws Exception {
         final SimpleRegistry registry = new SimpleRegistry();
         final CamelContext context = new DefaultCamelContext(registry);
+        final RouteContext routeContext = new DefaultRouteContext(context, null, null);
 
         HystrixConfigurationDefinition def = new HystrixConfigurationDefinition();
         def.setGroupKey("global-group-key");
@@ -115,7 +120,7 @@ public class HystrixHierarchicalConfigTest {
         registry.bind(HystrixConstants.DEFAULT_HYSTRIX_CONFIGURATION_ID, defReg);
         registry.bind("ref-hystrix", ref);
 
-        final HystrixReifier reifier = new HystrixReifier(
+        final HystrixReifier reifier = new HystrixReifier(routeContext,
                 new CircuitBreakerDefinition()
                         .configuration("ref-hystrix")
                         .hystrixConfiguration()
@@ -123,7 +128,7 @@ public class HystrixHierarchicalConfigTest {
                         .requestLogEnabled(false)
                         .end()
         );
-        final HystrixConfigurationDefinition config = reifier.buildHystrixConfiguration(context);
+        final HystrixConfigurationDefinition config = reifier.buildHystrixConfiguration();
 
         Assert.assertEquals("local-conf-group-key", config.getGroupKey());
         Assert.assertEquals("global-thread-key", config.getThreadPoolKey());
diff --git a/components/camel-hystrix/src/test/java/org/apache/camel/component/hystrix/processor/SpringHystrixRouteHierarchicalConfigTest.java b/components/camel-hystrix/src/test/java/org/apache/camel/component/hystrix/processor/SpringHystrixRouteHierarchicalConfigTest.java
index 9a21244..b191a31 100644
--- a/components/camel-hystrix/src/test/java/org/apache/camel/component/hystrix/processor/SpringHystrixRouteHierarchicalConfigTest.java
+++ b/components/camel-hystrix/src/test/java/org/apache/camel/component/hystrix/processor/SpringHystrixRouteHierarchicalConfigTest.java
@@ -16,9 +16,12 @@
  */
 package org.apache.camel.component.hystrix.processor;
 
+import org.apache.camel.ExtendedCamelContext;
+import org.apache.camel.impl.engine.DefaultRouteContext;
 import org.apache.camel.model.CircuitBreakerDefinition;
 import org.apache.camel.model.HystrixConfigurationDefinition;
 import org.apache.camel.model.RouteDefinition;
+import org.apache.camel.spi.RouteContext;
 import org.apache.camel.test.spring.CamelSpringTestSupport;
 import org.junit.Assert;
 import org.junit.Test;
@@ -36,12 +39,14 @@ public class SpringHystrixRouteHierarchicalConfigTest extends CamelSpringTestSup
     @Test
     public void testHystrix() throws Exception {
         RouteDefinition routeDefinition = context.getRouteDefinition("hystrix-route");
+        final RouteContext routeContext = new DefaultRouteContext(context, routeDefinition,
+                routeDefinition.idOrCreate(context.adapt(ExtendedCamelContext.class).getNodeIdFactory()));
         CircuitBreakerDefinition hystrixDefinition = findCircuitBreakerDefinition(routeDefinition);
 
         Assert.assertNotNull(hystrixDefinition);
 
-        HystrixReifier reifier = new HystrixReifier(hystrixDefinition);
-        HystrixConfigurationDefinition config = reifier.buildHystrixConfiguration(context);
+        HystrixReifier reifier = new HystrixReifier(routeContext, hystrixDefinition);
+        HystrixConfigurationDefinition config = reifier.buildHystrixConfiguration();
 
         Assert.assertEquals("local-conf-group-key", config.getGroupKey());
         Assert.assertEquals("global-thread-key", config.getThreadPoolKey());
diff --git a/components/camel-resilience4j/src/main/java/org/apache/camel/component/resilience4j/ResilienceProcessorFactory.java b/components/camel-resilience4j/src/main/java/org/apache/camel/component/resilience4j/ResilienceProcessorFactory.java
index 03c0f22..bcf91c4 100644
--- a/components/camel-resilience4j/src/main/java/org/apache/camel/component/resilience4j/ResilienceProcessorFactory.java
+++ b/components/camel-resilience4j/src/main/java/org/apache/camel/component/resilience4j/ResilienceProcessorFactory.java
@@ -33,7 +33,7 @@ public class ResilienceProcessorFactory extends TypedProcessorFactory<CircuitBre
 
     @Override
     public Processor doCreateProcessor(RouteContext routeContext, CircuitBreakerDefinition definition) throws Exception {
-        return new ResilienceReifier(definition).createProcessor(routeContext);
+        return new ResilienceReifier(routeContext, definition).createProcessor();
     }
 
 }
diff --git a/components/camel-resilience4j/src/main/java/org/apache/camel/component/resilience4j/ResilienceReifier.java b/components/camel-resilience4j/src/main/java/org/apache/camel/component/resilience4j/ResilienceReifier.java
index 83d3f1f..ffefa52 100644
--- a/components/camel-resilience4j/src/main/java/org/apache/camel/component/resilience4j/ResilienceReifier.java
+++ b/components/camel-resilience4j/src/main/java/org/apache/camel/component/resilience4j/ResilienceReifier.java
@@ -46,19 +46,19 @@ import static org.apache.camel.support.CamelContextHelper.mandatoryLookup;
 
 public class ResilienceReifier extends ProcessorReifier<CircuitBreakerDefinition> {
 
-    public ResilienceReifier(CircuitBreakerDefinition definition) {
-        super(definition);
+    public ResilienceReifier(RouteContext routeContext, CircuitBreakerDefinition definition) {
+        super(routeContext, definition);
     }
 
     @Override
-    public Processor createProcessor(RouteContext routeContext) throws Exception {
+    public Processor createProcessor() throws Exception {
         // create the regular and fallback processors
-        Processor processor = createChildProcessor(routeContext, true);
+        Processor processor = createChildProcessor(true);
         Processor fallback = null;
         if (definition.getOnFallback() != null) {
-            fallback = ProcessorReifier.reifier(definition.getOnFallback()).createProcessor(routeContext);
+            fallback = ProcessorReifier.reifier(routeContext, definition.getOnFallback()).createProcessor();
         }
-        boolean fallbackViaNetwork = definition.getOnFallback() != null && parseBoolean(routeContext, definition.getOnFallback().getFallbackViaNetwork());
+        boolean fallbackViaNetwork = definition.getOnFallback() != null && parseBoolean(definition.getOnFallback().getFallbackViaNetwork());
         if (fallbackViaNetwork) {
             throw new UnsupportedOperationException("camel-resilience4j does not support onFallbackViaNetwork");
         }
diff --git a/components/camel-spring/src/main/java/org/apache/camel/spring/spi/SpringTransactionPolicy.java b/components/camel-spring/src/main/java/org/apache/camel/spring/spi/SpringTransactionPolicy.java
index 5699faf..cf87eeb 100644
--- a/components/camel-spring/src/main/java/org/apache/camel/spring/spi/SpringTransactionPolicy.java
+++ b/components/camel-spring/src/main/java/org/apache/camel/spring/spi/SpringTransactionPolicy.java
@@ -121,7 +121,7 @@ public class SpringTransactionPolicy implements TransactedPolicy {
     protected TransactionErrorHandler createTransactionErrorHandler(RouteContext routeContext, Processor processor, ErrorHandlerBuilder builder) {
         TransactionErrorHandler answer;
         try {
-            answer = (TransactionErrorHandler) ErrorHandlerReifier.reifier(builder).createErrorHandler(routeContext, processor);
+            answer = (TransactionErrorHandler) ErrorHandlerReifier.reifier(routeContext, builder).createErrorHandler(processor);
         } catch (Exception e) {
             throw RuntimeCamelException.wrapRuntimeCamelException(e);
         }
diff --git a/components/camel-spring/src/main/java/org/apache/camel/spring/spi/TransactionErrorHandlerReifier.java b/components/camel-spring/src/main/java/org/apache/camel/spring/spi/TransactionErrorHandlerReifier.java
index 85cce59..90210dc 100644
--- a/components/camel-spring/src/main/java/org/apache/camel/spring/spi/TransactionErrorHandlerReifier.java
+++ b/components/camel-spring/src/main/java/org/apache/camel/spring/spi/TransactionErrorHandlerReifier.java
@@ -18,6 +18,7 @@ package org.apache.camel.spring.spi;
 
 import java.util.Map;
 
+import org.apache.camel.CamelContext;
 import org.apache.camel.ErrorHandlerFactory;
 import org.apache.camel.Processor;
 import org.apache.camel.reifier.errorhandler.DefaultErrorHandlerReifier;
@@ -35,12 +36,12 @@ public class TransactionErrorHandlerReifier extends DefaultErrorHandlerReifier<T
 
     private static final Logger LOG = LoggerFactory.getLogger(TransactionErrorHandlerReifier.class);
 
-    public TransactionErrorHandlerReifier(ErrorHandlerFactory definition) {
-        super(definition);
+    public TransactionErrorHandlerReifier(RouteContext routeContext, ErrorHandlerFactory definition) {
+        super(routeContext, definition);
     }
 
     @Override
-    public Processor createErrorHandler(RouteContext routeContext, Processor processor) throws Exception {
+    public Processor createErrorHandler(Processor processor) throws Exception {
         TransactionTemplate transactionTemplate = definition.getTransactionTemplate();
         if (transactionTemplate == null) {
             // lookup in context if no transaction template has been configured
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/builder/ErrorHandlerBuilderRef.java b/core/camel-core-engine/src/main/java/org/apache/camel/builder/ErrorHandlerBuilderRef.java
index a041201..dacb845 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/builder/ErrorHandlerBuilderRef.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/builder/ErrorHandlerBuilderRef.java
@@ -37,7 +37,7 @@ public class ErrorHandlerBuilderRef extends ErrorHandlerBuilderSupport {
     @Override
     public Processor createErrorHandler(RouteContext routeContext, Processor processor) throws Exception {
         ErrorHandlerFactory handler = lookupErrorHandler(routeContext);
-        return ErrorHandlerReifier.reifier(handler).createErrorHandler(routeContext, processor);
+        return ErrorHandlerReifier.reifier(routeContext, handler).createErrorHandler(processor);
     }
 
     @Override
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/builder/ErrorHandlerBuilderSupport.java b/core/camel-core-engine/src/main/java/org/apache/camel/builder/ErrorHandlerBuilderSupport.java
index 8bb166f..aa41462 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/builder/ErrorHandlerBuilderSupport.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/builder/ErrorHandlerBuilderSupport.java
@@ -106,7 +106,7 @@ public abstract class ErrorHandlerBuilderSupport implements ErrorHandlerBuilder
     }
 
     protected static ExceptionPolicy toExceptionPolicy(OnExceptionDefinition exceptionType, RouteContext routeContext) {
-        return ErrorHandlerReifier.createExceptionPolicy(exceptionType, routeContext);
+        return ErrorHandlerReifier.createExceptionPolicy(exceptionType, routeContext.getCamelContext());
     }
 
     protected static List<Class<? extends Throwable>> createExceptionClasses(OnExceptionDefinition exceptionType, ClassResolver resolver) {
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/impl/AbstractModelCamelContext.java b/core/camel-core-engine/src/main/java/org/apache/camel/impl/AbstractModelCamelContext.java
index 1976101..15c5fa2 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/impl/AbstractModelCamelContext.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/impl/AbstractModelCamelContext.java
@@ -283,7 +283,7 @@ public abstract class AbstractModelCamelContext extends AbstractCamelContext imp
             String id = e.getKey();
             DataFormatDefinition def = e.getValue();
             LOG.debug("Creating Dataformat with id: {} and definition: {}", id, def);
-            DataFormat df = DataFormatReifier.reifier(def).createDataFormat(this);
+            DataFormat df = DataFormatReifier.reifier(this, def).createDataFormat();
             addService(df, true);
             getRegistry().bind(id, df);
         }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/impl/DefaultModel.java b/core/camel-core-engine/src/main/java/org/apache/camel/impl/DefaultModel.java
index f4463d9..ebcfe43 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/impl/DefaultModel.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/impl/DefaultModel.java
@@ -353,7 +353,7 @@ public class DefaultModel implements Model {
         try {
             String id = routeDefinition.idOrCreate(camelContext.adapt(ExtendedCamelContext.class).getNodeIdFactory());
             RouteContext routeContext = new DefaultRouteContext(camelContext, routeDefinition, id);
-            Route route = new RouteReifier(routeDefinition).createRoute(camelContext, routeContext);
+            Route route = new RouteReifier(routeContext, routeDefinition).createRoute();
             RouteService routeService = new RouteService(route);
             mcc.startRouteService(routeService, true);
         } finally {
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/AbstractReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/AbstractReifier.java
index dfc7b5a..cefcfab 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/AbstractReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/AbstractReifier.java
@@ -22,30 +22,38 @@ import org.apache.camel.support.CamelContextHelper;
 
 public abstract class AbstractReifier {
 
-    protected static String parseString(RouteContext routeContext, String text) {
-        return CamelContextHelper.parseText(routeContext.getCamelContext(), text);
+    protected final RouteContext routeContext;
+    protected final CamelContext camelContext;
+
+    public AbstractReifier(RouteContext routeContext) {
+        this.routeContext = routeContext;
+        this.camelContext = routeContext.getCamelContext();
     }
 
-    protected static boolean parseBoolean(RouteContext routeContext, String text) {
-        Boolean b = CamelContextHelper.parseBoolean(routeContext.getCamelContext(), text);
-        return b != null && b;
+    public AbstractReifier(CamelContext camelContext) {
+        this.routeContext = null;
+        this.camelContext = camelContext;
+    }
+
+    protected String parseString(String text) {
+        return CamelContextHelper.parseText(camelContext, text);
     }
 
-    protected static boolean parseBoolean(CamelContext camelContext, String text) {
+    protected boolean parseBoolean(String text) {
         Boolean b = CamelContextHelper.parseBoolean(camelContext, text);
         return b != null && b;
     }
 
-    protected static Long parseLong(RouteContext routeContext, String text) {
-        return CamelContextHelper.parseLong(routeContext.getCamelContext(), text);
+    protected Long parseLong(String text) {
+        return CamelContextHelper.parseLong(camelContext, text);
     }
 
-    protected static Integer parseInt(RouteContext routeContext, String text) {
-        return CamelContextHelper.parseInteger(routeContext.getCamelContext(), text);
+    protected Integer parseInt(String text) {
+        return CamelContextHelper.parseInteger(camelContext, text);
     }
 
-    protected static <T> T parse(RouteContext routeContext, Class<T> clazz, String text) {
-        return CamelContextHelper.parse(routeContext.getCamelContext(), clazz, text);
+    protected <T> T parse(Class<T> clazz, String text) {
+        return CamelContextHelper.parse(camelContext, clazz, text);
     }
 
 }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/AggregateReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/AggregateReifier.java
index 0a51722..defa9af 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/AggregateReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/AggregateReifier.java
@@ -20,6 +20,7 @@ import java.util.concurrent.ExecutorService;
 import java.util.concurrent.ScheduledExecutorService;
 
 import org.apache.camel.AggregationStrategy;
+import org.apache.camel.CamelContext;
 import org.apache.camel.CamelContextAware;
 import org.apache.camel.Expression;
 import org.apache.camel.Predicate;
@@ -35,30 +36,31 @@ import org.apache.camel.processor.aggregate.AggregationStrategyBeanAdapter;
 import org.apache.camel.processor.aggregate.OptimisticLockRetryPolicy;
 import org.apache.camel.spi.AggregationRepository;
 import org.apache.camel.spi.RouteContext;
+import org.apache.camel.support.CamelContextHelper;
 import org.apache.camel.util.concurrent.SynchronousExecutorService;
 
 public class AggregateReifier extends ProcessorReifier<AggregateDefinition> {
 
-    public AggregateReifier(ProcessorDefinition<?> definition) {
-        super(AggregateDefinition.class.cast(definition));
+    public AggregateReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, AggregateDefinition.class.cast(definition));
     }
 
     @Override
-    public Processor createProcessor(RouteContext routeContext) throws Exception {
-        return createAggregator(routeContext);
+    public Processor createProcessor() throws Exception {
+        return createAggregator();
     }
 
-    protected AggregateProcessor createAggregator(RouteContext routeContext) throws Exception {
-        Processor childProcessor = this.createChildProcessor(routeContext, true);
+    protected AggregateProcessor createAggregator() throws Exception {
+        Processor childProcessor = this.createChildProcessor(true);
 
         // wrap the aggregate route in a unit of work processor
-        CamelInternalProcessor internal = new CamelInternalProcessor(routeContext.getCamelContext(), childProcessor);
-        internal.addAdvice(new CamelInternalProcessor.UnitOfWorkProcessorAdvice(routeContext, routeContext.getCamelContext()));
+        CamelInternalProcessor internal = new CamelInternalProcessor(camelContext, childProcessor);
+        internal.addAdvice(new CamelInternalProcessor.UnitOfWorkProcessorAdvice(routeContext, camelContext));
 
         Expression correlation = definition.getExpression().createExpression(routeContext);
         AggregationStrategy strategy = createAggregationStrategy(routeContext);
 
-        boolean parallel = parseBoolean(routeContext, definition.getParallelProcessing());
+        boolean parallel = parseBoolean(definition.getParallelProcessing());
         boolean shutdownThreadPool = ProcessorDefinitionHelper.willCreateNewThreadPool(routeContext, definition, parallel);
         ExecutorService threadPool = ProcessorDefinitionHelper.getConfiguredExecutorService(routeContext, "Aggregator", definition, parallel);
         if (threadPool == null && !parallel) {
@@ -69,7 +71,7 @@ public class AggregateReifier extends ProcessorReifier<AggregateDefinition> {
             shutdownThreadPool = true;
         }
 
-        AggregateProcessor answer = new AggregateProcessor(routeContext.getCamelContext(), internal, correlation, strategy, threadPool, shutdownThreadPool);
+        AggregateProcessor answer = new AggregateProcessor(camelContext, internal, correlation, strategy, threadPool, shutdownThreadPool);
 
         AggregationRepository repository = createAggregationRepository(routeContext);
         if (repository != null) {
@@ -90,7 +92,7 @@ public class AggregateReifier extends ProcessorReifier<AggregateDefinition> {
             if (timeoutThreadPool == null) {
                 // then create a thread pool assuming the ref is a thread pool
                 // profile id
-                timeoutThreadPool = routeContext.getCamelContext().getExecutorServiceManager().newScheduledThreadPool(this, AggregateProcessor.AGGREGATE_TIMEOUT_CHECKER,
+                timeoutThreadPool = camelContext.getExecutorServiceManager().newScheduledThreadPool(this, AggregateProcessor.AGGREGATE_TIMEOUT_CHECKER,
                                                                                                                       definition.getTimeoutCheckerExecutorServiceRef());
                 if (timeoutThreadPool == null) {
                     throw new IllegalArgumentException("ExecutorServiceRef " + definition.getTimeoutCheckerExecutorServiceRef()
@@ -102,15 +104,15 @@ public class AggregateReifier extends ProcessorReifier<AggregateDefinition> {
         answer.setTimeoutCheckerExecutorService(timeoutThreadPool);
         answer.setShutdownTimeoutCheckerExecutorService(shutdownTimeoutThreadPool);
 
-        if (parseBoolean(routeContext, definition.getCompletionFromBatchConsumer())
-                && parseBoolean(routeContext, definition.getDiscardOnAggregationFailure())) {
+        if (parseBoolean(definition.getCompletionFromBatchConsumer())
+                && parseBoolean(definition.getDiscardOnAggregationFailure())) {
             throw new IllegalArgumentException("Cannot use both completionFromBatchConsumer and discardOnAggregationFailure on: " + definition);
         }
 
         // set other options
         answer.setParallelProcessing(parallel);
         if (definition.getOptimisticLocking() != null) {
-            answer.setOptimisticLocking(parseBoolean(routeContext, definition.getOptimisticLocking()));
+            answer.setOptimisticLocking(parseBoolean(definition.getOptimisticLocking()));
         }
         if (definition.getCompletionPredicate() != null) {
             Predicate predicate = definition.getCompletionPredicate().createPredicate(routeContext);
@@ -126,48 +128,48 @@ public class AggregateReifier extends ProcessorReifier<AggregateDefinition> {
             answer.setCompletionTimeoutExpression(expression);
         }
         if (definition.getCompletionTimeout() != null) {
-            answer.setCompletionTimeout(parseLong(routeContext, definition.getCompletionTimeout()));
+            answer.setCompletionTimeout(parseLong(definition.getCompletionTimeout()));
         }
         if (definition.getCompletionInterval() != null) {
-            answer.setCompletionInterval(parseLong(routeContext, definition.getCompletionInterval()));
+            answer.setCompletionInterval(parseLong(definition.getCompletionInterval()));
         }
         if (definition.getCompletionSizeExpression() != null) {
             Expression expression = definition.getCompletionSizeExpression().createExpression(routeContext);
             answer.setCompletionSizeExpression(expression);
         }
         if (definition.getCompletionSize() != null) {
-            answer.setCompletionSize(parseInt(routeContext, definition.getCompletionSize()));
+            answer.setCompletionSize(parseInt(definition.getCompletionSize()));
         }
         if (definition.getCompletionFromBatchConsumer() != null) {
-            answer.setCompletionFromBatchConsumer(parseBoolean(routeContext, definition.getCompletionFromBatchConsumer()));
+            answer.setCompletionFromBatchConsumer(parseBoolean(definition.getCompletionFromBatchConsumer()));
         }
         if (definition.getCompletionOnNewCorrelationGroup() != null) {
-            answer.setCompletionOnNewCorrelationGroup(parseBoolean(routeContext, definition.getCompletionOnNewCorrelationGroup()));
+            answer.setCompletionOnNewCorrelationGroup(parseBoolean(definition.getCompletionOnNewCorrelationGroup()));
         }
         if (definition.getEagerCheckCompletion() != null) {
-            answer.setEagerCheckCompletion(parseBoolean(routeContext, definition.getEagerCheckCompletion()));
+            answer.setEagerCheckCompletion(parseBoolean(definition.getEagerCheckCompletion()));
         }
         if (definition.getIgnoreInvalidCorrelationKeys() != null) {
-            answer.setIgnoreInvalidCorrelationKeys(parseBoolean(routeContext, definition.getIgnoreInvalidCorrelationKeys()));
+            answer.setIgnoreInvalidCorrelationKeys(parseBoolean(definition.getIgnoreInvalidCorrelationKeys()));
         }
         if (definition.getCloseCorrelationKeyOnCompletion() != null) {
-            answer.setCloseCorrelationKeyOnCompletion(parseInt(routeContext, definition.getCloseCorrelationKeyOnCompletion()));
+            answer.setCloseCorrelationKeyOnCompletion(parseInt(definition.getCloseCorrelationKeyOnCompletion()));
         }
         if (definition.getDiscardOnCompletionTimeout() != null) {
-            answer.setDiscardOnCompletionTimeout(parseBoolean(routeContext, definition.getDiscardOnCompletionTimeout()));
+            answer.setDiscardOnCompletionTimeout(parseBoolean(definition.getDiscardOnCompletionTimeout()));
         }
         if (definition.getDiscardOnAggregationFailure() != null) {
-            answer.setDiscardOnAggregationFailure(parseBoolean(routeContext, definition.getDiscardOnAggregationFailure()));
+            answer.setDiscardOnAggregationFailure(parseBoolean(definition.getDiscardOnAggregationFailure()));
         }
         if (definition.getForceCompletionOnStop() != null) {
-            answer.setForceCompletionOnStop(parseBoolean(routeContext, definition.getForceCompletionOnStop()));
+            answer.setForceCompletionOnStop(parseBoolean(definition.getForceCompletionOnStop()));
         }
         if (definition.getCompleteAllOnStop() != null) {
-            answer.setCompleteAllOnStop(parseBoolean(routeContext, definition.getCompleteAllOnStop()));
+            answer.setCompleteAllOnStop(parseBoolean(definition.getCompleteAllOnStop()));
         }
         if (definition.getOptimisticLockRetryPolicy() == null) {
             if (definition.getOptimisticLockRetryPolicyDefinition() != null) {
-                answer.setOptimisticLockRetryPolicy(createOptimisticLockRetryPolicy(routeContext, definition.getOptimisticLockRetryPolicyDefinition()));
+                answer.setOptimisticLockRetryPolicy(createOptimisticLockRetryPolicy(camelContext, definition.getOptimisticLockRetryPolicyDefinition()));
             }
         } else {
             answer.setOptimisticLockRetryPolicy(definition.getOptimisticLockRetryPolicy());
@@ -176,27 +178,27 @@ public class AggregateReifier extends ProcessorReifier<AggregateDefinition> {
             answer.setAggregateController(definition.getAggregateController());
         }
         if (definition.getCompletionTimeoutCheckerInterval() != null) {
-            answer.setCompletionTimeoutCheckerInterval(parseLong(routeContext, definition.getCompletionTimeoutCheckerInterval()));
+            answer.setCompletionTimeoutCheckerInterval(parseLong(definition.getCompletionTimeoutCheckerInterval()));
         }
         return answer;
     }
 
-    public static OptimisticLockRetryPolicy createOptimisticLockRetryPolicy(RouteContext routeContext, OptimisticLockRetryPolicyDefinition definition) {
+    public static OptimisticLockRetryPolicy createOptimisticLockRetryPolicy(CamelContext camelContext, OptimisticLockRetryPolicyDefinition definition) {
         OptimisticLockRetryPolicy policy = new OptimisticLockRetryPolicy();
         if (definition.getMaximumRetries() != null) {
-            policy.setMaximumRetries(parseInt(routeContext, definition.getMaximumRetries()));
+            policy.setMaximumRetries(CamelContextHelper.parseInt(camelContext, definition.getMaximumRetries()));
         }
         if (definition.getRetryDelay() != null) {
-            policy.setRetryDelay(parseLong(routeContext, definition.getRetryDelay()));
+            policy.setRetryDelay(CamelContextHelper.parseLong(camelContext, definition.getRetryDelay()));
         }
         if (definition.getMaximumRetryDelay() != null) {
-            policy.setMaximumRetryDelay(parseLong(routeContext, definition.getMaximumRetryDelay()));
+            policy.setMaximumRetryDelay(CamelContextHelper.parseLong(camelContext, definition.getMaximumRetryDelay()));
         }
         if (definition.getExponentialBackOff() != null) {
-            policy.setExponentialBackOff(parseBoolean(routeContext, definition.getExponentialBackOff()));
+            policy.setExponentialBackOff(CamelContextHelper.parseBoolean(camelContext, definition.getExponentialBackOff()));
         }
         if (definition.getRandomBackOff() != null) {
-            policy.setRandomBackOff(parseBoolean(routeContext, definition.getRandomBackOff()));
+            policy.setRandomBackOff(CamelContextHelper.parseBoolean(camelContext, definition.getRandomBackOff()));
         }
         return policy;
     }
@@ -224,7 +226,7 @@ public class AggregateReifier extends ProcessorReifier<AggregateDefinition> {
         }
 
         if (strategy instanceof CamelContextAware) {
-            ((CamelContextAware)strategy).setCamelContext(routeContext.getCamelContext());
+            ((CamelContextAware)strategy).setCamelContext(camelContext);
         }
 
         return strategy;
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/BeanReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/BeanReifier.java
index 8a21e51..934853b3 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/BeanReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/BeanReifier.java
@@ -28,14 +28,12 @@ import org.apache.camel.support.CamelContextHelper;
 
 public class BeanReifier extends ProcessorReifier<BeanDefinition> {
 
-    public BeanReifier(ProcessorDefinition<?> definition) {
-        super(BeanDefinition.class.cast(definition));
+    public BeanReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, BeanDefinition.class.cast(definition));
     }
 
     @Override
-    public Processor createProcessor(RouteContext routeContext) throws Exception {
-        CamelContext camelContext = routeContext.getCamelContext();
-
+    public Processor createProcessor() throws Exception {
         Object bean = definition.getBean();
         String ref = definition.getRef();
         String method = definition.getMethod();
@@ -49,7 +47,7 @@ public class BeanReifier extends ProcessorReifier<BeanDefinition> {
         // use singleton as default scope
         BeanScope scope = BeanScope.Singleton;
         if (definition.getScope() != null) {
-            scope = CamelContextHelper.parse(routeContext.getCamelContext(), BeanScope.class, definition.getScope());
+            scope = CamelContextHelper.parse(camelContext, BeanScope.class, definition.getScope());
         }
         return fac.createBeanProcessor(camelContext, bean, beanType, beanClass, ref, method, scope);
     }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/CatchReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/CatchReifier.java
index 718c30b..f8a9ae5 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/CatchReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/CatchReifier.java
@@ -30,15 +30,15 @@ import org.apache.camel.spi.RouteContext;
 
 public class CatchReifier extends ProcessorReifier<CatchDefinition> {
 
-    public CatchReifier(ProcessorDefinition<?> definition) {
-        super(CatchDefinition.class.cast(definition));
+    public CatchReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, CatchDefinition.class.cast(definition));
     }
 
     @Override
-    public CatchProcessor createProcessor(RouteContext routeContext) throws Exception {
+    public CatchProcessor createProcessor() throws Exception {
         // create and load exceptions if not done
         if (definition.getExceptionClasses() == null) {
-            definition.setExceptionClasses(createExceptionClasses(routeContext.getCamelContext()));
+            definition.setExceptionClasses(createExceptionClasses(camelContext));
         }
 
         // must have at least one exception
@@ -52,7 +52,7 @@ public class CatchReifier extends ProcessorReifier<CatchDefinition> {
         }
 
         // do catch does not mandate a child processor
-        Processor childProcessor = this.createChildProcessor(routeContext, false);
+        Processor childProcessor = this.createChildProcessor(false);
 
         Predicate when = null;
         if (definition.getOnWhen() != null) {
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ChoiceReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ChoiceReifier.java
index be1d918..65ba33f 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ChoiceReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ChoiceReifier.java
@@ -34,12 +34,12 @@ import org.apache.camel.spi.RouteContext;
 
 public class ChoiceReifier extends ProcessorReifier<ChoiceDefinition> {
 
-    public ChoiceReifier(ProcessorDefinition<?> definition) {
-        super(ChoiceDefinition.class.cast(definition));
+    public ChoiceReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, ChoiceDefinition.class.cast(definition));
     }
 
     @Override
-    public Processor createProcessor(RouteContext routeContext) throws Exception {
+    public Processor createProcessor() throws Exception {
         List<FilterProcessor> filters = new ArrayList<>();
         for (WhenDefinition whenClause : definition.getWhenClauses()) {
             ExpressionDefinition exp = whenClause.getExpression();
@@ -70,15 +70,15 @@ public class ChoiceReifier extends ProcessorReifier<ChoiceDefinition> {
             // expressions in the when clauses
             if (exp != null) {
                 // resolve properties before we create the processor
-                ProcessorDefinitionHelper.resolvePropertyPlaceholders(routeContext.getCamelContext(), exp);
+                ProcessorDefinitionHelper.resolvePropertyPlaceholders(camelContext, exp);
             }
 
-            FilterProcessor filter = (FilterProcessor)createProcessor(routeContext, whenClause);
+            FilterProcessor filter = (FilterProcessor)createProcessor(whenClause);
             filters.add(filter);
         }
         Processor otherwiseProcessor = null;
         if (definition.getOtherwise() != null) {
-            otherwiseProcessor = createProcessor(routeContext, definition.getOtherwise());
+            otherwiseProcessor = createProcessor(definition.getOtherwise());
         }
         return new ChoiceProcessor(filters, otherwiseProcessor);
     }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/CircuitBreakerReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/CircuitBreakerReifier.java
index 830b0e7..40cea74 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/CircuitBreakerReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/CircuitBreakerReifier.java
@@ -23,12 +23,12 @@ import org.apache.camel.spi.RouteContext;
 
 public class CircuitBreakerReifier extends ProcessorReifier<CircuitBreakerDefinition> {
 
-    public CircuitBreakerReifier(ProcessorDefinition<?> definition) {
-        super(CircuitBreakerDefinition.class.cast(definition));
+    public CircuitBreakerReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, CircuitBreakerDefinition.class.cast(definition));
     }
 
     @Override
-    public Processor createProcessor(RouteContext routeContext) throws Exception {
+    public Processor createProcessor() throws Exception {
         throw new IllegalStateException("Cannot find camel-hystrix or camel-microprofile-fault-tolerance on the classpath.");
     }
 
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ClaimCheckReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ClaimCheckReifier.java
index 09368f5..a9c5328 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ClaimCheckReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ClaimCheckReifier.java
@@ -31,16 +31,16 @@ import static org.apache.camel.util.ObjectHelper.notNull;
 
 public class ClaimCheckReifier extends ProcessorReifier<ClaimCheckDefinition> {
 
-    public ClaimCheckReifier(ProcessorDefinition<?> definition) {
-        super(ClaimCheckDefinition.class.cast(definition));
+    public ClaimCheckReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, ClaimCheckDefinition.class.cast(definition));
     }
 
     @Override
-    public Processor createProcessor(RouteContext routeContext) throws Exception {
+    public Processor createProcessor() throws Exception {
         notNull(definition.getOperation(), "operation", this);
 
         ClaimCheckProcessor claim = new ClaimCheckProcessor();
-        claim.setOperation(parse(routeContext, ClaimCheckOperation.class, definition.getOperation()).name());
+        claim.setOperation(parse(ClaimCheckOperation.class, definition.getOperation()).name());
         claim.setKey(definition.getKey());
         claim.setFilter(definition.getFilter());
 
@@ -115,7 +115,7 @@ public class ClaimCheckReifier extends ProcessorReifier<ClaimCheckDefinition> {
         }
 
         if (strategy instanceof CamelContextAware) {
-            ((CamelContextAware)strategy).setCamelContext(routeContext.getCamelContext());
+            ((CamelContextAware)strategy).setCamelContext(camelContext);
         }
 
         return strategy;
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ConvertBodyReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ConvertBodyReifier.java
index 3ccccf2..2e8be47 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ConvertBodyReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ConvertBodyReifier.java
@@ -27,14 +27,14 @@ import org.apache.camel.spi.RouteContext;
 
 public class ConvertBodyReifier extends ProcessorReifier<ConvertBodyDefinition> {
 
-    public ConvertBodyReifier(ProcessorDefinition<?> definition) {
-        super(ConvertBodyDefinition.class.cast(definition));
+    public ConvertBodyReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, ConvertBodyDefinition.class.cast(definition));
     }
 
     @Override
-    public Processor createProcessor(RouteContext routeContext) throws Exception {
+    public Processor createProcessor() throws Exception {
         if (definition.getTypeClass() == null && definition.getType() != null) {
-            definition.setTypeClass(routeContext.getCamelContext().getClassResolver().resolveMandatoryClass(definition.getType()));
+            definition.setTypeClass(camelContext.getClassResolver().resolveMandatoryClass(definition.getType()));
         }
 
         // validate charset
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/DelayReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/DelayReifier.java
index c2ff2a2..044069b 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/DelayReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/DelayReifier.java
@@ -29,20 +29,20 @@ import org.apache.camel.spi.RouteContext;
 
 public class DelayReifier extends ExpressionReifier<DelayDefinition> {
 
-    public DelayReifier(ProcessorDefinition<?> definition) {
-        super(DelayDefinition.class.cast(definition));
+    public DelayReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, DelayDefinition.class.cast(definition));
     }
 
     @Override
-    public Processor createProcessor(RouteContext routeContext) throws Exception {
-        Processor childProcessor = this.createChildProcessor(routeContext, false);
+    public Processor createProcessor() throws Exception {
+        Processor childProcessor = this.createChildProcessor(false);
         Expression delay = createAbsoluteTimeDelayExpression(routeContext);
 
         boolean async = definition.getAsyncDelayed() == null || Boolean.parseBoolean(definition.getAsyncDelayed());
         boolean shutdownThreadPool = ProcessorDefinitionHelper.willCreateNewThreadPool(routeContext, definition, async);
         ScheduledExecutorService threadPool = ProcessorDefinitionHelper.getConfiguredScheduledExecutorService(routeContext, "Delay", definition, async);
 
-        Delayer answer = new Delayer(routeContext.getCamelContext(), childProcessor, delay, threadPool, shutdownThreadPool);
+        Delayer answer = new Delayer(camelContext, childProcessor, delay, threadPool, shutdownThreadPool);
         answer.setAsyncDelayed(async);
         answer.setCallerRunsWhenRejected(definition.getCallerRunsWhenRejected() == null
                 || Boolean.parseBoolean(definition.getCallerRunsWhenRejected()));
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/DynamicRouterReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/DynamicRouterReifier.java
index c19d5b8..0acf744 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/DynamicRouterReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/DynamicRouterReifier.java
@@ -28,16 +28,16 @@ import org.apache.camel.spi.RouteContext;
 
 public class DynamicRouterReifier extends ExpressionReifier<DynamicRouterDefinition<?>> {
 
-    public DynamicRouterReifier(ProcessorDefinition<?> definition) {
-        super(DynamicRouterDefinition.class.cast(definition));
+    public DynamicRouterReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, DynamicRouterDefinition.class.cast(definition));
     }
 
     @Override
-    public Processor createProcessor(RouteContext routeContext) throws Exception {
+    public Processor createProcessor() throws Exception {
         Expression expression = definition.getExpression().createExpression(routeContext);
         String delimiter = definition.getUriDelimiter() != null ? definition.getUriDelimiter() : DynamicRouterDefinition.DEFAULT_DELIMITER;
 
-        DynamicRouter dynamicRouter = new DynamicRouter(routeContext.getCamelContext(), expression, delimiter);
+        DynamicRouter dynamicRouter = new DynamicRouter(camelContext, expression, delimiter);
         if (definition.getIgnoreInvalidEndpoints() != null) {
             dynamicRouter.setIgnoreInvalidEndpoints(Boolean.parseBoolean(definition.getIgnoreInvalidEndpoints()));
         }
@@ -50,7 +50,7 @@ public class DynamicRouterReifier extends ExpressionReifier<DynamicRouterDefinit
         // create error handler (create error handler directly to keep it light
         // weight,
         // instead of using ProcessorReifier.wrapInErrorHandler)
-        AsyncProcessor errorHandler = (AsyncProcessor)ErrorHandlerReifier.reifier(builder).createErrorHandler(routeContext, dynamicRouter.newRoutingSlipProcessorForErrorHandler());
+        AsyncProcessor errorHandler = (AsyncProcessor)ErrorHandlerReifier.reifier(routeContext, builder).createErrorHandler(dynamicRouter.newRoutingSlipProcessorForErrorHandler());
         dynamicRouter.setErrorHandler(errorHandler);
 
         return dynamicRouter;
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/EnrichReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/EnrichReifier.java
index f72cfd7..2263a8f 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/EnrichReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/EnrichReifier.java
@@ -28,12 +28,12 @@ import org.apache.camel.spi.RouteContext;
 
 public class EnrichReifier extends ExpressionReifier<EnrichDefinition> {
 
-    public EnrichReifier(ProcessorDefinition<?> definition) {
-        super(EnrichDefinition.class.cast(definition));
+    public EnrichReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, EnrichDefinition.class.cast(definition));
     }
 
     @Override
-    public Processor createProcessor(RouteContext routeContext) throws Exception {
+    public Processor createProcessor() throws Exception {
         Expression exp = definition.getExpression().createExpression(routeContext);
         boolean isShareUnitOfWork = definition.getShareUnitOfWork() != null && Boolean.parseBoolean(definition.getShareUnitOfWork());
         boolean isIgnoreInvalidEndpoint = definition.getIgnoreInvalidEndpoint() != null && Boolean.parseBoolean(definition.getIgnoreInvalidEndpoint());
@@ -41,7 +41,7 @@ public class EnrichReifier extends ExpressionReifier<EnrichDefinition> {
         Enricher enricher = new Enricher(exp);
         enricher.setShareUnitOfWork(isShareUnitOfWork);
         enricher.setIgnoreInvalidEndpoint(isIgnoreInvalidEndpoint);
-        AggregationStrategy strategy = createAggregationStrategy(routeContext);
+        AggregationStrategy strategy = createAggregationStrategy();
         if (strategy != null) {
             enricher.setAggregationStrategy(strategy);
         }
@@ -52,7 +52,7 @@ public class EnrichReifier extends ExpressionReifier<EnrichDefinition> {
         return enricher;
     }
 
-    private AggregationStrategy createAggregationStrategy(RouteContext routeContext) {
+    private AggregationStrategy createAggregationStrategy() {
         AggregationStrategy strategy = definition.getAggregationStrategy();
         if (strategy == null && definition.getAggregationStrategyRef() != null) {
             Object aggStrategy = routeContext.lookup(definition.getAggregationStrategyRef(), Object.class);
@@ -71,7 +71,7 @@ public class EnrichReifier extends ExpressionReifier<EnrichDefinition> {
         }
 
         if (strategy instanceof CamelContextAware) {
-            ((CamelContextAware)strategy).setCamelContext(routeContext.getCamelContext());
+            ((CamelContextAware)strategy).setCamelContext(camelContext);
         }
 
         return strategy;
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ExpressionReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ExpressionReifier.java
index ab284b3..c70744e 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ExpressionReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ExpressionReifier.java
@@ -24,8 +24,8 @@ import org.apache.camel.spi.RouteContext;
 
 abstract class ExpressionReifier<T extends ExpressionNode> extends ProcessorReifier<T> {
 
-    protected ExpressionReifier(T definition) {
-        super(definition);
+    protected ExpressionReifier(RouteContext routeContext, T definition) {
+        super(routeContext, definition);
     }
 
     /**
@@ -36,7 +36,7 @@ abstract class ExpressionReifier<T extends ExpressionNode> extends ProcessorReif
      * @throws Exception is thrown if error creating the processor
      */
     protected FilterProcessor createFilterProcessor(RouteContext routeContext) throws Exception {
-        Processor childProcessor = createOutputsProcessor(routeContext);
+        Processor childProcessor = createOutputsProcessor();
         return new FilterProcessor(createPredicate(routeContext), childProcessor);
     }
 
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/FilterReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/FilterReifier.java
index 0d3200f..f18fe37 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/FilterReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/FilterReifier.java
@@ -24,19 +24,19 @@ import org.apache.camel.spi.RouteContext;
 
 public class FilterReifier extends ExpressionReifier<FilterDefinition> {
 
-    public FilterReifier(ProcessorDefinition<?> definition) {
-        super(FilterDefinition.class.cast(definition));
+    public FilterReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, FilterDefinition.class.cast(definition));
     }
 
     @Override
-    public FilterProcessor createProcessor(RouteContext routeContext) throws Exception {
+    public FilterProcessor createProcessor() throws Exception {
         return createFilterProcessor(routeContext);
     }
 
     @Override
     protected FilterProcessor createFilterProcessor(RouteContext routeContext) throws Exception {
         // filter EIP should have child outputs
-        Processor childProcessor = this.createChildProcessor(routeContext, true);
+        Processor childProcessor = this.createChildProcessor(true);
         return new FilterProcessor(createPredicate(routeContext), childProcessor);
     }
 
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/FinallyReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/FinallyReifier.java
index 546ab18..a97d7e2 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/FinallyReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/FinallyReifier.java
@@ -25,19 +25,19 @@ import org.apache.camel.spi.RouteContext;
 
 public class FinallyReifier extends ProcessorReifier<FinallyDefinition> {
 
-    public FinallyReifier(ProcessorDefinition<?> definition) {
-        super(FinallyDefinition.class.cast(definition));
+    public FinallyReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, FinallyDefinition.class.cast(definition));
     }
 
     @Override
-    public Processor createProcessor(RouteContext routeContext) throws Exception {
+    public Processor createProcessor() throws Exception {
         // parent must be a try
         if (!(definition.getParent() instanceof TryDefinition)) {
             throw new IllegalArgumentException("This doFinally should have a doTry as its parent on " + definition);
         }
 
         // do finally does mandate a child processor
-        return new FinallyProcessor(this.createChildProcessor(routeContext, false));
+        return new FinallyProcessor(this.createChildProcessor(false));
     }
 
 }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/IdempotentConsumerReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/IdempotentConsumerReifier.java
index c1b2c3a..6651036 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/IdempotentConsumerReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/IdempotentConsumerReifier.java
@@ -27,13 +27,13 @@ import org.apache.camel.util.ObjectHelper;
 
 public class IdempotentConsumerReifier extends ExpressionReifier<IdempotentConsumerDefinition> {
 
-    public IdempotentConsumerReifier(ProcessorDefinition<?> definition) {
-        super(IdempotentConsumerDefinition.class.cast(definition));
+    public IdempotentConsumerReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, IdempotentConsumerDefinition.class.cast(definition));
     }
 
     @Override
-    public Processor createProcessor(RouteContext routeContext) throws Exception {
-        Processor childProcessor = this.createChildProcessor(routeContext, true);
+    public Processor createProcessor() throws Exception {
+        Processor childProcessor = this.createChildProcessor(true);
 
         IdempotentRepository idempotentRepository = resolveMessageIdRepository(routeContext);
         ObjectHelper.notNull(idempotentRepository, "idempotentRepository", definition);
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/InterceptFromReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/InterceptFromReifier.java
index dd2d052..181a57d 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/InterceptFromReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/InterceptFromReifier.java
@@ -26,13 +26,13 @@ import org.apache.camel.support.ExpressionAdapter;
 
 public class InterceptFromReifier extends InterceptReifier<InterceptFromDefinition> {
 
-    public InterceptFromReifier(ProcessorDefinition<?> definition) {
-        super(definition);
+    public InterceptFromReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, definition);
     }
 
     @Override
     @SuppressWarnings({"unchecked", "rawtypes"})
-    public Processor createProcessor(RouteContext routeContext) throws Exception {
+    public Processor createProcessor() throws Exception {
         // insert a set header definition so we can set the intercepted endpoint
         // uri as a header
         // this allows us to use the same header for both the interceptFrom and
@@ -52,7 +52,7 @@ public class InterceptFromReifier extends InterceptReifier<InterceptFromDefiniti
         });
         definition.getOutputs().add(0, headerDefinition);
 
-        return this.createChildProcessor(routeContext, true);
+        return this.createChildProcessor(true);
     }
 
 }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/InterceptReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/InterceptReifier.java
index 93c0e11..7caa191 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/InterceptReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/InterceptReifier.java
@@ -28,14 +28,14 @@ import org.apache.camel.spi.RouteContext;
 
 public class InterceptReifier<T extends InterceptDefinition> extends ProcessorReifier<T> {
 
-    public InterceptReifier(ProcessorDefinition<?> definition) {
-        super((T)definition);
+    public InterceptReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, (T) definition);
     }
 
     @Override
-    public Processor createProcessor(final RouteContext routeContext) throws Exception {
+    public Processor createProcessor() throws Exception {
         // create the output processor
-        Processor output = this.createChildProcessor(routeContext, true);
+        Processor output = this.createChildProcessor(true);
 
         // add the output as a intercept strategy to the route context so its
         // invoked on each processing step
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/InterceptSendToEndpointReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/InterceptSendToEndpointReifier.java
index 847890f..d3282bf 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/InterceptSendToEndpointReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/InterceptSendToEndpointReifier.java
@@ -35,42 +35,42 @@ import org.apache.camel.util.URISupport;
 
 public class InterceptSendToEndpointReifier extends ProcessorReifier<InterceptSendToEndpointDefinition> {
 
-    public InterceptSendToEndpointReifier(ProcessorDefinition<?> definition) {
-        super((InterceptSendToEndpointDefinition)definition);
+    public InterceptSendToEndpointReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, (InterceptSendToEndpointDefinition) definition);
     }
 
     @Override
-    public Processor createProcessor(final RouteContext routeContext) throws Exception {
+    public Processor createProcessor() throws Exception {
         // create the before
-        final Processor before = this.createChildProcessor(routeContext, true);
+        final Processor before = this.createChildProcessor(true);
         // create the after
         Processor afterProcessor = null;
         if (definition.getAfterUri() != null) {
-            ToDefinition to = new ToDefinition(parseString(routeContext, definition.getAfterUri()));
+            ToDefinition to = new ToDefinition(parseString(definition.getAfterUri()));
             // at first use custom factory
-            if (routeContext.getCamelContext().adapt(ExtendedCamelContext.class).getProcessorFactory() != null) {
-                afterProcessor = routeContext.getCamelContext().adapt(ExtendedCamelContext.class).getProcessorFactory().createProcessor(routeContext, to);
+            if (camelContext.adapt(ExtendedCamelContext.class).getProcessorFactory() != null) {
+                afterProcessor = camelContext.adapt(ExtendedCamelContext.class).getProcessorFactory().createProcessor(routeContext, to);
             }
             // fallback to default implementation if factory did not create the
             // processor
             if (afterProcessor == null) {
-                afterProcessor = reifier(to).createProcessor(routeContext);
+                afterProcessor = reifier(routeContext, to).createProcessor();
             }
         }
         final Processor after = afterProcessor;
-        final String matchURI = parseString(routeContext, definition.getUri());
+        final String matchURI = parseString(definition.getUri());
 
         // register endpoint callback so we can proxy the endpoint
-        routeContext.getCamelContext().adapt(ExtendedCamelContext.class).registerEndpointCallback(new EndpointStrategy() {
+        camelContext.adapt(ExtendedCamelContext.class).registerEndpointCallback(new EndpointStrategy() {
             public Endpoint registerEndpoint(String uri, Endpoint endpoint) {
                 if (endpoint instanceof DefaultInterceptSendToEndpoint) {
                     // endpoint already decorated
                     return endpoint;
-                } else if (matchURI == null || matchPattern(routeContext.getCamelContext(), uri, matchURI)) {
+                } else if (matchURI == null || matchPattern(camelContext, uri, matchURI)) {
                     // only proxy if the uri is matched decorate endpoint with
                     // our proxy
                     // should be false by default
-                    boolean skip = definition.getSkipSendToOriginalEndpoint() != null && parseBoolean(routeContext, definition.getSkipSendToOriginalEndpoint());
+                    boolean skip = definition.getSkipSendToOriginalEndpoint() != null && parseBoolean(definition.getSkipSendToOriginalEndpoint());
                     DefaultInterceptSendToEndpoint proxy = new DefaultInterceptSendToEndpoint(endpoint, skip);
                     proxy.setBefore(before);
                     proxy.setAfter(after);
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/LoadBalanceReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/LoadBalanceReifier.java
index ed049a7..0ed74e3 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/LoadBalanceReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/LoadBalanceReifier.java
@@ -27,19 +27,19 @@ import org.apache.camel.spi.RouteContext;
 
 public class LoadBalanceReifier extends ProcessorReifier<LoadBalanceDefinition> {
 
-    public LoadBalanceReifier(ProcessorDefinition<?> definition) {
-        super((LoadBalanceDefinition)definition);
+    public LoadBalanceReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, (LoadBalanceDefinition)definition);
     }
 
     @Override
-    public Processor createProcessor(RouteContext routeContext) throws Exception {
+    public Processor createProcessor() throws Exception {
         // the load balancer is stateful so we should only create it once in
         // case its used from a context scoped error handler
 
         LoadBalancer loadBalancer = definition.getLoadBalancerType().getLoadBalancer();
         if (loadBalancer == null) {
             // then create it and reuse it
-            loadBalancer = LoadBalancerReifier.reifier(definition.getLoadBalancerType()).createLoadBalancer(routeContext);
+            loadBalancer = LoadBalancerReifier.reifier(routeContext, definition.getLoadBalancerType()).createLoadBalancer();
             definition.getLoadBalancerType().setLoadBalancer(loadBalancer);
 
             // some load balancer can only support a fixed number of outputs
@@ -57,7 +57,7 @@ public class LoadBalanceReifier extends ProcessorReifier<LoadBalanceDefinition>
                 if (LoadBalanceDefinition.class.isInstance(processorType)) {
                     throw new IllegalArgumentException("Loadbalancer already configured to: " + definition.getLoadBalancerType() + ". Cannot set it to: " + processorType);
                 }
-                Processor processor = createProcessor(routeContext, processorType);
+                Processor processor = createProcessor(processorType);
                 Channel channel = wrapChannel(routeContext, processor, processorType);
                 loadBalancer.addProcessor(channel);
             }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/LogReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/LogReifier.java
index 28bc849..db911ac 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/LogReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/LogReifier.java
@@ -38,23 +38,23 @@ import org.slf4j.LoggerFactory;
 
 public class LogReifier extends ProcessorReifier<LogDefinition> {
 
-    public LogReifier(ProcessorDefinition<?> definition) {
-        super((LogDefinition)definition);
+    public LogReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, (LogDefinition)definition);
     }
 
     @Override
-    public Processor createProcessor(RouteContext routeContext) throws Exception {
+    public Processor createProcessor() throws Exception {
         StringHelper.notEmpty(definition.getMessage(), "message", this);
 
         // use simple language for the message string to give it more power
-        Expression exp = routeContext.getCamelContext().resolveLanguage("simple").createExpression(definition.getMessage());
+        Expression exp = camelContext.resolveLanguage("simple").createExpression(definition.getMessage());
 
         // get logger explicitely set in the definition
         Logger logger = definition.getLogger();
 
         // get logger which may be set in XML definition
         if (logger == null && ObjectHelper.isNotEmpty(definition.getLoggerRef())) {
-            logger = CamelContextHelper.mandatoryLookup(routeContext.getCamelContext(), definition.getLoggerRef(), Logger.class);
+            logger = CamelContextHelper.mandatoryLookup(camelContext, definition.getLoggerRef(), Logger.class);
         }
 
         if (logger == null) {
@@ -73,7 +73,7 @@ public class LogReifier extends ProcessorReifier<LogDefinition> {
         if (logger == null) {
             String name = definition.getLogName();
             if (name == null) {
-                name = routeContext.getCamelContext().getGlobalOption(Exchange.LOG_EIP_NAME);
+                name = camelContext.getGlobalOption(Exchange.LOG_EIP_NAME);
                 if (name != null) {
                     log.debug("Using logName from CamelContext properties: {}", name);
                 }
@@ -86,10 +86,10 @@ public class LogReifier extends ProcessorReifier<LogDefinition> {
         }
 
         // should be INFO by default
-        LoggingLevel level = definition.getLoggingLevel() != null ? parse(routeContext, LoggingLevel.class, definition.getLoggingLevel()) : LoggingLevel.INFO;
+        LoggingLevel level = definition.getLoggingLevel() != null ? parse(LoggingLevel.class, definition.getLoggingLevel()) : LoggingLevel.INFO;
         CamelLogger camelLogger = new CamelLogger(logger, level, definition.getMarker());
 
-        return new LogProcessor(exp, camelLogger, getMaskingFormatter(routeContext), routeContext.getCamelContext().adapt(ExtendedCamelContext.class).getLogListeners());
+        return new LogProcessor(exp, camelLogger, getMaskingFormatter(routeContext), camelContext.adapt(ExtendedCamelContext.class).getLogListeners());
     }
 
     private MaskingFormatter getMaskingFormatter(RouteContext routeContext) {
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/LoopReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/LoopReifier.java
index 464599a..477d4be 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/LoopReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/LoopReifier.java
@@ -26,15 +26,15 @@ import org.apache.camel.spi.RouteContext;
 
 public class LoopReifier extends ExpressionReifier<LoopDefinition> {
 
-    public LoopReifier(ProcessorDefinition<?> definition) {
-        super((LoopDefinition)definition);
+    public LoopReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, (LoopDefinition)definition);
     }
 
     @Override
-    public Processor createProcessor(RouteContext routeContext) throws Exception {
-        Processor output = this.createChildProcessor(routeContext, true);
-        boolean isCopy = definition.getCopy() != null && parseBoolean(routeContext, definition.getCopy());
-        boolean isWhile = definition.getDoWhile() != null && parseBoolean(routeContext, definition.getDoWhile());
+    public Processor createProcessor() throws Exception {
+        Processor output = this.createChildProcessor(true);
+        boolean isCopy = definition.getCopy() != null && parseBoolean(definition.getCopy());
+        boolean isWhile = definition.getDoWhile() != null && parseBoolean(definition.getDoWhile());
 
         Predicate predicate = null;
         Expression expression = null;
@@ -43,7 +43,7 @@ public class LoopReifier extends ExpressionReifier<LoopDefinition> {
         } else {
             expression = definition.getExpression().createExpression(routeContext);
         }
-        return new LoopProcessor(routeContext.getCamelContext(), output, expression, predicate, isCopy);
+        return new LoopProcessor(camelContext, output, expression, predicate, isCopy);
     }
 
 }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/MarshalReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/MarshalReifier.java
index 58b6c80..b4fb614 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/MarshalReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/MarshalReifier.java
@@ -26,13 +26,13 @@ import org.apache.camel.support.processor.MarshalProcessor;
 
 public class MarshalReifier extends ProcessorReifier<MarshalDefinition> {
 
-    public MarshalReifier(ProcessorDefinition<?> definition) {
-        super((MarshalDefinition)definition);
+    public MarshalReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, (MarshalDefinition) definition);
     }
 
     @Override
-    public Processor createProcessor(RouteContext routeContext) {
-        DataFormat dataFormat = DataFormatReifier.getDataFormat(routeContext.getCamelContext(), definition.getDataFormatType(), null);
+    public Processor createProcessor() {
+        DataFormat dataFormat = DataFormatReifier.getDataFormat(camelContext, definition.getDataFormatType(), null);
         return new MarshalProcessor(dataFormat);
     }
 
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/MulticastReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/MulticastReifier.java
index 4dd6d2a..71a7b4c 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/MulticastReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/MulticastReifier.java
@@ -35,53 +35,53 @@ import org.apache.camel.support.CamelContextHelper;
 
 public class MulticastReifier extends ProcessorReifier<MulticastDefinition> {
 
-    public MulticastReifier(ProcessorDefinition<?> definition) {
-        super((MulticastDefinition)definition);
+    public MulticastReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, (MulticastDefinition) definition);
     }
 
     @Override
-    public Processor createProcessor(RouteContext routeContext) throws Exception {
-        Processor answer = this.createChildProcessor(routeContext, true);
+    public Processor createProcessor() throws Exception {
+        Processor answer = this.createChildProcessor(true);
 
         // force the answer as a multicast processor even if there is only one
         // child processor in the multicast
         if (!(answer instanceof MulticastProcessor)) {
             List<Processor> list = new ArrayList<>(1);
             list.add(answer);
-            answer = createCompositeProcessor(routeContext, list);
+            answer = createCompositeProcessor(list);
         }
         return answer;
     }
 
     @Override
-    protected Processor createCompositeProcessor(RouteContext routeContext, List<Processor> list) throws Exception {
-        final AggregationStrategy strategy = createAggregationStrategy(routeContext);
+    protected Processor createCompositeProcessor(List<Processor> list) throws Exception {
+        final AggregationStrategy strategy = createAggregationStrategy();
 
-        boolean isParallelProcessing = definition.getParallelProcessing() != null && parseBoolean(routeContext, definition.getParallelProcessing());
-        boolean isShareUnitOfWork = definition.getShareUnitOfWork() != null && parseBoolean(routeContext, definition.getShareUnitOfWork());
-        boolean isStreaming = definition.getStreaming() != null && parseBoolean(routeContext, definition.getStreaming());
-        boolean isStopOnException = definition.getStopOnException() != null && parseBoolean(routeContext, definition.getStopOnException());
-        boolean isParallelAggregate = definition.getParallelAggregate() != null && parseBoolean(routeContext, definition.getParallelAggregate());
-        boolean isStopOnAggregateException = definition.getStopOnAggregateException() != null && parseBoolean(routeContext, definition.getStopOnAggregateException());
+        boolean isParallelProcessing = definition.getParallelProcessing() != null && parseBoolean(definition.getParallelProcessing());
+        boolean isShareUnitOfWork = definition.getShareUnitOfWork() != null && parseBoolean(definition.getShareUnitOfWork());
+        boolean isStreaming = definition.getStreaming() != null && parseBoolean(definition.getStreaming());
+        boolean isStopOnException = definition.getStopOnException() != null && parseBoolean(definition.getStopOnException());
+        boolean isParallelAggregate = definition.getParallelAggregate() != null && parseBoolean(definition.getParallelAggregate());
+        boolean isStopOnAggregateException = definition.getStopOnAggregateException() != null && parseBoolean(definition.getStopOnAggregateException());
 
         boolean shutdownThreadPool = ProcessorDefinitionHelper.willCreateNewThreadPool(routeContext, definition, isParallelProcessing);
         ExecutorService threadPool = ProcessorDefinitionHelper.getConfiguredExecutorService(routeContext, "Multicast", definition, isParallelProcessing);
 
-        long timeout = definition.getTimeout() != null ? parseLong(routeContext, definition.getTimeout()) : 0;
+        long timeout = definition.getTimeout() != null ? parseLong(definition.getTimeout()) : 0;
         if (timeout > 0 && !isParallelProcessing) {
             throw new IllegalArgumentException("Timeout is used but ParallelProcessing has not been enabled.");
         }
         if (definition.getOnPrepareRef() != null) {
-            definition.setOnPrepare(CamelContextHelper.mandatoryLookup(routeContext.getCamelContext(), definition.getOnPrepareRef(), Processor.class));
+            definition.setOnPrepare(CamelContextHelper.mandatoryLookup(camelContext, definition.getOnPrepareRef(), Processor.class));
         }
 
-        MulticastProcessor answer = new MulticastProcessor(routeContext.getCamelContext(), list, strategy, isParallelProcessing, threadPool, shutdownThreadPool, isStreaming,
+        MulticastProcessor answer = new MulticastProcessor(camelContext, list, strategy, isParallelProcessing, threadPool, shutdownThreadPool, isStreaming,
                                                            isStopOnException, timeout, definition.getOnPrepare(), isShareUnitOfWork, isParallelAggregate,
                                                            isStopOnAggregateException);
         return answer;
     }
 
-    private AggregationStrategy createAggregationStrategy(RouteContext routeContext) {
+    private AggregationStrategy createAggregationStrategy() {
         AggregationStrategy strategy = definition.getAggregationStrategy();
         if (strategy == null && definition.getStrategyRef() != null) {
             Object aggStrategy = routeContext.lookup(definition.getStrategyRef(), Object.class);
@@ -90,8 +90,8 @@ public class MulticastReifier extends ProcessorReifier<MulticastDefinition> {
             } else if (aggStrategy != null) {
                 AggregationStrategyBeanAdapter adapter = new AggregationStrategyBeanAdapter(aggStrategy, definition.getStrategyMethodName());
                 if (definition.getStrategyMethodAllowNull() != null) {
-                    adapter.setAllowNullNewExchange(parseBoolean(routeContext, definition.getStrategyMethodAllowNull()));
-                    adapter.setAllowNullOldExchange(parseBoolean(routeContext, definition.getStrategyMethodAllowNull()));
+                    adapter.setAllowNullNewExchange(parseBoolean(definition.getStrategyMethodAllowNull()));
+                    adapter.setAllowNullOldExchange(parseBoolean(definition.getStrategyMethodAllowNull()));
                 }
                 strategy = adapter;
             } else {
@@ -105,10 +105,10 @@ public class MulticastReifier extends ProcessorReifier<MulticastDefinition> {
         }
 
         if (strategy instanceof CamelContextAware) {
-            ((CamelContextAware)strategy).setCamelContext(routeContext.getCamelContext());
+            ((CamelContextAware)strategy).setCamelContext(camelContext);
         }
 
-        if (definition.getShareUnitOfWork() != null && parseBoolean(routeContext, definition.getShareUnitOfWork())) {
+        if (definition.getShareUnitOfWork() != null && parseBoolean(definition.getShareUnitOfWork())) {
             // wrap strategy in share unit of work
             strategy = new ShareUnitOfWorkAggregationStrategy(strategy);
         }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/OnCompletionReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/OnCompletionReifier.java
index 12222c9..bc71d5b 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/OnCompletionReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/OnCompletionReifier.java
@@ -30,12 +30,12 @@ import org.apache.camel.spi.RouteContext;
 
 public class OnCompletionReifier extends ProcessorReifier<OnCompletionDefinition> {
 
-    public OnCompletionReifier(ProcessorDefinition<?> definition) {
-        super((OnCompletionDefinition)definition);
+    public OnCompletionReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, (OnCompletionDefinition)definition);
     }
 
     @Override
-    public Processor createProcessor(RouteContext routeContext) throws Exception {
+    public Processor createProcessor() throws Exception {
         // assign whether this was a route scoped onCompletion or not
         // we need to know this later when setting the parent, as only route
         // scoped should have parent
@@ -50,10 +50,10 @@ public class OnCompletionReifier extends ProcessorReifier<OnCompletionDefinition
             routeScoped = definition.getParent() != null;
         }
 
-        boolean isOnCompleteOnly = definition.getOnCompleteOnly() != null && parseBoolean(routeContext, definition.getOnCompleteOnly());
-        boolean isOnFailureOnly = definition.getOnFailureOnly() != null && parseBoolean(routeContext, definition.getOnFailureOnly());
-        boolean isParallelProcessing = definition.getParallelProcessing() != null && parseBoolean(routeContext, definition.getParallelProcessing());
-        boolean original = definition.getUseOriginalMessage() != null && parseBoolean(routeContext, definition.getUseOriginalMessage());
+        boolean isOnCompleteOnly = definition.getOnCompleteOnly() != null && parseBoolean(definition.getOnCompleteOnly());
+        boolean isOnFailureOnly = definition.getOnFailureOnly() != null && parseBoolean(definition.getOnFailureOnly());
+        boolean isParallelProcessing = definition.getParallelProcessing() != null && parseBoolean(definition.getParallelProcessing());
+        boolean original = definition.getUseOriginalMessage() != null && parseBoolean(definition.getUseOriginalMessage());
 
         if (isOnCompleteOnly && isOnFailureOnly) {
             throw new IllegalArgumentException("Both onCompleteOnly and onFailureOnly cannot be true. Only one of them can be true. On node: " + this);
@@ -63,11 +63,11 @@ public class OnCompletionReifier extends ProcessorReifier<OnCompletionDefinition
             routeContext.setAllowUseOriginalMessage(true);
         }
 
-        Processor childProcessor = this.createChildProcessor(routeContext, true);
+        Processor childProcessor = this.createChildProcessor(true);
 
         // wrap the on completion route in a unit of work processor
-        CamelInternalProcessor internal = new CamelInternalProcessor(routeContext.getCamelContext(), childProcessor);
-        internal.addAdvice(new CamelInternalProcessor.UnitOfWorkProcessorAdvice(routeContext, routeContext.getCamelContext()));
+        CamelInternalProcessor internal = new CamelInternalProcessor(camelContext, childProcessor);
+        internal.addAdvice(new CamelInternalProcessor.UnitOfWorkProcessorAdvice(routeContext, camelContext));
 
         routeContext.setOnCompletion(getId(definition, routeContext), internal);
 
@@ -82,7 +82,7 @@ public class OnCompletionReifier extends ProcessorReifier<OnCompletionDefinition
         // should be after consumer by default
         boolean afterConsumer = definition.getMode() == null || definition.getMode() == OnCompletionMode.AfterConsumer;
 
-        OnCompletionProcessor answer = new OnCompletionProcessor(routeContext.getCamelContext(), internal, threadPool, shutdownThreadPool, isOnCompleteOnly, isOnFailureOnly, when,
+        OnCompletionProcessor answer = new OnCompletionProcessor(camelContext, internal, threadPool, shutdownThreadPool, isOnCompleteOnly, isOnFailureOnly, when,
                                                                  original, afterConsumer);
         return answer;
     }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/OnExceptionReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/OnExceptionReifier.java
index 5682fba..57a3425 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/OnExceptionReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/OnExceptionReifier.java
@@ -33,8 +33,8 @@ import org.apache.camel.util.ObjectHelper;
 
 public class OnExceptionReifier extends ProcessorReifier<OnExceptionDefinition> {
 
-    public OnExceptionReifier(ProcessorDefinition<?> definition) {
-        super((OnExceptionDefinition)definition);
+    public OnExceptionReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, (OnExceptionDefinition)definition);
     }
 
     @Override
@@ -51,22 +51,22 @@ public class OnExceptionReifier extends ProcessorReifier<OnExceptionDefinition>
             definition.setRouteScoped(definition.getParent() != null);
         }
 
-        setHandledFromExpressionType(routeContext);
-        setContinuedFromExpressionType(routeContext);
-        setRetryWhileFromExpressionType(routeContext);
-        setOnRedeliveryFromRedeliveryRef(routeContext);
-        setOnExceptionOccurredFromOnExceptionOccurredRef(routeContext);
+        setHandledFromExpressionType();
+        setContinuedFromExpressionType();
+        setRetryWhileFromExpressionType();
+        setOnRedeliveryFromRedeliveryRef();
+        setOnExceptionOccurredFromOnExceptionOccurredRef();
 
         // must validate configuration before creating processor
         definition.validateConfiguration();
 
-        if (definition.getUseOriginalMessage() != null && parseBoolean(routeContext, definition.getUseOriginalMessage())) {
+        if (definition.getUseOriginalMessage() != null && parseBoolean(definition.getUseOriginalMessage())) {
             // ensure allow original is turned on
             routeContext.setAllowUseOriginalMessage(true);
         }
 
         // lets attach this on exception to the route error handler
-        Processor child = createOutputsProcessor(routeContext);
+        Processor child = createOutputsProcessor();
         if (child != null) {
             // wrap in our special safe fallback error handler if OnException
             // have child output
@@ -81,14 +81,14 @@ public class OnExceptionReifier extends ProcessorReifier<OnExceptionDefinition>
     }
 
     @Override
-    public CatchProcessor createProcessor(RouteContext routeContext) throws Exception {
+    public CatchProcessor createProcessor() throws Exception {
         // load exception classes
         List<Class<? extends Throwable>> classes = null;
         if (definition.getExceptions() != null && !definition.getExceptions().isEmpty()) {
-            classes = createExceptionClasses(routeContext.getCamelContext().getClassResolver());
+            classes = createExceptionClasses(camelContext.getClassResolver());
         }
 
-        if (definition.getUseOriginalMessage() != null && parseBoolean(routeContext, definition.getUseOriginalMessage())) {
+        if (definition.getUseOriginalMessage() != null && parseBoolean(definition.getUseOriginalMessage())) {
             // ensure allow original is turned on
             routeContext.setAllowUseOriginalMessage(true);
         }
@@ -96,7 +96,7 @@ public class OnExceptionReifier extends ProcessorReifier<OnExceptionDefinition>
         // must validate configuration before creating processor
         definition.validateConfiguration();
 
-        Processor childProcessor = this.createChildProcessor(routeContext, false);
+        Processor childProcessor = this.createChildProcessor(false);
 
         Predicate when = null;
         if (definition.getOnWhen() != null) {
@@ -121,38 +121,38 @@ public class OnExceptionReifier extends ProcessorReifier<OnExceptionDefinition>
         return answer;
     }
 
-    private void setHandledFromExpressionType(RouteContext routeContext) {
+    private void setHandledFromExpressionType() {
         if (definition.getHandled() != null && definition.getHandledPolicy() == null && routeContext != null) {
             definition.handled(definition.getHandled().createPredicate(routeContext));
         }
     }
 
-    private void setContinuedFromExpressionType(RouteContext routeContext) {
+    private void setContinuedFromExpressionType() {
         if (definition.getContinued() != null && definition.getContinuedPolicy() == null && routeContext != null) {
             definition.continued(definition.getContinued().createPredicate(routeContext));
         }
     }
 
-    private void setRetryWhileFromExpressionType(RouteContext routeContext) {
+    private void setRetryWhileFromExpressionType() {
         if (definition.getRetryWhile() != null && definition.getRetryWhilePolicy() == null && routeContext != null) {
             definition.retryWhile(definition.getRetryWhile().createPredicate(routeContext));
         }
     }
 
-    private void setOnRedeliveryFromRedeliveryRef(RouteContext routeContext) {
+    private void setOnRedeliveryFromRedeliveryRef() {
         // lookup onRedelivery if ref is provided
         if (ObjectHelper.isNotEmpty(definition.getOnRedeliveryRef())) {
             // if ref is provided then use mandatory lookup to fail if not found
-            Processor onRedelivery = CamelContextHelper.mandatoryLookup(routeContext.getCamelContext(), definition.getOnRedeliveryRef(), Processor.class);
+            Processor onRedelivery = CamelContextHelper.mandatoryLookup(camelContext, definition.getOnRedeliveryRef(), Processor.class);
             definition.setOnRedelivery(onRedelivery);
         }
     }
 
-    private void setOnExceptionOccurredFromOnExceptionOccurredRef(RouteContext routeContext) {
+    private void setOnExceptionOccurredFromOnExceptionOccurredRef() {
         // lookup onRedelivery if ref is provided
         if (ObjectHelper.isNotEmpty(definition.getOnExceptionOccurredRef())) {
             // if ref is provided then use mandatory lookup to fail if not found
-            Processor onExceptionOccurred = CamelContextHelper.mandatoryLookup(routeContext.getCamelContext(), definition.getOnExceptionOccurredRef(), Processor.class);
+            Processor onExceptionOccurred = CamelContextHelper.mandatoryLookup(camelContext, definition.getOnExceptionOccurredRef(), Processor.class);
             definition.setOnExceptionOccurred(onExceptionOccurred);
         }
     }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/OnFallbackReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/OnFallbackReifier.java
index 1d4a5ea..3a6e2d1 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/OnFallbackReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/OnFallbackReifier.java
@@ -23,13 +23,13 @@ import org.apache.camel.spi.RouteContext;
 
 public class OnFallbackReifier extends ProcessorReifier<OnFallbackDefinition> {
 
-    public OnFallbackReifier(ProcessorDefinition<?> definition) {
-        super((OnFallbackDefinition)definition);
+    public OnFallbackReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, (OnFallbackDefinition)definition);
     }
 
     @Override
-    public Processor createProcessor(RouteContext routeContext) throws Exception {
-        return this.createChildProcessor(routeContext, false);
+    public Processor createProcessor() throws Exception {
+        return this.createChildProcessor(false);
     }
 
 }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/OtherwiseReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/OtherwiseReifier.java
index c6e7b94..2e78b4f 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/OtherwiseReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/OtherwiseReifier.java
@@ -23,12 +23,12 @@ import org.apache.camel.spi.RouteContext;
 
 public class OtherwiseReifier extends ProcessorReifier<OtherwiseDefinition> {
 
-    public OtherwiseReifier(ProcessorDefinition<?> definition) {
-        super(OtherwiseDefinition.class.cast(definition));
+    public OtherwiseReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, OtherwiseDefinition.class.cast(definition));
     }
 
     @Override
-    public Processor createProcessor(RouteContext routeContext) throws Exception {
-        return this.createChildProcessor(routeContext, false);
+    public Processor createProcessor() throws Exception {
+        return this.createChildProcessor(false);
     }
 }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/PipelineReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/PipelineReifier.java
index 6758886..441d83c 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/PipelineReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/PipelineReifier.java
@@ -23,12 +23,12 @@ import org.apache.camel.spi.RouteContext;
 
 public class PipelineReifier extends ProcessorReifier<PipelineDefinition> {
 
-    public PipelineReifier(ProcessorDefinition<?> definition) {
-        super(PipelineDefinition.class.cast(definition));
+    public PipelineReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, PipelineDefinition.class.cast(definition));
     }
 
     @Override
-    public Processor createProcessor(RouteContext routeContext) throws Exception {
-        return this.createChildProcessor(routeContext, true);
+    public Processor createProcessor() throws Exception {
+        return this.createChildProcessor(true);
     }
 }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/PolicyReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/PolicyReifier.java
index fbbe769..a96db82 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/PolicyReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/PolicyReifier.java
@@ -27,12 +27,12 @@ import org.apache.camel.util.ObjectHelper;
 
 public class PolicyReifier extends ProcessorReifier<PolicyDefinition> {
 
-    public PolicyReifier(ProcessorDefinition<?> definition) {
-        super((PolicyDefinition)definition);
+    public PolicyReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, (PolicyDefinition) definition);
     }
 
     @Override
-    public Processor createProcessor(RouteContext routeContext) throws Exception {
+    public Processor createProcessor() throws Exception {
         Policy policy = resolvePolicy(routeContext);
         ObjectHelper.notNull(policy, "policy", definition);
 
@@ -40,7 +40,7 @@ public class PolicyReifier extends ProcessorReifier<PolicyDefinition> {
         policy.beforeWrap(routeContext, definition);
 
         // create processor after the before wrap
-        Processor childProcessor = this.createChildProcessor(routeContext, true);
+        Processor childProcessor = this.createChildProcessor(true);
 
         // wrap
         Processor target = policy.wrap(routeContext, childProcessor);
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/PollEnrichReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/PollEnrichReifier.java
index 0f0da58..05d8555 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/PollEnrichReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/PollEnrichReifier.java
@@ -28,38 +28,38 @@ import org.apache.camel.spi.RouteContext;
 
 public class PollEnrichReifier extends ProcessorReifier<PollEnrichDefinition> {
 
-    public PollEnrichReifier(ProcessorDefinition<?> definition) {
-        super((PollEnrichDefinition)definition);
+    public PollEnrichReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, (PollEnrichDefinition)definition);
     }
 
     @Override
-    public Processor createProcessor(RouteContext routeContext) throws Exception {
+    public Processor createProcessor() throws Exception {
 
         // if no timeout then we should block, and there use a negative timeout
-        long time = definition.getTimeout() != null ? parseLong(routeContext, definition.getTimeout()) : -1;
-        boolean isIgnoreInvalidEndpoint = definition.getIgnoreInvalidEndpoint() != null && parseBoolean(routeContext, definition.getIgnoreInvalidEndpoint());
+        long time = definition.getTimeout() != null ? parseLong(definition.getTimeout()) : -1;
+        boolean isIgnoreInvalidEndpoint = definition.getIgnoreInvalidEndpoint() != null && parseBoolean(definition.getIgnoreInvalidEndpoint());
         Expression exp = definition.getExpression().createExpression(routeContext);
 
         PollEnricher enricher = new PollEnricher(exp, time);
 
-        AggregationStrategy strategy = createAggregationStrategy(routeContext);
+        AggregationStrategy strategy = createAggregationStrategy();
         if (strategy == null) {
             enricher.setDefaultAggregationStrategy();
         } else {
             enricher.setAggregationStrategy(strategy);
         }
         if (definition.getAggregateOnException() != null) {
-            enricher.setAggregateOnException(parseBoolean(routeContext, definition.getAggregateOnException()));
+            enricher.setAggregateOnException(parseBoolean(definition.getAggregateOnException()));
         }
         if (definition.getCacheSize() != null) {
-            enricher.setCacheSize(parseInt(routeContext, definition.getCacheSize()));
+            enricher.setCacheSize(parseInt(definition.getCacheSize()));
         }
         enricher.setIgnoreInvalidEndpoint(isIgnoreInvalidEndpoint);
 
         return enricher;
     }
 
-    private AggregationStrategy createAggregationStrategy(RouteContext routeContext) {
+    private AggregationStrategy createAggregationStrategy() {
         AggregationStrategy strategy = definition.getAggregationStrategy();
         if (strategy == null && definition.getAggregationStrategyRef() != null) {
             Object aggStrategy = routeContext.lookup(definition.getAggregationStrategyRef(), Object.class);
@@ -68,8 +68,8 @@ public class PollEnrichReifier extends ProcessorReifier<PollEnrichDefinition> {
             } else if (aggStrategy != null) {
                 AggregationStrategyBeanAdapter adapter = new AggregationStrategyBeanAdapter(aggStrategy, definition.getAggregationStrategyMethodName());
                 if (definition.getAggregationStrategyMethodAllowNull() != null) {
-                    adapter.setAllowNullNewExchange(parseBoolean(routeContext, definition.getAggregationStrategyMethodAllowNull()));
-                    adapter.setAllowNullOldExchange(parseBoolean(routeContext, definition.getAggregationStrategyMethodAllowNull()));
+                    adapter.setAllowNullNewExchange(parseBoolean(definition.getAggregationStrategyMethodAllowNull()));
+                    adapter.setAllowNullOldExchange(parseBoolean(definition.getAggregationStrategyMethodAllowNull()));
                 }
                 strategy = adapter;
             } else {
@@ -78,7 +78,7 @@ public class PollEnrichReifier extends ProcessorReifier<PollEnrichDefinition> {
         }
 
         if (strategy instanceof CamelContextAware) {
-            ((CamelContextAware)strategy).setCamelContext(routeContext.getCamelContext());
+            ((CamelContextAware)strategy).setCamelContext(camelContext);
         }
 
         return strategy;
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ProcessReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ProcessReifier.java
index 08da9d4..2841268 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ProcessReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ProcessReifier.java
@@ -28,12 +28,12 @@ import org.apache.camel.util.ObjectHelper;
 
 public class ProcessReifier extends ProcessorReifier<ProcessDefinition> {
 
-    public ProcessReifier(ProcessorDefinition<?> definition) {
-        super((ProcessDefinition)definition);
+    public ProcessReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, (ProcessDefinition)definition);
     }
 
     @Override
-    public Processor createProcessor(RouteContext routeContext) {
+    public Processor createProcessor() {
         Processor answer = definition.getProcessor();
         if (answer == null) {
             ObjectHelper.notNull(definition.getRef(), "ref", definition);
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ProcessorReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ProcessorReifier.java
index f9bdb54..d7627ed 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ProcessorReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ProcessorReifier.java
@@ -21,8 +21,9 @@ import java.util.Collection;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.function.Function;
+import java.util.function.BiFunction;
 
+import org.apache.camel.CamelContext;
 import org.apache.camel.Channel;
 import org.apache.camel.ErrorHandlerFactory;
 import org.apache.camel.ExtendedCamelContext;
@@ -112,11 +113,11 @@ import org.slf4j.LoggerFactory;
 
 public abstract class ProcessorReifier<T extends ProcessorDefinition<?>> extends AbstractReifier {
 
-    private static final Map<Class<?>, Function<ProcessorDefinition<?>, ProcessorReifier<? extends ProcessorDefinition<?>>>> PROCESSORS;
+    private static final Map<Class<?>, BiFunction<RouteContext, ProcessorDefinition<?>, ProcessorReifier<? extends ProcessorDefinition<?>>>> PROCESSORS;
     static {
         // NOTE: if adding a new class then update the initial capacity of the
         // HashMap
-        Map<Class<?>, Function<ProcessorDefinition<?>, ProcessorReifier<? extends ProcessorDefinition<?>>>> map = new HashMap<>(65);
+        Map<Class<?>, BiFunction<RouteContext, ProcessorDefinition<?>, ProcessorReifier<? extends ProcessorDefinition<?>>>> map = new HashMap<>(65);
         map.put(AggregateDefinition.class, AggregateReifier::new);
         map.put(BeanDefinition.class, BeanReifier::new);
         map.put(CatchDefinition.class, CatchReifier::new);
@@ -188,18 +189,24 @@ public abstract class ProcessorReifier<T extends ProcessorDefinition<?>> extends
 
     protected final T definition;
 
-    public ProcessorReifier(T definition) {
+    public ProcessorReifier(RouteContext routeContext, T definition) {
+        super(routeContext);
         this.definition = definition;
     }
 
-    public static void registerReifier(Class<?> processorClass, Function<ProcessorDefinition<?>, ProcessorReifier<? extends ProcessorDefinition<?>>> creator) {
+    public ProcessorReifier(CamelContext camelContext, T definition) {
+        super(camelContext);
+        this.definition = definition;
+    }
+
+    public static void registerReifier(Class<?> processorClass, BiFunction<RouteContext, ProcessorDefinition<?>, ProcessorReifier<? extends ProcessorDefinition<?>>> creator) {
         PROCESSORS.put(processorClass, creator);
     }
 
-    public static ProcessorReifier<? extends ProcessorDefinition<?>> reifier(ProcessorDefinition<?> definition) {
-        Function<ProcessorDefinition<?>, ProcessorReifier<? extends ProcessorDefinition<?>>> reifier = PROCESSORS.get(definition.getClass());
+    public static ProcessorReifier<? extends ProcessorDefinition<?>> reifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        BiFunction<RouteContext, ProcessorDefinition<?>, ProcessorReifier<? extends ProcessorDefinition<?>>> reifier = PROCESSORS.get(definition.getClass());
         if (reifier != null) {
-            return reifier.apply(definition);
+            return reifier.apply(routeContext, definition);
         }
         throw new IllegalStateException("Unsupported definition: " + definition);
     }
@@ -208,20 +215,19 @@ public abstract class ProcessorReifier<T extends ProcessorDefinition<?>> extends
      * Override this in definition class and implement logic to create the
      * processor based on the definition model.
      */
-    public abstract Processor createProcessor(RouteContext routeContext) throws Exception;
+    public abstract Processor createProcessor() throws Exception;
 
     /**
      * Prefer to use {#link #createChildProcessor}.
      */
-    protected Processor createOutputsProcessor(RouteContext routeContext) throws Exception {
+    protected Processor createOutputsProcessor() throws Exception {
         Collection<ProcessorDefinition<?>> outputs = definition.getOutputs();
-        return createOutputsProcessor(routeContext, outputs);
+        return createOutputsProcessor(outputs);
     }
 
     /**
      * Creates the child processor (outputs) from the current definition
      *
-     * @param routeContext the route context
      * @param mandatory whether or not children is mandatory (ie the definition
      *            should have outputs)
      * @return the created children, or <tt>null</tt> if definition had no
@@ -229,16 +235,16 @@ public abstract class ProcessorReifier<T extends ProcessorDefinition<?>> extends
      * @throws Exception is thrown if error creating the child or if it was
      *             mandatory and there was no output defined on definition
      */
-    protected Processor createChildProcessor(RouteContext routeContext, boolean mandatory) throws Exception {
+    protected Processor createChildProcessor(boolean mandatory) throws Exception {
         Processor children = null;
         // at first use custom factory
-        if (routeContext.getCamelContext().adapt(ExtendedCamelContext.class).getProcessorFactory() != null) {
-            children = routeContext.getCamelContext().adapt(ExtendedCamelContext.class).getProcessorFactory().createChildProcessor(routeContext, definition, mandatory);
+        if (camelContext.adapt(ExtendedCamelContext.class).getProcessorFactory() != null) {
+            children = camelContext.adapt(ExtendedCamelContext.class).getProcessorFactory().createChildProcessor(routeContext, definition, mandatory);
         }
         // fallback to default implementation if factory did not create the
         // child
         if (children == null) {
-            children = createOutputsProcessor(routeContext);
+            children = createOutputsProcessor();
         }
 
         if (children == null && mandatory) {
@@ -248,7 +254,7 @@ public abstract class ProcessorReifier<T extends ProcessorDefinition<?>> extends
     }
 
     public void addRoutes(RouteContext routeContext) throws Exception {
-        Channel processor = makeProcessor(routeContext);
+        Channel processor = makeProcessor();
         if (processor == null) {
             // no processor to add
             return;
@@ -289,17 +295,17 @@ public abstract class ProcessorReifier<T extends ProcessorDefinition<?>> extends
     protected Channel wrapChannel(RouteContext routeContext, Processor processor, ProcessorDefinition<?> child, Boolean inheritErrorHandler) throws Exception {
         // put a channel in between this and each output to control the route
         // flow logic
-        DefaultChannel channel = new DefaultChannel(routeContext.getCamelContext());
+        DefaultChannel channel = new DefaultChannel(camelContext);
 
         // add interceptor strategies to the channel must be in this order:
         // camel context, route context, local
         List<InterceptStrategy> interceptors = new ArrayList<>();
-        addInterceptStrategies(routeContext, interceptors, routeContext.getCamelContext().adapt(ExtendedCamelContext.class).getInterceptStrategies());
+        addInterceptStrategies(routeContext, interceptors, camelContext.adapt(ExtendedCamelContext.class).getInterceptStrategies());
         addInterceptStrategies(routeContext, interceptors, routeContext.getInterceptStrategies());
         addInterceptStrategies(routeContext, interceptors, definition.getInterceptStrategies());
 
         // force the creation of an id
-        RouteDefinitionHelper.forceAssignIds(routeContext.getCamelContext(), definition);
+        RouteDefinitionHelper.forceAssignIds(camelContext, definition);
 
         // fix parent/child relationship. This will be the case of the routes
         // has been
@@ -367,7 +373,7 @@ public abstract class ProcessorReifier<T extends ProcessorDefinition<?>> extends
             // however if share unit of work is enabled, we need to wrap an
             // error handler on the multicast parent
             MulticastDefinition def = (MulticastDefinition)definition;
-            boolean isShareUnitOfWork = def.getShareUnitOfWork() != null && parseBoolean(routeContext, def.getShareUnitOfWork());
+            boolean isShareUnitOfWork = def.getShareUnitOfWork() != null && parseBoolean(def.getShareUnitOfWork());
             if (isShareUnitOfWork && child == null) {
                 // only wrap the parent (not the children of the multicast)
                 wrap = true;
@@ -420,10 +426,10 @@ public abstract class ProcessorReifier<T extends ProcessorDefinition<?>> extends
     protected Processor wrapInErrorHandler(RouteContext routeContext, Processor output) throws Exception {
         ErrorHandlerFactory builder = routeContext.getErrorHandlerFactory();
         // create error handler
-        Processor errorHandler = ErrorHandlerReifier.reifier(builder).createErrorHandler(routeContext, output);
+        Processor errorHandler = ErrorHandlerReifier.reifier(routeContext, builder).createErrorHandler(output);
 
         // invoke lifecycles so we can manage this error handler builder
-        for (LifecycleStrategy strategy : routeContext.getCamelContext().getLifecycleStrategies()) {
+        for (LifecycleStrategy strategy : camelContext.getLifecycleStrategies()) {
             strategy.onErrorHandlerAdd(routeContext, errorHandler, builder);
         }
 
@@ -446,30 +452,30 @@ public abstract class ProcessorReifier<T extends ProcessorDefinition<?>> extends
      * to using a {@link Pipeline} but derived classes could change the
      * behaviour
      */
-    protected Processor createCompositeProcessor(RouteContext routeContext, List<Processor> list) throws Exception {
-        return Pipeline.newInstance(routeContext.getCamelContext(), list);
+    protected Processor createCompositeProcessor(List<Processor> list) throws Exception {
+        return Pipeline.newInstance(camelContext, list);
     }
 
-    protected Processor createOutputsProcessor(RouteContext routeContext, Collection<ProcessorDefinition<?>> outputs) throws Exception {
+    protected Processor createOutputsProcessor(Collection<ProcessorDefinition<?>> outputs) throws Exception {
         // We will save list of actions to restore the outputs back to the
         // original state.
         Runnable propertyPlaceholdersChangeReverter = ProcessorDefinitionHelper.createPropertyPlaceholdersChangeReverter();
         try {
-            return createOutputsProcessorImpl(routeContext, outputs);
+            return createOutputsProcessorImpl(outputs);
         } finally {
             propertyPlaceholdersChangeReverter.run();
         }
     }
 
-    protected Processor createOutputsProcessorImpl(RouteContext routeContext, Collection<ProcessorDefinition<?>> outputs) throws Exception {
+    protected Processor createOutputsProcessorImpl(Collection<ProcessorDefinition<?>> outputs) throws Exception {
         List<Processor> list = new ArrayList<>();
         for (ProcessorDefinition<?> output : outputs) {
 
             // allow any custom logic before we create the processor
-            reifier(output).preCreateProcessor();
+            reifier(routeContext, output).preCreateProcessor();
 
             // resolve properties before we create the processor
-            ProcessorDefinitionHelper.resolvePropertyPlaceholders(routeContext.getCamelContext(), output);
+            ProcessorDefinitionHelper.resolvePropertyPlaceholders(camelContext, output);
 
             // also resolve properties and constant fields on embedded expressions
             ProcessorDefinition<?> me = output;
@@ -478,11 +484,11 @@ public abstract class ProcessorReifier<T extends ProcessorDefinition<?>> extends
                 ExpressionDefinition expressionDefinition = exp.getExpression();
                 if (expressionDefinition != null) {
                     // resolve properties before we create the processor
-                    ProcessorDefinitionHelper.resolvePropertyPlaceholders(routeContext.getCamelContext(), expressionDefinition);
+                    ProcessorDefinitionHelper.resolvePropertyPlaceholders(camelContext, expressionDefinition);
                 }
             }
 
-            Processor processor = createProcessor(routeContext, output);
+            Processor processor = createProcessor(output);
 
             // inject id
             if (processor instanceof IdAware) {
@@ -508,23 +514,23 @@ public abstract class ProcessorReifier<T extends ProcessorDefinition<?>> extends
             if (list.size() == 1) {
                 processor = list.get(0);
             } else {
-                processor = createCompositeProcessor(routeContext, list);
+                processor = createCompositeProcessor(list);
             }
         }
 
         return processor;
     }
 
-    protected Processor createProcessor(RouteContext routeContext, ProcessorDefinition<?> output) throws Exception {
+    protected Processor createProcessor(ProcessorDefinition<?> output) throws Exception {
         Processor processor = null;
         // at first use custom factory
-        if (routeContext.getCamelContext().adapt(ExtendedCamelContext.class).getProcessorFactory() != null) {
-            processor = routeContext.getCamelContext().adapt(ExtendedCamelContext.class).getProcessorFactory().createProcessor(routeContext, output);
+        if (camelContext.adapt(ExtendedCamelContext.class).getProcessorFactory() != null) {
+            processor = camelContext.adapt(ExtendedCamelContext.class).getProcessorFactory().createProcessor(routeContext, output);
         }
         // fallback to default implementation if factory did not create the
         // processor
         if (processor == null) {
-            processor = reifier(output).createProcessor(routeContext);
+            processor = reifier(routeContext, output).createProcessor();
         }
         return processor;
     }
@@ -533,26 +539,26 @@ public abstract class ProcessorReifier<T extends ProcessorDefinition<?>> extends
      * Creates the processor and wraps it in any necessary interceptors and
      * error handlers
      */
-    protected Channel makeProcessor(RouteContext routeContext) throws Exception {
+    protected Channel makeProcessor() throws Exception {
         // We will save list of actions to restore the definition back to the
         // original state.
         Runnable propertyPlaceholdersChangeReverter = ProcessorDefinitionHelper.createPropertyPlaceholdersChangeReverter();
         try {
-            return makeProcessorImpl(routeContext);
+            return makeProcessorImpl();
         } finally {
             // Lets restore
             propertyPlaceholdersChangeReverter.run();
         }
     }
 
-    private Channel makeProcessorImpl(RouteContext routeContext) throws Exception {
+    private Channel makeProcessorImpl() throws Exception {
         Processor processor = null;
 
         // allow any custom logic before we create the processor
         preCreateProcessor();
 
         // resolve properties before we create the processor
-        ProcessorDefinitionHelper.resolvePropertyPlaceholders(routeContext.getCamelContext(), definition);
+        ProcessorDefinitionHelper.resolvePropertyPlaceholders(camelContext, definition);
 
         // also resolve properties and constant fields on embedded expressions
         ProcessorDefinition<?> me = definition;
@@ -561,18 +567,18 @@ public abstract class ProcessorReifier<T extends ProcessorDefinition<?>> extends
             ExpressionDefinition expressionDefinition = exp.getExpression();
             if (expressionDefinition != null) {
                 // resolve properties before we create the processor
-                ProcessorDefinitionHelper.resolvePropertyPlaceholders(routeContext.getCamelContext(), expressionDefinition);
+                ProcessorDefinitionHelper.resolvePropertyPlaceholders(camelContext, expressionDefinition);
             }
         }
 
         // at first use custom factory
-        if (routeContext.getCamelContext().adapt(ExtendedCamelContext.class).getProcessorFactory() != null) {
-            processor = routeContext.getCamelContext().adapt(ExtendedCamelContext.class).getProcessorFactory().createProcessor(routeContext, definition);
+        if (camelContext.adapt(ExtendedCamelContext.class).getProcessorFactory() != null) {
+            processor = camelContext.adapt(ExtendedCamelContext.class).getProcessorFactory().createProcessor(routeContext, definition);
         }
         // fallback to default implementation if factory did not create the
         // processor
         if (processor == null) {
-            processor = createProcessor(routeContext);
+            processor = createProcessor();
         }
 
         // inject id
@@ -609,7 +615,7 @@ public abstract class ProcessorReifier<T extends ProcessorDefinition<?>> extends
     }
 
     protected String getId(OptionalIdentifiedDefinition<?> def, RouteContext routeContext) {
-        return def.idOrCreate(routeContext.getCamelContext().adapt(ExtendedCamelContext.class).getNodeIdFactory());
+        return def.idOrCreate(camelContext.adapt(ExtendedCamelContext.class).getNodeIdFactory());
     }
 
 }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/RecipientListReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/RecipientListReifier.java
index 6d9a566..950815b 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/RecipientListReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/RecipientListReifier.java
@@ -38,27 +38,27 @@ import org.apache.camel.support.CamelContextHelper;
 
 public class RecipientListReifier extends ProcessorReifier<RecipientListDefinition<?>> {
 
-    public RecipientListReifier(ProcessorDefinition<?> definition) {
-        super((RecipientListDefinition<?>)definition);
+    public RecipientListReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, (RecipientListDefinition<?>)definition);
     }
 
     @Override
-    public Processor createProcessor(RouteContext routeContext) throws Exception {
+    public Processor createProcessor() throws Exception {
         final Expression expression = definition.getExpression().createExpression(routeContext);
 
-        boolean isParallelProcessing = definition.getParallelProcessing() != null && parseBoolean(routeContext, definition.getParallelProcessing());
-        boolean isStreaming = definition.getStreaming() != null && parseBoolean(routeContext, definition.getStreaming());
-        boolean isParallelAggregate = definition.getParallelAggregate() != null && parseBoolean(routeContext, definition.getParallelAggregate());
-        boolean isShareUnitOfWork = definition.getShareUnitOfWork() != null && parseBoolean(routeContext, definition.getShareUnitOfWork());
-        boolean isStopOnException = definition.getStopOnException() != null && parseBoolean(routeContext, definition.getStopOnException());
-        boolean isIgnoreInvalidEndpoints = definition.getIgnoreInvalidEndpoints() != null && parseBoolean(routeContext, definition.getIgnoreInvalidEndpoints());
-        boolean isStopOnAggregateException = definition.getStopOnAggregateException() != null && parseBoolean(routeContext, definition.getStopOnAggregateException());
+        boolean isParallelProcessing = definition.getParallelProcessing() != null && parseBoolean(definition.getParallelProcessing());
+        boolean isStreaming = definition.getStreaming() != null && parseBoolean(definition.getStreaming());
+        boolean isParallelAggregate = definition.getParallelAggregate() != null && parseBoolean(definition.getParallelAggregate());
+        boolean isShareUnitOfWork = definition.getShareUnitOfWork() != null && parseBoolean(definition.getShareUnitOfWork());
+        boolean isStopOnException = definition.getStopOnException() != null && parseBoolean(definition.getStopOnException());
+        boolean isIgnoreInvalidEndpoints = definition.getIgnoreInvalidEndpoints() != null && parseBoolean(definition.getIgnoreInvalidEndpoints());
+        boolean isStopOnAggregateException = definition.getStopOnAggregateException() != null && parseBoolean(definition.getStopOnAggregateException());
 
         RecipientList answer;
         if (definition.getDelimiter() != null) {
-            answer = new RecipientList(routeContext.getCamelContext(), expression, definition.getDelimiter());
+            answer = new RecipientList(camelContext, expression, definition.getDelimiter());
         } else {
-            answer = new RecipientList(routeContext.getCamelContext(), expression);
+            answer = new RecipientList(camelContext, expression);
         }
         answer.setAggregationStrategy(createAggregationStrategy(routeContext));
         answer.setParallelProcessing(isParallelProcessing);
@@ -69,23 +69,23 @@ public class RecipientListReifier extends ProcessorReifier<RecipientListDefiniti
         answer.setIgnoreInvalidEndpoints(isIgnoreInvalidEndpoints);
         answer.setStopOnAggregateException(isStopOnAggregateException);
         if (definition.getCacheSize() != null) {
-            answer.setCacheSize(parseInt(routeContext, definition.getCacheSize()));
+            answer.setCacheSize(parseInt(definition.getCacheSize()));
         }
         if (definition.getOnPrepareRef() != null) {
-            definition.setOnPrepare(CamelContextHelper.mandatoryLookup(routeContext.getCamelContext(), definition.getOnPrepareRef(), Processor.class));
+            definition.setOnPrepare(CamelContextHelper.mandatoryLookup(camelContext, definition.getOnPrepareRef(), Processor.class));
         }
         if (definition.getOnPrepare() != null) {
             answer.setOnPrepare(definition.getOnPrepare());
         }
         if (definition.getTimeout() != null) {
-            answer.setTimeout(parseLong(routeContext, definition.getTimeout()));
+            answer.setTimeout(parseLong(definition.getTimeout()));
         }
 
         boolean shutdownThreadPool = ProcessorDefinitionHelper.willCreateNewThreadPool(routeContext, definition, isParallelProcessing);
         ExecutorService threadPool = ProcessorDefinitionHelper.getConfiguredExecutorService(routeContext, "RecipientList", definition, isParallelProcessing);
         answer.setExecutorService(threadPool);
         answer.setShutdownExecutorService(shutdownThreadPool);
-        long timeout = definition.getTimeout() != null ? parseLong(routeContext, definition.getTimeout()) : 0;
+        long timeout = definition.getTimeout() != null ? parseLong(definition.getTimeout()) : 0;
         if (timeout > 0 && !isParallelProcessing) {
             throw new IllegalArgumentException("Timeout is used but ParallelProcessing has not been enabled.");
         }
@@ -109,7 +109,7 @@ public class RecipientListReifier extends ProcessorReifier<RecipientListDefiniti
 
         // wrap in nested pipeline so this appears as one processor
         // (threads definition does this as well)
-        return new Pipeline(routeContext.getCamelContext(), pipe);
+        return new Pipeline(camelContext, pipe);
     }
 
     private AggregationStrategy createAggregationStrategy(RouteContext routeContext) {
@@ -121,8 +121,8 @@ public class RecipientListReifier extends ProcessorReifier<RecipientListDefiniti
             } else if (aggStrategy != null) {
                 AggregationStrategyBeanAdapter adapter = new AggregationStrategyBeanAdapter(aggStrategy, definition.getStrategyMethodName());
                 if (definition.getStrategyMethodAllowNull() != null) {
-                    adapter.setAllowNullNewExchange(parseBoolean(routeContext, definition.getStrategyMethodAllowNull()));
-                    adapter.setAllowNullOldExchange(parseBoolean(routeContext, definition.getStrategyMethodAllowNull()));
+                    adapter.setAllowNullNewExchange(parseBoolean(definition.getStrategyMethodAllowNull()));
+                    adapter.setAllowNullOldExchange(parseBoolean(definition.getStrategyMethodAllowNull()));
                 }
                 strategy = adapter;
             } else {
@@ -136,10 +136,10 @@ public class RecipientListReifier extends ProcessorReifier<RecipientListDefiniti
         }
 
         if (strategy instanceof CamelContextAware) {
-            ((CamelContextAware)strategy).setCamelContext(routeContext.getCamelContext());
+            ((CamelContextAware)strategy).setCamelContext(camelContext);
         }
 
-        if (definition.getShareUnitOfWork() != null && parseBoolean(routeContext, definition.getShareUnitOfWork())) {
+        if (definition.getShareUnitOfWork() != null && parseBoolean(definition.getShareUnitOfWork())) {
             // wrap strategy in share unit of work
             strategy = new ShareUnitOfWorkAggregationStrategy(strategy);
         }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/RemoveHeaderReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/RemoveHeaderReifier.java
index 0d2c177..77bafe5 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/RemoveHeaderReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/RemoveHeaderReifier.java
@@ -25,12 +25,12 @@ import org.apache.camel.util.ObjectHelper;
 
 public class RemoveHeaderReifier extends ProcessorReifier<RemoveHeaderDefinition> {
 
-    public RemoveHeaderReifier(ProcessorDefinition<?> definition) {
-        super((RemoveHeaderDefinition)definition);
+    public RemoveHeaderReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, (RemoveHeaderDefinition) definition);
     }
 
     @Override
-    public Processor createProcessor(RouteContext routeContext) throws Exception {
+    public Processor createProcessor() throws Exception {
         ObjectHelper.notNull(definition.getHeaderName(), "headerName", this);
         return new RemoveHeaderProcessor(definition.getHeaderName());
     }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/RemoveHeadersReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/RemoveHeadersReifier.java
index bfdc7d1..f277857 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/RemoveHeadersReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/RemoveHeadersReifier.java
@@ -25,12 +25,12 @@ import org.apache.camel.util.ObjectHelper;
 
 public class RemoveHeadersReifier extends ProcessorReifier<RemoveHeadersDefinition> {
 
-    public RemoveHeadersReifier(ProcessorDefinition<?> definition) {
-        super((RemoveHeadersDefinition)definition);
+    public RemoveHeadersReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, (RemoveHeadersDefinition) definition);
     }
 
     @Override
-    public Processor createProcessor(RouteContext routeContext) throws Exception {
+    public Processor createProcessor() throws Exception {
         ObjectHelper.notNull(definition.getPattern(), "patterns", definition);
         if (definition.getExcludePatterns() != null) {
             return new RemoveHeadersProcessor(definition.getPattern(), definition.getExcludePatterns());
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/RemovePropertiesReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/RemovePropertiesReifier.java
index 4805d32..690db88 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/RemovePropertiesReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/RemovePropertiesReifier.java
@@ -25,12 +25,12 @@ import org.apache.camel.util.ObjectHelper;
 
 public class RemovePropertiesReifier extends ProcessorReifier<RemovePropertiesDefinition> {
 
-    public RemovePropertiesReifier(ProcessorDefinition<?> definition) {
-        super((RemovePropertiesDefinition)definition);
+    public RemovePropertiesReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, (RemovePropertiesDefinition) definition);
     }
 
     @Override
-    public Processor createProcessor(RouteContext routeContext) throws Exception {
+    public Processor createProcessor() throws Exception {
         ObjectHelper.notNull(definition.getPattern(), "patterns", this);
         if (definition.getExcludePatterns() != null) {
             return new RemovePropertiesProcessor(definition.getPattern(), definition.getExcludePatterns());
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/RemovePropertyReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/RemovePropertyReifier.java
index 58d8c93..5785186 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/RemovePropertyReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/RemovePropertyReifier.java
@@ -25,12 +25,12 @@ import org.apache.camel.util.ObjectHelper;
 
 public class RemovePropertyReifier extends ProcessorReifier<RemovePropertyDefinition> {
 
-    public RemovePropertyReifier(ProcessorDefinition<?> definition) {
-        super((RemovePropertyDefinition)definition);
+    public RemovePropertyReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, (RemovePropertyDefinition)definition);
     }
 
     @Override
-    public Processor createProcessor(RouteContext routeContext) throws Exception {
+    public Processor createProcessor() throws Exception {
         ObjectHelper.notNull(definition.getPropertyName(), "propertyName", this);
         return new RemovePropertyProcessor(definition.getPropertyName());
     }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ResequenceReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ResequenceReifier.java
index c2243ac..ca70fb1 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ResequenceReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ResequenceReifier.java
@@ -33,12 +33,12 @@ import org.apache.camel.util.ObjectHelper;
 
 public class ResequenceReifier extends ProcessorReifier<ResequenceDefinition> {
 
-    public ResequenceReifier(ProcessorDefinition<?> definition) {
-        super((ResequenceDefinition)definition);
+    public ResequenceReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, (ResequenceDefinition)definition);
     }
 
     @Override
-    public Processor createProcessor(RouteContext routeContext) throws Exception {
+    public Processor createProcessor() throws Exception {
         // if configured from XML then streamConfig has been set with the
         // configuration
         if (definition.getResequencerConfig() != null) {
@@ -71,26 +71,26 @@ public class ResequenceReifier extends ProcessorReifier<ResequenceDefinition> {
      */
     @SuppressWarnings("deprecation")
     protected Resequencer createBatchResequencer(RouteContext routeContext, BatchResequencerConfig config) throws Exception {
-        Processor processor = this.createChildProcessor(routeContext, true);
+        Processor processor = this.createChildProcessor(true);
         Expression expression = definition.getExpression().createExpression(routeContext);
 
         // and wrap in unit of work
-        CamelInternalProcessor internal = new CamelInternalProcessor(routeContext.getCamelContext(), processor);
-        internal.addAdvice(new CamelInternalProcessor.UnitOfWorkProcessorAdvice(routeContext, routeContext.getCamelContext()));
+        CamelInternalProcessor internal = new CamelInternalProcessor(camelContext, processor);
+        internal.addAdvice(new CamelInternalProcessor.UnitOfWorkProcessorAdvice(routeContext, camelContext));
 
         ObjectHelper.notNull(config, "config", this);
         ObjectHelper.notNull(expression, "expression", this);
 
-        boolean isReverse = config.getReverse() != null && parseBoolean(routeContext, config.getReverse());
-        boolean isAllowDuplicates = config.getAllowDuplicates() != null && parseBoolean(routeContext, config.getAllowDuplicates());
+        boolean isReverse = config.getReverse() != null && parseBoolean(config.getReverse());
+        boolean isAllowDuplicates = config.getAllowDuplicates() != null && parseBoolean(config.getAllowDuplicates());
 
-        Resequencer resequencer = new Resequencer(routeContext.getCamelContext(), internal, expression, isAllowDuplicates, isReverse);
-        resequencer.setBatchSize(parseInt(routeContext, config.getBatchSize()));
-        resequencer.setBatchTimeout(parseLong(routeContext, config.getBatchTimeout()));
+        Resequencer resequencer = new Resequencer(camelContext, internal, expression, isAllowDuplicates, isReverse);
+        resequencer.setBatchSize(parseInt(config.getBatchSize()));
+        resequencer.setBatchTimeout(parseLong(config.getBatchTimeout()));
         resequencer.setReverse(isReverse);
         resequencer.setAllowDuplicates(isAllowDuplicates);
         if (config.getIgnoreInvalidExchanges() != null) {
-            resequencer.setIgnoreInvalidExchanges(parseBoolean(routeContext, config.getIgnoreInvalidExchanges()));
+            resequencer.setIgnoreInvalidExchanges(parseBoolean(config.getIgnoreInvalidExchanges()));
         }
         return resequencer;
     }
@@ -105,18 +105,18 @@ public class ResequenceReifier extends ProcessorReifier<ResequenceDefinition> {
      * @throws Exception can be thrwon
      */
     protected StreamResequencer createStreamResequencer(RouteContext routeContext, StreamResequencerConfig config) throws Exception {
-        Processor processor = this.createChildProcessor(routeContext, true);
+        Processor processor = this.createChildProcessor(true);
         Expression expression = definition.getExpression().createExpression(routeContext);
 
-        CamelInternalProcessor internal = new CamelInternalProcessor(routeContext.getCamelContext(), processor);
-        internal.addAdvice(new CamelInternalProcessor.UnitOfWorkProcessorAdvice(routeContext, routeContext.getCamelContext()));
+        CamelInternalProcessor internal = new CamelInternalProcessor(camelContext, processor);
+        internal.addAdvice(new CamelInternalProcessor.UnitOfWorkProcessorAdvice(routeContext, camelContext));
 
         ObjectHelper.notNull(config, "config", this);
         ObjectHelper.notNull(expression, "expression", this);
 
         ExpressionResultComparator comparator;
         if (config.getComparatorRef() != null) {
-            comparator = CamelContextHelper.mandatoryLookup(routeContext.getCamelContext(), config.getComparatorRef(), ExpressionResultComparator.class);
+            comparator = CamelContextHelper.mandatoryLookup(camelContext, config.getComparatorRef(), ExpressionResultComparator.class);
         } else {
             comparator = config.getComparator();
             if (comparator == null) {
@@ -125,15 +125,15 @@ public class ResequenceReifier extends ProcessorReifier<ResequenceDefinition> {
         }
         comparator.setExpression(expression);
 
-        StreamResequencer resequencer = new StreamResequencer(routeContext.getCamelContext(), internal, comparator, expression);
-        resequencer.setTimeout(parseLong(routeContext, config.getTimeout()));
+        StreamResequencer resequencer = new StreamResequencer(camelContext, internal, comparator, expression);
+        resequencer.setTimeout(parseLong(config.getTimeout()));
         if (config.getDeliveryAttemptInterval() != null) {
-            resequencer.setDeliveryAttemptInterval(parseLong(routeContext, config.getDeliveryAttemptInterval()));
+            resequencer.setDeliveryAttemptInterval(parseLong(config.getDeliveryAttemptInterval()));
         }
-        resequencer.setCapacity(parseInt(routeContext, config.getCapacity()));
-        resequencer.setRejectOld(parseBoolean(routeContext, config.getRejectOld()));
+        resequencer.setCapacity(parseInt(config.getCapacity()));
+        resequencer.setRejectOld(parseBoolean(config.getRejectOld()));
         if (config.getIgnoreInvalidExchanges() != null) {
-            resequencer.setIgnoreInvalidExchanges(parseBoolean(routeContext, config.getIgnoreInvalidExchanges()));
+            resequencer.setIgnoreInvalidExchanges(parseBoolean(config.getIgnoreInvalidExchanges()));
         }
         return resequencer;
     }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/RollbackReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/RollbackReifier.java
index 08c2a59..9369413 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/RollbackReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/RollbackReifier.java
@@ -24,14 +24,14 @@ import org.apache.camel.spi.RouteContext;
 
 public class RollbackReifier extends ProcessorReifier<RollbackDefinition> {
 
-    public RollbackReifier(ProcessorDefinition<?> definition) {
-        super((RollbackDefinition)definition);
+    public RollbackReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, (RollbackDefinition)definition);
     }
 
     @Override
-    public Processor createProcessor(RouteContext routeContext) {
-        boolean isMarkRollbackOnly = definition.getMarkRollbackOnly() != null && parseBoolean(routeContext, definition.getMarkRollbackOnly());
-        boolean isMarkRollbackOnlyLast = definition.getMarkRollbackOnlyLast() != null && parseBoolean(routeContext, definition.getMarkRollbackOnlyLast());
+    public Processor createProcessor() {
+        boolean isMarkRollbackOnly = definition.getMarkRollbackOnly() != null && parseBoolean(definition.getMarkRollbackOnly());
+        boolean isMarkRollbackOnlyLast = definition.getMarkRollbackOnlyLast() != null && parseBoolean(definition.getMarkRollbackOnlyLast());
 
         // validate that only either mark rollbacks is chosen and not both
         if (isMarkRollbackOnly && isMarkRollbackOnlyLast) {
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/RouteReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/RouteReifier.java
index 6476133..04b972b 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/RouteReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/RouteReifier.java
@@ -50,8 +50,12 @@ import org.apache.camel.util.ObjectHelper;
 
 public class RouteReifier extends ProcessorReifier<RouteDefinition> {
 
-    public RouteReifier(ProcessorDefinition<?> definition) {
-        super((RouteDefinition)definition);
+    public RouteReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, (RouteDefinition) definition);
+    }
+
+    public RouteReifier(CamelContext camelContext, ProcessorDefinition<?> definition) {
+        super(camelContext, (RouteDefinition) definition);
     }
 
     /**
@@ -94,15 +98,15 @@ public class RouteReifier extends ProcessorReifier<RouteDefinition> {
         if (definition.getInput() == null) {
             throw new IllegalArgumentException("RouteDefinition has no input");
         }
-        return new RouteReifier(definition).adviceWith(camelContext, builder);
+        return new RouteReifier(camelContext, definition).adviceWith(builder);
     }
 
     @Override
-    public Processor createProcessor(RouteContext routeContext) throws Exception {
+    public Processor createProcessor() throws Exception {
         throw new UnsupportedOperationException("Not implemented for RouteDefinition");
     }
 
-    public Route createRoute(CamelContext camelContext, RouteContext routeContext) {
+    public Route createRoute() {
         try {
             return doCreateRoute(camelContext, routeContext);
         } catch (FailedToCreateRouteException e) {
@@ -114,7 +118,7 @@ public class RouteReifier extends ProcessorReifier<RouteDefinition> {
         }
     }
 
-    public Endpoint resolveEndpoint(CamelContext camelContext, String uri) throws NoSuchEndpointException {
+    public Endpoint resolveEndpoint(String uri) throws NoSuchEndpointException {
         ObjectHelper.notNull(camelContext, "CamelContext");
         return CamelContextHelper.getMandatoryEndpoint(camelContext, uri);
     }
@@ -145,15 +149,13 @@ public class RouteReifier extends ProcessorReifier<RouteDefinition> {
      * Will stop and remove the old route from camel context and add and start
      * this new advised route.
      *
-     * @param camelContext the camel context
      * @param builder the route builder
      * @return a new route which is this route merged with the route builder
      * @throws Exception can be thrown from the route builder
      * @see AdviceWithRouteBuilder
      */
     @SuppressWarnings("deprecation")
-    public RouteDefinition adviceWith(CamelContext camelContext, RouteBuilder builder) throws Exception {
-        ObjectHelper.notNull(camelContext, "CamelContext");
+    public RouteDefinition adviceWith(RouteBuilder builder) throws Exception {
         ObjectHelper.notNull(builder, "RouteBuilder");
 
         log.debug("AdviceWith route before: {}", this);
@@ -359,7 +361,7 @@ public class RouteReifier extends ProcessorReifier<RouteDefinition> {
         if (endpoint == null) {
             EndpointConsumerBuilder def = definition.getInput().getEndpointConsumerBuilder();
             if (def != null) {
-                endpoint = def.resolve(routeContext.getCamelContext());
+                endpoint = def.resolve(camelContext);
             } else {
                 endpoint = routeContext.resolveEndpoint(definition.getInput().getEndpointUri());
             }
@@ -382,7 +384,7 @@ public class RouteReifier extends ProcessorReifier<RouteDefinition> {
         List<ProcessorDefinition<?>> list = new ArrayList<>(definition.getOutputs());
         for (ProcessorDefinition<?> output : list) {
             try {
-                ProcessorReifier.reifier(output).addRoutes(routeContext);
+                ProcessorReifier.reifier(routeContext, output).addRoutes(routeContext);
             } catch (Exception e) {
                 throw new FailedToCreateRouteException(definition.getId(), definition.toString(), output.toString(), e);
             }
@@ -390,7 +392,7 @@ public class RouteReifier extends ProcessorReifier<RouteDefinition> {
 
         if (definition.getRestBindingDefinition() != null) {
             try {
-                routeContext.addAdvice(new RestBindingReifier(definition.getRestBindingDefinition()).createRestBindingAdvice(routeContext));
+                routeContext.addAdvice(new RestBindingReifier(routeContext, definition.getRestBindingDefinition()).createRestBindingAdvice());
             } catch (Exception e) {
                 throw RuntimeCamelException.wrapRuntimeCamelException(e);
             }
@@ -400,12 +402,12 @@ public class RouteReifier extends ProcessorReifier<RouteDefinition> {
         if (definition.getInputType() != null || definition.getOutputType() != null) {
             Contract contract = new Contract();
             if (definition.getInputType() != null) {
-                contract.setInputType(parseString(routeContext, definition.getInputType().getUrn()));
-                contract.setValidateInput(parseBoolean(routeContext, definition.getInputType().getValidate()));
+                contract.setInputType(parseString(definition.getInputType().getUrn()));
+                contract.setValidateInput(parseBoolean(definition.getInputType().getValidate()));
             }
             if (definition.getOutputType() != null) {
-                contract.setOutputType(parseString(routeContext, definition.getOutputType().getUrn()));
-                contract.setValidateOutput(parseBoolean(routeContext, definition.getOutputType().getValidate()));
+                contract.setOutputType(parseString(definition.getOutputType().getUrn()));
+                contract.setValidateOutput(parseBoolean(definition.getOutputType().getValidate()));
             }
             routeContext.addAdvice(new ContractAdvice(contract));
             // make sure to enable data type as its in use when using
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/RoutingSlipReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/RoutingSlipReifier.java
index f88150d..d1b5659 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/RoutingSlipReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/RoutingSlipReifier.java
@@ -30,21 +30,21 @@ import static org.apache.camel.model.RoutingSlipDefinition.DEFAULT_DELIMITER;
 
 public class RoutingSlipReifier extends ExpressionReifier<RoutingSlipDefinition<?>> {
 
-    public RoutingSlipReifier(ProcessorDefinition<?> definition) {
-        super((RoutingSlipDefinition)definition);
+    public RoutingSlipReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, (RoutingSlipDefinition) definition);
     }
 
     @Override
-    public Processor createProcessor(RouteContext routeContext) throws Exception {
+    public Processor createProcessor() throws Exception {
         Expression expression = definition.getExpression().createExpression(routeContext);
         String delimiter = definition.getUriDelimiter() != null ? definition.getUriDelimiter() : DEFAULT_DELIMITER;
 
-        RoutingSlip routingSlip = new RoutingSlip(routeContext.getCamelContext(), expression, delimiter);
+        RoutingSlip routingSlip = new RoutingSlip(camelContext, expression, delimiter);
         if (definition.getIgnoreInvalidEndpoints() != null) {
-            routingSlip.setIgnoreInvalidEndpoints(parseBoolean(routeContext, definition.getIgnoreInvalidEndpoints()));
+            routingSlip.setIgnoreInvalidEndpoints(parseBoolean(definition.getIgnoreInvalidEndpoints()));
         }
         if (definition.getCacheSize() != null) {
-            routingSlip.setCacheSize(parseInt(routeContext, definition.getCacheSize()));
+            routingSlip.setCacheSize(parseInt(definition.getCacheSize()));
         }
 
         // and wrap this in an error handler
@@ -52,7 +52,7 @@ public class RoutingSlipReifier extends ExpressionReifier<RoutingSlipDefinition<
         // create error handler (create error handler directly to keep it light
         // weight,
         // instead of using ProcessorDefinition.wrapInErrorHandler)
-        AsyncProcessor errorHandler = (AsyncProcessor)ErrorHandlerReifier.reifier(builder).createErrorHandler(routeContext, routingSlip.newRoutingSlipProcessorForErrorHandler());
+        AsyncProcessor errorHandler = (AsyncProcessor)ErrorHandlerReifier.reifier(routeContext, builder).createErrorHandler(routingSlip.newRoutingSlipProcessorForErrorHandler());
         routingSlip.setErrorHandler(errorHandler);
 
         return routingSlip;
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/SagaReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/SagaReifier.java
index 6f4aa21..3e207a7 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/SagaReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/SagaReifier.java
@@ -39,12 +39,12 @@ import org.apache.camel.support.CamelContextHelper;
 
 public class SagaReifier extends ProcessorReifier<SagaDefinition> {
 
-    public SagaReifier(ProcessorDefinition<?> definition) {
-        super((SagaDefinition)definition);
+    public SagaReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, (SagaDefinition)definition);
     }
 
     @Override
-    public Processor createProcessor(RouteContext routeContext) throws Exception {
+    public Processor createProcessor() throws Exception {
         Optional<Endpoint> compensationEndpoint = Optional.ofNullable(definition.getCompensation()).map(SagaActionUriDefinition::getUri).map(routeContext::resolveEndpoint);
 
         Optional<Endpoint> completionEndpoint = Optional.ofNullable(definition.getCompletion()).map(SagaActionUriDefinition::getUri).map(routeContext::resolveEndpoint);
@@ -72,12 +72,12 @@ public class SagaReifier extends ProcessorReifier<SagaDefinition> {
             completionMode = SagaCompletionMode.defaultCompletionMode();
         }
 
-        Processor childProcessor = this.createChildProcessor(routeContext, true);
-        CamelSagaService camelSagaService = findSagaService(routeContext.getCamelContext());
+        Processor childProcessor = this.createChildProcessor(true);
+        CamelSagaService camelSagaService = findSagaService(camelContext);
 
         camelSagaService.registerStep(step);
 
-        return new SagaProcessorBuilder().camelContext(routeContext.getCamelContext()).childProcessor(childProcessor).sagaService(camelSagaService).step(step)
+        return new SagaProcessorBuilder().camelContext(camelContext).childProcessor(childProcessor).sagaService(camelSagaService).step(step)
             .propagation(propagation(propagation)).completionMode(completionMode(completionMode)).build();
     }
 
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/SamplingReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/SamplingReifier.java
index 963a894..faff0bc 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/SamplingReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/SamplingReifier.java
@@ -26,12 +26,12 @@ import org.apache.camel.spi.RouteContext;
 
 public class SamplingReifier extends ProcessorReifier<SamplingDefinition> {
 
-    public SamplingReifier(ProcessorDefinition<?> definition) {
-        super((SamplingDefinition)definition);
+    public SamplingReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, (SamplingDefinition)definition);
     }
 
     @Override
-    public Processor createProcessor(RouteContext routeContext) throws Exception {
+    public Processor createProcessor() throws Exception {
         if (definition.getMessageFrequency() != null) {
             return new SamplingThrottler(definition.getMessageFrequency());
         } else {
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ScriptReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ScriptReifier.java
index a58d8ea..36ad49f 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ScriptReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ScriptReifier.java
@@ -25,12 +25,12 @@ import org.apache.camel.spi.RouteContext;
 
 public class ScriptReifier extends ExpressionReifier<ScriptDefinition> {
 
-    public ScriptReifier(ProcessorDefinition<?> definition) {
-        super((ScriptDefinition)definition);
+    public ScriptReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, (ScriptDefinition)definition);
     }
 
     @Override
-    public Processor createProcessor(RouteContext routeContext) throws Exception {
+    public Processor createProcessor() throws Exception {
         Expression expr = definition.getExpression().createExpression(routeContext);
         return new ScriptProcessor(expr);
     }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/SendReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/SendReifier.java
index b1a6d3f..583cefa 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/SendReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/SendReifier.java
@@ -26,14 +26,14 @@ import org.apache.camel.spi.RouteContext;
 
 public class SendReifier extends ProcessorReifier<SendDefinition<?>> {
 
-    public SendReifier(ProcessorDefinition<?> definition) {
-        super((SendDefinition)definition);
+    public SendReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, (SendDefinition) definition);
     }
 
     @Override
-    public Processor createProcessor(RouteContext routeContext) throws Exception {
+    public Processor createProcessor() throws Exception {
         Endpoint endpoint = resolveEndpoint(routeContext);
-        return new SendProcessor(endpoint, parse(routeContext, ExchangePattern.class, definition.getPattern()));
+        return new SendProcessor(endpoint, parse(ExchangePattern.class, definition.getPattern()));
     }
 
     public Endpoint resolveEndpoint(RouteContext context) {
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ServiceCallReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ServiceCallReifier.java
index a567854..84368e6 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ServiceCallReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ServiceCallReifier.java
@@ -23,12 +23,12 @@ import org.apache.camel.spi.RouteContext;
 
 public class ServiceCallReifier extends ProcessorReifier<ServiceCallDefinition> {
 
-    public ServiceCallReifier(ProcessorDefinition<?> definition) {
-        super(ServiceCallDefinition.class.cast(definition));
+    public ServiceCallReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, ServiceCallDefinition.class.cast(definition));
     }
 
     @Override
-    public Processor createProcessor(RouteContext routeContext) throws Exception {
+    public Processor createProcessor() throws Exception {
         throw new IllegalStateException("Cannot find camel-cloud on the classpath.");
     }
 
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/SetBodyReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/SetBodyReifier.java
index d8a51d8..2490e02 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/SetBodyReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/SetBodyReifier.java
@@ -25,12 +25,12 @@ import org.apache.camel.spi.RouteContext;
 
 public class SetBodyReifier extends ExpressionReifier<SetBodyDefinition> {
 
-    public SetBodyReifier(ProcessorDefinition<?> definition) {
-        super((SetBodyDefinition)definition);
+    public SetBodyReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, (SetBodyDefinition)definition);
     }
 
     @Override
-    public Processor createProcessor(RouteContext routeContext) throws Exception {
+    public Processor createProcessor() throws Exception {
         Expression expr = definition.getExpression().createExpression(routeContext);
         return new SetBodyProcessor(expr);
     }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/SetExchangePatternReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/SetExchangePatternReifier.java
index 52e0755..1262438 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/SetExchangePatternReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/SetExchangePatternReifier.java
@@ -24,12 +24,12 @@ import org.apache.camel.spi.RouteContext;
 
 public class SetExchangePatternReifier extends ProcessorReifier<SetExchangePatternDefinition> {
 
-    SetExchangePatternReifier(ProcessorDefinition<?> definition) {
-        super((SetExchangePatternDefinition)definition);
+    SetExchangePatternReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, (SetExchangePatternDefinition)definition);
     }
 
     @Override
-    public Processor createProcessor(RouteContext routeContext) {
+    public Processor createProcessor() {
         return new ExchangePatternProcessor(definition.getPattern());
     }
 }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/SetHeaderReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/SetHeaderReifier.java
index 7d51ed0..bc26948 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/SetHeaderReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/SetHeaderReifier.java
@@ -27,15 +27,15 @@ import org.apache.camel.util.ObjectHelper;
 
 public class SetHeaderReifier extends ExpressionReifier<SetHeaderDefinition> {
 
-    public SetHeaderReifier(ProcessorDefinition<?> definition) {
-        super((SetHeaderDefinition)definition);
+    public SetHeaderReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, (SetHeaderDefinition)definition);
     }
 
     @Override
-    public Processor createProcessor(RouteContext routeContext) throws Exception {
+    public Processor createProcessor() throws Exception {
         ObjectHelper.notNull(definition.getName(), "headerName");
         Expression expr = definition.getExpression().createExpression(routeContext);
-        Expression nameExpr = ExpressionBuilder.parseSimpleOrFallbackToConstantExpression(definition.getName(), routeContext.getCamelContext());
+        Expression nameExpr = ExpressionBuilder.parseSimpleOrFallbackToConstantExpression(definition.getName(), camelContext);
         return new SetHeaderProcessor(nameExpr, expr);
     }
 }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/SetPropertyReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/SetPropertyReifier.java
index 6e68971..dd779bc 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/SetPropertyReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/SetPropertyReifier.java
@@ -27,15 +27,15 @@ import org.apache.camel.util.ObjectHelper;
 
 public class SetPropertyReifier extends ExpressionReifier<SetPropertyDefinition> {
 
-    public SetPropertyReifier(ProcessorDefinition<?> definition) {
-        super((SetPropertyDefinition)definition);
+    public SetPropertyReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, (SetPropertyDefinition)definition);
     }
 
     @Override
-    public Processor createProcessor(RouteContext routeContext) throws Exception {
+    public Processor createProcessor() throws Exception {
         ObjectHelper.notNull(definition.getName(), "propertyName", this);
         Expression expr = definition.getExpression().createExpression(routeContext);
-        Expression nameExpr = ExpressionBuilder.parseSimpleOrFallbackToConstantExpression(definition.getName(), routeContext.getCamelContext());
+        Expression nameExpr = ExpressionBuilder.parseSimpleOrFallbackToConstantExpression(definition.getName(), camelContext);
         return new SetPropertyProcessor(nameExpr, expr);
     }
 }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/SortReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/SortReifier.java
index d7f2527..c7e30dd 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/SortReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/SortReifier.java
@@ -31,13 +31,13 @@ import static org.apache.camel.util.ObjectHelper.isNotEmpty;
 
 public class SortReifier<T, U extends SortDefinition<T>> extends ExpressionReifier<U> {
 
-    public SortReifier(ProcessorDefinition<?> definition) {
-        super((U)definition);
+    public SortReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, (U) definition);
     }
 
     @Override
     @SuppressWarnings("unchecked")
-    public Processor createProcessor(RouteContext routeContext) throws Exception {
+    public Processor createProcessor() throws Exception {
         // lookup in registry
         if (isNotEmpty(definition.getComparatorRef())) {
             definition.setComparator(routeContext.lookup(definition.getComparatorRef(), Comparator.class));
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/SplitReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/SplitReifier.java
index be57f88..8d1bda4 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/SplitReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/SplitReifier.java
@@ -33,14 +33,14 @@ import org.apache.camel.support.CamelContextHelper;
 
 public class SplitReifier extends ExpressionReifier<SplitDefinition> {
 
-    public SplitReifier(ProcessorDefinition<?> definition) {
-        super((SplitDefinition)definition);
+    public SplitReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, (SplitDefinition)definition);
     }
 
     @Override
-    public Processor createProcessor(RouteContext routeContext) throws Exception {
-        Processor childProcessor = this.createChildProcessor(routeContext, true);
-        definition.setAggregationStrategy(createAggregationStrategy(routeContext));
+    public Processor createProcessor() throws Exception {
+        Processor childProcessor = this.createChildProcessor(true);
+        definition.setAggregationStrategy(createAggregationStrategy());
 
         boolean isParallelProcessing = definition.getParallelProcessing() != null && definition.getParallelProcessing();
         boolean isStreaming = definition.getStreaming() != null && definition.getStreaming();
@@ -55,18 +55,18 @@ public class SplitReifier extends ExpressionReifier<SplitDefinition> {
             throw new IllegalArgumentException("Timeout is used but ParallelProcessing has not been enabled.");
         }
         if (definition.getOnPrepareRef() != null) {
-            definition.setOnPrepare(CamelContextHelper.mandatoryLookup(routeContext.getCamelContext(), definition.getOnPrepareRef(), Processor.class));
+            definition.setOnPrepare(CamelContextHelper.mandatoryLookup(camelContext, definition.getOnPrepareRef(), Processor.class));
         }
 
         Expression exp = definition.getExpression().createExpression(routeContext);
 
-        Splitter answer = new Splitter(routeContext.getCamelContext(), exp, childProcessor, definition.getAggregationStrategy(), isParallelProcessing, threadPool,
+        Splitter answer = new Splitter(camelContext, exp, childProcessor, definition.getAggregationStrategy(), isParallelProcessing, threadPool,
                                        shutdownThreadPool, isStreaming, definition.isStopOnException(), timeout, definition.getOnPrepare(), isShareUnitOfWork, isParallelAggregate,
                                        isStopOnAggregateException);
         return answer;
     }
 
-    private AggregationStrategy createAggregationStrategy(RouteContext routeContext) {
+    private AggregationStrategy createAggregationStrategy() {
         AggregationStrategy strategy = definition.getAggregationStrategy();
         if (strategy == null && definition.getStrategyRef() != null) {
             Object aggStrategy = routeContext.lookup(definition.getStrategyRef(), Object.class);
@@ -85,7 +85,7 @@ public class SplitReifier extends ExpressionReifier<SplitDefinition> {
         }
 
         if (strategy instanceof CamelContextAware) {
-            ((CamelContextAware)strategy).setCamelContext(routeContext.getCamelContext());
+            ((CamelContextAware)strategy).setCamelContext(camelContext);
         }
 
         if (strategy != null && definition.getShareUnitOfWork() != null && definition.getShareUnitOfWork()) {
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/StepReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/StepReifier.java
index 35b66aa..fcfb79a 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/StepReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/StepReifier.java
@@ -26,18 +26,18 @@ import org.apache.camel.spi.RouteContext;
 
 public class StepReifier extends ProcessorReifier<StepDefinition> {
 
-    public StepReifier(ProcessorDefinition<?> definition) {
-        super(StepDefinition.class.cast(definition));
+    public StepReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, StepDefinition.class.cast(definition));
     }
 
     @Override
-    public Processor createProcessor(RouteContext routeContext) throws Exception {
-        return this.createChildProcessor(routeContext, true);
+    public Processor createProcessor() throws Exception {
+        return this.createChildProcessor(true);
     }
 
     @Override
-    protected Processor createCompositeProcessor(RouteContext routeContext, List<Processor> list) throws Exception {
+    protected Processor createCompositeProcessor(List<Processor> list) throws Exception {
         String stepId = getId(definition, routeContext);
-        return StepProcessor.newInstance(routeContext.getCamelContext(), list, stepId);
+        return StepProcessor.newInstance(camelContext, list, stepId);
     }
 }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/StopReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/StopReifier.java
index 3b8fc41..7e405dc 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/StopReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/StopReifier.java
@@ -24,12 +24,12 @@ import org.apache.camel.spi.RouteContext;
 
 public class StopReifier extends ProcessorReifier<StopDefinition> {
 
-    public StopReifier(ProcessorDefinition<?> definition) {
-        super((StopDefinition)definition);
+    public StopReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, (StopDefinition) definition);
     }
 
     @Override
-    public Processor createProcessor(RouteContext routeContext) throws Exception {
+    public Processor createProcessor() throws Exception {
         return new StopProcessor();
     }
 }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ThreadsReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ThreadsReifier.java
index 0368904..f66a43f 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ThreadsReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ThreadsReifier.java
@@ -32,12 +32,12 @@ import org.apache.camel.util.concurrent.ThreadPoolRejectedPolicy;
 
 public class ThreadsReifier extends ProcessorReifier<ThreadsDefinition> {
 
-    public ThreadsReifier(ProcessorDefinition<?> definition) {
-        super((ThreadsDefinition)definition);
+    public ThreadsReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, (ThreadsDefinition) definition);
     }
 
     @Override
-    public Processor createProcessor(RouteContext routeContext) throws Exception {
+    public Processor createProcessor() throws Exception {
         // the threads name
         String name = definition.getThreadName() != null ? definition.getThreadName() : "Threads";
         // prefer any explicit configured executor service
@@ -47,7 +47,7 @@ public class ThreadsReifier extends ProcessorReifier<ThreadsDefinition> {
         // resolve what rejected policy to use
         ThreadPoolRejectedPolicy policy = resolveRejectedPolicy(routeContext);
         if (policy == null) {
-            if (definition.getCallerRunsWhenRejected() == null || parseBoolean(routeContext, definition.getCallerRunsWhenRejected())) {
+            if (definition.getCallerRunsWhenRejected() == null || parseBoolean(definition.getCallerRunsWhenRejected())) {
                 // should use caller runs by default if not configured
                 policy = ThreadPoolRejectedPolicy.CallerRuns;
             } else {
@@ -58,16 +58,16 @@ public class ThreadsReifier extends ProcessorReifier<ThreadsDefinition> {
 
         // if no explicit then create from the options
         if (threadPool == null) {
-            ExecutorServiceManager manager = routeContext.getCamelContext().getExecutorServiceManager();
+            ExecutorServiceManager manager = camelContext.getExecutorServiceManager();
             // create the thread pool using a builder
             ThreadPoolProfile profile = new ThreadPoolProfileBuilder(name)
-                .poolSize(definition.getPoolSize() != null ? parseInt(routeContext, definition.getPoolSize()) : null)
-                .maxPoolSize(definition.getMaxPoolSize() != null ? parseInt(routeContext, definition.getMaxPoolSize()) : null)
-                .keepAliveTime(definition.getKeepAliveTime() != null ? parseLong(routeContext, definition.getKeepAliveTime()) : null,
+                .poolSize(definition.getPoolSize() != null ? parseInt(definition.getPoolSize()) : null)
+                .maxPoolSize(definition.getMaxPoolSize() != null ? parseInt(definition.getMaxPoolSize()) : null)
+                .keepAliveTime(definition.getKeepAliveTime() != null ? parseLong(definition.getKeepAliveTime()) : null,
                                definition.getTimeUnit() != null ? TimeUnit.valueOf(definition.getTimeUnit()) : null)
-                .maxQueueSize(definition.getMaxQueueSize() != null ? parseInt(routeContext, definition.getMaxQueueSize()) : null)
+                .maxQueueSize(definition.getMaxQueueSize() != null ? parseInt(definition.getMaxQueueSize()) : null)
                 .rejectedPolicy(policy)
-                .allowCoreThreadTimeOut(definition.getAllowCoreThreadTimeOut() != null ? parseBoolean(routeContext, definition.getAllowCoreThreadTimeOut()) : null)
+                .allowCoreThreadTimeOut(definition.getAllowCoreThreadTimeOut() != null ? parseBoolean(definition.getAllowCoreThreadTimeOut()) : null)
                 .build();
             threadPool = manager.newThreadPool(definition, name, profile);
             shutdownThreadPool = true;
@@ -98,12 +98,12 @@ public class ThreadsReifier extends ProcessorReifier<ThreadsDefinition> {
             }
         }
 
-        return new ThreadsProcessor(routeContext.getCamelContext(), threadPool, shutdownThreadPool, policy);
+        return new ThreadsProcessor(camelContext, threadPool, shutdownThreadPool, policy);
     }
 
     protected ThreadPoolRejectedPolicy resolveRejectedPolicy(RouteContext routeContext) {
         if (definition.getExecutorServiceRef() != null && definition.getRejectedPolicy() == null) {
-            ThreadPoolProfile threadPoolProfile = routeContext.getCamelContext().getExecutorServiceManager().getThreadPoolProfile(definition.getExecutorServiceRef());
+            ThreadPoolProfile threadPoolProfile = camelContext.getExecutorServiceManager().getThreadPoolProfile(definition.getExecutorServiceRef());
             if (threadPoolProfile != null) {
                 return threadPoolProfile.getRejectedPolicy();
             }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ThrottleReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ThrottleReifier.java
index ef99ebe..fb7f853 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ThrottleReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ThrottleReifier.java
@@ -29,12 +29,12 @@ import org.apache.camel.spi.RouteContext;
 
 public class ThrottleReifier extends ExpressionReifier<ThrottleDefinition> {
 
-    public ThrottleReifier(ProcessorDefinition<?> definition) {
-        super((ThrottleDefinition)definition);
+    public ThrottleReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, (ThrottleDefinition) definition);
     }
 
     @Override
-    public Processor createProcessor(RouteContext routeContext) throws Exception {
+    public Processor createProcessor() throws Exception {
         boolean async = definition.getAsyncDelayed() != null && definition.getAsyncDelayed();
         boolean shutdownThreadPool = ProcessorDefinitionHelper.willCreateNewThreadPool(routeContext, definition, true);
         ScheduledExecutorService threadPool = ProcessorDefinitionHelper.getConfiguredScheduledExecutorService(routeContext, "Throttle", definition, true);
@@ -54,7 +54,7 @@ public class ThrottleReifier extends ExpressionReifier<ThrottleDefinition> {
         }
 
         boolean reject = definition.getRejectExecution() != null && definition.getRejectExecution();
-        Throttler answer = new Throttler(routeContext.getCamelContext(), maxRequestsExpression, period, threadPool, shutdownThreadPool, reject, correlation);
+        Throttler answer = new Throttler(camelContext, maxRequestsExpression, period, threadPool, shutdownThreadPool, reject, correlation);
 
         answer.setAsyncDelayed(async);
         if (definition.getCallerRunsWhenRejected() == null) {
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ThrowExceptionReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ThrowExceptionReifier.java
index b00b534..0df9629 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ThrowExceptionReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ThrowExceptionReifier.java
@@ -25,19 +25,19 @@ import org.apache.camel.spi.RouteContext;
 
 public class ThrowExceptionReifier extends ProcessorReifier<ThrowExceptionDefinition> {
 
-    public ThrowExceptionReifier(ProcessorDefinition<?> definition) {
-        super((ThrowExceptionDefinition)definition);
+    public ThrowExceptionReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, (ThrowExceptionDefinition) definition);
     }
 
     @Override
-    public Processor createProcessor(RouteContext routeContext) {
+    public Processor createProcessor() {
         if (definition.getRef() != null && definition.getException() == null) {
             definition.setException(routeContext.lookup(definition.getRef(), Exception.class));
         }
 
         if (definition.getExceptionType() != null && definition.getExceptionClass() == null) {
             try {
-                definition.setExceptionClass(routeContext.getCamelContext().getClassResolver().resolveMandatoryClass(definition.getExceptionType(), Exception.class));
+                definition.setExceptionClass(camelContext.getClassResolver().resolveMandatoryClass(definition.getExceptionType(), Exception.class));
             } catch (ClassNotFoundException e) {
                 throw RuntimeCamelException.wrapRuntimeCamelException(e);
             }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ToDynamicReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ToDynamicReifier.java
index c8aff9e..7a461f0 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ToDynamicReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ToDynamicReifier.java
@@ -35,30 +35,30 @@ import org.apache.camel.util.URISupport;
 
 public class ToDynamicReifier<T extends ToDynamicDefinition> extends ProcessorReifier<T> {
 
-    public ToDynamicReifier(ProcessorDefinition<?> definition) {
-        super((T)definition);
+    public ToDynamicReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, (T) definition);
     }
 
     @Override
-    public Processor createProcessor(RouteContext routeContext) throws Exception {
+    public Processor createProcessor() throws Exception {
         String uri;
         Expression exp;
         if (definition.getEndpointProducerBuilder() != null) {
             uri = definition.getEndpointProducerBuilder().getUri();
-            exp = definition.getEndpointProducerBuilder().expr(routeContext.getCamelContext());
+            exp = definition.getEndpointProducerBuilder().expr(camelContext);
         } else {
             uri = StringHelper.notEmpty(definition.getUri(), "uri", this);
             exp = createExpression(routeContext, uri);
         }
 
         SendDynamicProcessor processor = new SendDynamicProcessor(uri, exp);
-        processor.setCamelContext(routeContext.getCamelContext());
-        processor.setPattern(parse(routeContext, ExchangePattern.class, definition.getPattern()));
+        processor.setCamelContext(camelContext);
+        processor.setPattern(parse(ExchangePattern.class, definition.getPattern()));
         if (definition.getCacheSize() != null) {
-            processor.setCacheSize(parseInt(routeContext, definition.getCacheSize()));
+            processor.setCacheSize(parseInt(definition.getCacheSize()));
         }
         if (definition.getIgnoreInvalidEndpoint() != null) {
-            processor.setIgnoreInvalidEndpoint(parseBoolean(routeContext, definition.getIgnoreInvalidEndpoint()));
+            processor.setIgnoreInvalidEndpoint(parseBoolean(definition.getIgnoreInvalidEndpoint()));
         }
         return processor;
     }
@@ -77,7 +77,7 @@ public class ToDynamicReifier<T extends ToDynamicDefinition> extends ProcessorRe
                 if (before != null && after != null) {
                     // maybe its a language, must have language: as prefix
                     try {
-                        Language partLanguage = routeContext.getCamelContext().resolveLanguage(before);
+                        Language partLanguage = camelContext.resolveLanguage(before);
                         if (partLanguage != null) {
                             Expression exp = partLanguage.createExpression(after);
                             list.add(exp);
@@ -89,7 +89,7 @@ public class ToDynamicReifier<T extends ToDynamicDefinition> extends ProcessorRe
                 }
             }
             // fallback and use simple language
-            Language lan = routeContext.getCamelContext().resolveLanguage("simple");
+            Language lan = camelContext.resolveLanguage("simple");
             Expression exp = lan.createExpression(part);
             list.add(exp);
         }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/TransactedReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/TransactedReifier.java
index 5a8bc07..68b129c 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/TransactedReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/TransactedReifier.java
@@ -39,12 +39,12 @@ public class TransactedReifier extends ProcessorReifier<TransactedDefinition> {
 
     private static final Logger LOG = LoggerFactory.getLogger(TransactedReifier.class);
 
-    public TransactedReifier(ProcessorDefinition<?> definition) {
-        super((TransactedDefinition)definition);
+    public TransactedReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, (TransactedDefinition) definition);
     }
 
     @Override
-    public Processor createProcessor(RouteContext routeContext) throws Exception {
+    public Processor createProcessor() throws Exception {
         Policy policy = resolvePolicy(routeContext);
         org.apache.camel.util.ObjectHelper.notNull(policy, "policy", this);
 
@@ -52,7 +52,7 @@ public class TransactedReifier extends ProcessorReifier<TransactedDefinition> {
         policy.beforeWrap(routeContext, definition);
 
         // create processor after the before wrap
-        Processor childProcessor = this.createChildProcessor(routeContext, true);
+        Processor childProcessor = this.createChildProcessor(true);
 
         // wrap
         Processor target = policy.wrap(routeContext, childProcessor);
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/TransformReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/TransformReifier.java
index 810c766..bc0de91 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/TransformReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/TransformReifier.java
@@ -25,12 +25,12 @@ import org.apache.camel.spi.RouteContext;
 
 public class TransformReifier extends ExpressionReifier<TransformDefinition> {
 
-    public TransformReifier(ProcessorDefinition<?> definition) {
-        super((TransformDefinition)definition);
+    public TransformReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, (TransformDefinition) definition);
     }
 
     @Override
-    public Processor createProcessor(RouteContext routeContext) throws Exception {
+    public Processor createProcessor() throws Exception {
         Expression expr = definition.getExpression().createExpression(routeContext);
         return new TransformProcessor(expr);
     }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/TryReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/TryReifier.java
index 1a88847..b201dd0 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/TryReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/TryReifier.java
@@ -29,13 +29,13 @@ import org.apache.camel.spi.RouteContext;
 
 public class TryReifier extends ProcessorReifier<TryDefinition> {
 
-    public TryReifier(ProcessorDefinition<?> definition) {
-        super((TryDefinition)definition);
+    public TryReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, (TryDefinition) definition);
     }
 
     @Override
-    public Processor createProcessor(RouteContext routeContext) throws Exception {
-        Processor tryProcessor = createOutputsProcessor(routeContext, definition.getOutputsWithoutCatches());
+    public Processor createProcessor() throws Exception {
+        Processor tryProcessor = createOutputsProcessor(definition.getOutputsWithoutCatches());
         if (tryProcessor == null) {
             throw new IllegalArgumentException("Definition has no children on " + this);
         }
@@ -43,7 +43,7 @@ public class TryReifier extends ProcessorReifier<TryDefinition> {
         List<Processor> catchProcessors = new ArrayList<>();
         if (definition.getCatchClauses() != null) {
             for (CatchDefinition catchClause : definition.getCatchClauses()) {
-                catchProcessors.add(createProcessor(routeContext, catchClause));
+                catchProcessors.add(createProcessor(catchClause));
             }
         }
 
@@ -52,14 +52,14 @@ public class TryReifier extends ProcessorReifier<TryDefinition> {
             finallyDefinition = new FinallyDefinition();
             finallyDefinition.setParent(definition);
         }
-        Processor finallyProcessor = createProcessor(routeContext, finallyDefinition);
+        Processor finallyProcessor = createProcessor(finallyDefinition);
 
         // must have either a catch or finally
         if (definition.getFinallyClause() == null && definition.getCatchClauses() == null) {
             throw new IllegalArgumentException("doTry must have one or more catch or finally blocks on " + this);
         }
 
-        return new TryProcessor(routeContext.getCamelContext(), tryProcessor, catchProcessors, finallyProcessor);
+        return new TryProcessor(camelContext, tryProcessor, catchProcessors, finallyProcessor);
     }
 
 }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/UnmarshalReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/UnmarshalReifier.java
index abf6160..7b1d1d5 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/UnmarshalReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/UnmarshalReifier.java
@@ -26,13 +26,13 @@ import org.apache.camel.support.processor.UnmarshalProcessor;
 
 public class UnmarshalReifier extends ProcessorReifier<UnmarshalDefinition> {
 
-    public UnmarshalReifier(ProcessorDefinition<?> definition) {
-        super((UnmarshalDefinition)definition);
+    public UnmarshalReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, (UnmarshalDefinition) definition);
     }
 
     @Override
-    public Processor createProcessor(RouteContext routeContext) {
-        DataFormat dataFormat = DataFormatReifier.getDataFormat(routeContext.getCamelContext(), definition.getDataFormatType(), null);
+    public Processor createProcessor() {
+        DataFormat dataFormat = DataFormatReifier.getDataFormat(camelContext, definition.getDataFormatType(), null);
         return new UnmarshalProcessor(dataFormat);
     }
 }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ValidateReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ValidateReifier.java
index 8535032..f6ab5fc 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ValidateReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ValidateReifier.java
@@ -25,12 +25,12 @@ import org.apache.camel.support.processor.PredicateValidatingProcessor;
 
 public class ValidateReifier extends ExpressionReifier<ValidateDefinition> {
 
-    public ValidateReifier(ProcessorDefinition<?> definition) {
-        super((ValidateDefinition)definition);
+    public ValidateReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, (ValidateDefinition) definition);
     }
 
     @Override
-    public Processor createProcessor(RouteContext routeContext) throws Exception {
+    public Processor createProcessor() throws Exception {
         Predicate pred = definition.getExpression().createPredicate(routeContext);
         return new PredicateValidatingProcessor(pred);
     }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/WhenReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/WhenReifier.java
index 636b962..ce5dc57 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/WhenReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/WhenReifier.java
@@ -23,12 +23,12 @@ import org.apache.camel.spi.RouteContext;
 
 public class WhenReifier extends ExpressionReifier<WhenDefinition> {
 
-    public WhenReifier(ProcessorDefinition<?> definition) {
-        super((WhenDefinition)definition);
+    public WhenReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, (WhenDefinition) definition);
     }
 
     @Override
-    public FilterProcessor createProcessor(RouteContext routeContext) throws Exception {
+    public FilterProcessor createProcessor() throws Exception {
         return createFilterProcessor(routeContext);
     }
 }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/WhenSkipSendToEndpointReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/WhenSkipSendToEndpointReifier.java
index d0c53ed..334fa91 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/WhenSkipSendToEndpointReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/WhenSkipSendToEndpointReifier.java
@@ -25,12 +25,12 @@ import org.apache.camel.spi.RouteContext;
 
 public class WhenSkipSendToEndpointReifier extends ExpressionReifier<WhenSkipSendToEndpointDefinition> {
 
-    public WhenSkipSendToEndpointReifier(ProcessorDefinition<?> definition) {
-        super((WhenSkipSendToEndpointDefinition)definition);
+    public WhenSkipSendToEndpointReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, (WhenSkipSendToEndpointDefinition) definition);
     }
 
     @Override
-    public FilterProcessor createProcessor(RouteContext routeContext) throws Exception {
+    public FilterProcessor createProcessor() throws Exception {
         return createFilterProcessor(routeContext);
     }
 
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/WireTapReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/WireTapReifier.java
index 18a12dc..267eeed 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/WireTapReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/WireTapReifier.java
@@ -34,12 +34,12 @@ import org.apache.camel.support.CamelContextHelper;
 
 public class WireTapReifier extends ToDynamicReifier<WireTapDefinition<?>> {
 
-    public WireTapReifier(ProcessorDefinition<?> definition) {
-        super(definition);
+    public WireTapReifier(RouteContext routeContext, ProcessorDefinition<?> definition) {
+        super(routeContext, definition);
     }
 
     @Override
-    public Processor createProcessor(RouteContext routeContext) throws Exception {
+    public Processor createProcessor() throws Exception {
         // executor service is mandatory for wire tap
         boolean shutdownThreadPool = ProcessorDefinitionHelper.willCreateNewThreadPool(routeContext, definition, true);
         ExecutorService threadPool = ProcessorDefinitionHelper.getConfiguredExecutorService(routeContext, "WireTap", definition, true);
@@ -48,22 +48,22 @@ public class WireTapReifier extends ToDynamicReifier<WireTapDefinition<?>> {
         definition.setPattern(ExchangePattern.InOnly.name());
 
         // create the send dynamic producer to send to the wire tapped endpoint
-        SendDynamicProcessor dynamicTo = (SendDynamicProcessor)super.createProcessor(routeContext);
+        SendDynamicProcessor dynamicTo = (SendDynamicProcessor)super.createProcessor();
 
         // create error handler we need to use for processing the wire tapped
         Processor target = wrapInErrorHandler(routeContext, dynamicTo);
 
         // and wrap in unit of work
-        CamelInternalProcessor internal = new CamelInternalProcessor(routeContext.getCamelContext(), target);
-        internal.addAdvice(new CamelInternalProcessor.UnitOfWorkProcessorAdvice(routeContext, routeContext.getCamelContext()));
+        CamelInternalProcessor internal = new CamelInternalProcessor(camelContext, target);
+        internal.addAdvice(new CamelInternalProcessor.UnitOfWorkProcessorAdvice(routeContext, camelContext));
 
         // is true by default
-        boolean isCopy = definition.getCopy() == null || parseBoolean(routeContext, definition.getCopy());
+        boolean isCopy = definition.getCopy() == null || parseBoolean(definition.getCopy());
 
         WireTapProcessor answer = new WireTapProcessor(dynamicTo, internal,
-                parse(routeContext, ExchangePattern.class, definition.getPattern()),
+                parse(ExchangePattern.class, definition.getPattern()),
                 threadPool, shutdownThreadPool,
-                definition.getDynamicUri() == null || parseBoolean(routeContext, definition.getDynamicUri()));
+                definition.getDynamicUri() == null || parseBoolean(definition.getDynamicUri()));
         answer.setCopy(isCopy);
         if (definition.getNewExchangeProcessorRef() != null) {
             definition.setNewExchangeProcessor(routeContext.mandatoryLookup(definition.getNewExchangeProcessorRef(), Processor.class));
@@ -76,12 +76,12 @@ public class WireTapReifier extends ToDynamicReifier<WireTapDefinition<?>> {
         }
         if (definition.getHeaders() != null && !definition.getHeaders().isEmpty()) {
             for (SetHeaderDefinition header : definition.getHeaders()) {
-                Processor processor = createProcessor(routeContext, header);
+                Processor processor = createProcessor(header);
                 answer.addNewExchangeProcessor(processor);
             }
         }
         if (definition.getOnPrepareRef() != null) {
-            definition.setOnPrepare(CamelContextHelper.mandatoryLookup(routeContext.getCamelContext(), definition.getOnPrepareRef(), Processor.class));
+            definition.setOnPrepare(CamelContextHelper.mandatoryLookup(camelContext, definition.getOnPrepareRef(), Processor.class));
         }
         if (definition.getOnPrepare() != null) {
             answer.setOnPrepare(definition.getOnPrepare());
@@ -93,7 +93,7 @@ public class WireTapReifier extends ToDynamicReifier<WireTapDefinition<?>> {
     @Override
     protected Expression createExpression(RouteContext routeContext, String uri) {
         // whether to use dynamic or static uri
-        if (definition.getDynamicUri() == null || parseBoolean(routeContext, definition.getDynamicUri())) {
+        if (definition.getDynamicUri() == null || parseBoolean(definition.getDynamicUri())) {
             return super.createExpression(routeContext, uri);
         } else {
             return ExpressionBuilder.constantExpression(uri);
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/ASN1DataFormatReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/ASN1DataFormatReifier.java
index 8e5dcfa..29422e3 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/ASN1DataFormatReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/ASN1DataFormatReifier.java
@@ -18,13 +18,14 @@ package org.apache.camel.reifier.dataformat;
 
 import java.util.Map;
 
+import org.apache.camel.CamelContext;
 import org.apache.camel.model.DataFormatDefinition;
 import org.apache.camel.model.dataformat.ASN1DataFormat;
 
 public class ASN1DataFormatReifier extends DataFormatReifier<ASN1DataFormat> {
 
-    public ASN1DataFormatReifier(DataFormatDefinition definition) {
-        super((ASN1DataFormat)definition);
+    public ASN1DataFormatReifier(CamelContext camelContext, DataFormatDefinition definition) {
+        super(camelContext, (ASN1DataFormat)definition);
     }
 
     @Override
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/Any23DataFormatReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/Any23DataFormatReifier.java
index c41648e..0ae6d4e 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/Any23DataFormatReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/Any23DataFormatReifier.java
@@ -18,13 +18,14 @@ package org.apache.camel.reifier.dataformat;
 
 import java.util.Map;
 
+import org.apache.camel.CamelContext;
 import org.apache.camel.model.DataFormatDefinition;
 import org.apache.camel.model.dataformat.Any23DataFormat;
 
 public class Any23DataFormatReifier extends DataFormatReifier<Any23DataFormat> {
 
-    public Any23DataFormatReifier(DataFormatDefinition definition) {
-        super((Any23DataFormat)definition);
+    public Any23DataFormatReifier(CamelContext camelContext, DataFormatDefinition definition) {
+        super(camelContext, (Any23DataFormat)definition);
     }
 
     @Override
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/AvroDataFormatReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/AvroDataFormatReifier.java
index 097f278..fbfcb86 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/AvroDataFormatReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/AvroDataFormatReifier.java
@@ -18,13 +18,14 @@ package org.apache.camel.reifier.dataformat;
 
 import java.util.Map;
 
+import org.apache.camel.CamelContext;
 import org.apache.camel.model.DataFormatDefinition;
 import org.apache.camel.model.dataformat.AvroDataFormat;
 
 public class AvroDataFormatReifier extends DataFormatReifier<AvroDataFormat> {
 
-    public AvroDataFormatReifier(DataFormatDefinition definition) {
-        super((AvroDataFormat)definition);
+    public AvroDataFormatReifier(CamelContext camelContext, DataFormatDefinition definition) {
+        super(camelContext, (AvroDataFormat)definition);
     }
 
     @Override
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/BarcodeDataFormatReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/BarcodeDataFormatReifier.java
index ce599a1..9cd1262 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/BarcodeDataFormatReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/BarcodeDataFormatReifier.java
@@ -18,13 +18,14 @@ package org.apache.camel.reifier.dataformat;
 
 import java.util.Map;
 
+import org.apache.camel.CamelContext;
 import org.apache.camel.model.DataFormatDefinition;
 import org.apache.camel.model.dataformat.BarcodeDataFormat;
 
 public class BarcodeDataFormatReifier extends DataFormatReifier<BarcodeDataFormat> {
 
-    public BarcodeDataFormatReifier(DataFormatDefinition definition) {
-        super((BarcodeDataFormat)definition);
+    public BarcodeDataFormatReifier(CamelContext camelContext, DataFormatDefinition definition) {
+        super(camelContext, (BarcodeDataFormat)definition);
     }
 
     @Override
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/Base64DataFormatReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/Base64DataFormatReifier.java
index 5314fc3..d8613b6 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/Base64DataFormatReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/Base64DataFormatReifier.java
@@ -18,13 +18,14 @@ package org.apache.camel.reifier.dataformat;
 
 import java.util.Map;
 
+import org.apache.camel.CamelContext;
 import org.apache.camel.model.DataFormatDefinition;
 import org.apache.camel.model.dataformat.Base64DataFormat;
 
 public class Base64DataFormatReifier extends DataFormatReifier<Base64DataFormat> {
 
-    public Base64DataFormatReifier(DataFormatDefinition definition) {
-        super((Base64DataFormat)definition);
+    public Base64DataFormatReifier(CamelContext camelContext, DataFormatDefinition definition) {
+        super(camelContext, (Base64DataFormat)definition);
     }
 
     @Override
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/BeanioDataFormatReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/BeanioDataFormatReifier.java
index 0502fc4..46510c5 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/BeanioDataFormatReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/BeanioDataFormatReifier.java
@@ -18,13 +18,14 @@ package org.apache.camel.reifier.dataformat;
 
 import java.util.Map;
 
+import org.apache.camel.CamelContext;
 import org.apache.camel.model.DataFormatDefinition;
 import org.apache.camel.model.dataformat.BeanioDataFormat;
 
 public class BeanioDataFormatReifier extends DataFormatReifier<BeanioDataFormat> {
 
-    public BeanioDataFormatReifier(DataFormatDefinition definition) {
-        super((BeanioDataFormat)definition);
+    public BeanioDataFormatReifier(CamelContext camelContext, DataFormatDefinition definition) {
+        super(camelContext, (BeanioDataFormat)definition);
     }
 
     @Override
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/BindyDataFormatReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/BindyDataFormatReifier.java
index 03980a4..369827a 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/BindyDataFormatReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/BindyDataFormatReifier.java
@@ -25,16 +25,16 @@ import org.apache.camel.spi.DataFormat;
 
 public class BindyDataFormatReifier extends DataFormatReifier<BindyDataFormat> {
 
-    public BindyDataFormatReifier(DataFormatDefinition definition) {
-        super((BindyDataFormat)definition);
+    public BindyDataFormatReifier(CamelContext camelContext, DataFormatDefinition definition) {
+        super(camelContext, (BindyDataFormat)definition);
     }
 
     @Override
-    protected DataFormat doCreateDataFormat(CamelContext camelContext) {
+    protected DataFormat doCreateDataFormat() {
         if (definition.getClassTypeAsString() == null && definition.getClassType() == null) {
             throw new IllegalArgumentException("Either packages or classType must be specified");
         }
-        return super.doCreateDataFormat(camelContext);
+        return super.doCreateDataFormat();
     }
 
     @Override
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/CBORDataFormatReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/CBORDataFormatReifier.java
index fbd912a..dd46bc4 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/CBORDataFormatReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/CBORDataFormatReifier.java
@@ -18,13 +18,14 @@ package org.apache.camel.reifier.dataformat;
 
 import java.util.Map;
 
+import org.apache.camel.CamelContext;
 import org.apache.camel.model.DataFormatDefinition;
 import org.apache.camel.model.dataformat.CBORDataFormat;
 
 public class CBORDataFormatReifier extends DataFormatReifier<CBORDataFormat> {
 
-    public CBORDataFormatReifier(DataFormatDefinition definition) {
-        super((CBORDataFormat)definition);
+    public CBORDataFormatReifier(CamelContext camelContext, DataFormatDefinition definition) {
+        super(camelContext, (CBORDataFormat)definition);
     }
 
     @Override
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/CryptoDataFormatReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/CryptoDataFormatReifier.java
index e2c1202..06dec11 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/CryptoDataFormatReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/CryptoDataFormatReifier.java
@@ -18,13 +18,14 @@ package org.apache.camel.reifier.dataformat;
 
 import java.util.Map;
 
+import org.apache.camel.CamelContext;
 import org.apache.camel.model.DataFormatDefinition;
 import org.apache.camel.model.dataformat.CryptoDataFormat;
 
 public class CryptoDataFormatReifier extends DataFormatReifier<CryptoDataFormat> {
 
-    public CryptoDataFormatReifier(DataFormatDefinition definition) {
-        super((CryptoDataFormat)definition);
+    public CryptoDataFormatReifier(CamelContext camelContext, DataFormatDefinition definition) {
+        super(camelContext, (CryptoDataFormat)definition);
     }
 
     @Override
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/CsvDataFormatReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/CsvDataFormatReifier.java
index 2e4e7ca..2e071c6 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/CsvDataFormatReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/CsvDataFormatReifier.java
@@ -18,13 +18,14 @@ package org.apache.camel.reifier.dataformat;
 
 import java.util.Map;
 
+import org.apache.camel.CamelContext;
 import org.apache.camel.model.DataFormatDefinition;
 import org.apache.camel.model.dataformat.CsvDataFormat;
 
 public class CsvDataFormatReifier extends DataFormatReifier<CsvDataFormat> {
 
-    public CsvDataFormatReifier(DataFormatDefinition definition) {
-        super((CsvDataFormat)definition);
+    public CsvDataFormatReifier(CamelContext camelContext, DataFormatDefinition definition) {
+        super(camelContext, (CsvDataFormat)definition);
     }
 
     @Override
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/CustomDataFormatReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/CustomDataFormatReifier.java
index 010c0f0..9ecbdb9 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/CustomDataFormatReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/CustomDataFormatReifier.java
@@ -25,12 +25,12 @@ import org.apache.camel.spi.DataFormat;
 
 public class CustomDataFormatReifier extends DataFormatReifier<CustomDataFormat> {
 
-    public CustomDataFormatReifier(DataFormatDefinition definition) {
-        super((CustomDataFormat)definition);
+    public CustomDataFormatReifier(CamelContext camelContext, DataFormatDefinition definition) {
+        super(camelContext, (CustomDataFormat) definition);
     }
 
     @Override
-    protected DataFormat doCreateDataFormat(CamelContext camelContext) {
+    protected DataFormat doCreateDataFormat() {
         return DataFormatReifier.getDataFormat(camelContext, null, definition.getRef());
     }
 
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/DataFormatReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/DataFormatReifier.java
index ba42a9f..053ac11 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/DataFormatReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/DataFormatReifier.java
@@ -19,7 +19,7 @@ package org.apache.camel.reifier.dataformat;
 import java.util.HashMap;
 import java.util.LinkedHashMap;
 import java.util.Map;
-import java.util.function.Function;
+import java.util.function.BiFunction;
 
 import org.apache.camel.CamelContext;
 import org.apache.camel.ExtendedCamelContext;
@@ -86,9 +86,9 @@ public abstract class DataFormatReifier<T extends DataFormatDefinition> extends
 
     private static final Logger LOG = LoggerFactory.getLogger(DataFormatReifier.class);
 
-    private static final Map<Class<? extends DataFormatDefinition>, Function<DataFormatDefinition, DataFormatReifier<? extends DataFormatDefinition>>> DATAFORMATS;
+    private static final Map<Class<? extends DataFormatDefinition>, BiFunction<CamelContext, DataFormatDefinition, DataFormatReifier<? extends DataFormatDefinition>>> DATAFORMATS;
     static {
-        Map<Class<? extends DataFormatDefinition>, Function<DataFormatDefinition, DataFormatReifier<? extends DataFormatDefinition>>> map = new HashMap<>();
+        Map<Class<? extends DataFormatDefinition>, BiFunction<CamelContext, DataFormatDefinition, DataFormatReifier<? extends DataFormatDefinition>>> map = new HashMap<>();
         map.put(Any23DataFormat.class, Any23DataFormatReifier::new);
         map.put(ASN1DataFormat.class, ASN1DataFormatReifier::new);
         map.put(AvroDataFormat.class, AvroDataFormatReifier::new);
@@ -136,12 +136,13 @@ public abstract class DataFormatReifier<T extends DataFormatDefinition> extends
 
     protected final T definition;
 
-    public DataFormatReifier(T definition) {
+    public DataFormatReifier(CamelContext camelContext, T definition) {
+        super(camelContext);
         this.definition = definition;
     }
 
     public static void registerReifier(Class<? extends DataFormatDefinition> dataFormatClass,
-                                       Function<DataFormatDefinition, DataFormatReifier<? extends DataFormatDefinition>> creator) {
+                                       BiFunction<CamelContext, DataFormatDefinition, DataFormatReifier<? extends DataFormatDefinition>> creator) {
         DATAFORMATS.put(dataFormatClass, creator);
     }
 
@@ -178,26 +179,26 @@ public abstract class DataFormatReifier<T extends DataFormatDefinition> extends
         if (type.getDataFormat() != null) {
             return type.getDataFormat();
         }
-        return reifier(type).createDataFormat(camelContext);
+        return reifier(camelContext, type).createDataFormat();
     }
 
-    public static DataFormatReifier<? extends DataFormatDefinition> reifier(DataFormatDefinition definition) {
-        Function<DataFormatDefinition, DataFormatReifier<? extends DataFormatDefinition>> reifier = DATAFORMATS.get(definition.getClass());
+    public static DataFormatReifier<? extends DataFormatDefinition> reifier(CamelContext camelContext, DataFormatDefinition definition) {
+        BiFunction<CamelContext, DataFormatDefinition, DataFormatReifier<? extends DataFormatDefinition>> reifier = DATAFORMATS.get(definition.getClass());
         if (reifier != null) {
-            return reifier.apply(definition);
+            return reifier.apply(camelContext, definition);
         }
         throw new IllegalStateException("Unsupported definition: " + definition);
     }
 
-    public DataFormat createDataFormat(CamelContext camelContext) {
+    public DataFormat createDataFormat() {
         DataFormat dataFormat = definition.getDataFormat();
         if (dataFormat == null) {
-            dataFormat = doCreateDataFormat(camelContext);
+            dataFormat = doCreateDataFormat();
             if (dataFormat != null) {
                 if (dataFormat instanceof DataFormatContentTypeHeader) {
                     // is enabled by default so assume true if null
                     final boolean contentTypeHeader = definition.getContentTypeHeader() == null
-                            || parseBoolean(camelContext, definition.getContentTypeHeader());
+                            || parseBoolean(definition.getContentTypeHeader());
                     ((DataFormatContentTypeHeader) dataFormat).setContentTypeHeader(contentTypeHeader);
                 }
                 // configure the rest of the options
@@ -214,7 +215,7 @@ public abstract class DataFormatReifier<T extends DataFormatDefinition> extends
     /**
      * Factory method to create the data format instance
      */
-    protected DataFormat doCreateDataFormat(CamelContext camelContext) {
+    protected DataFormat doCreateDataFormat() {
         // must use getDataFormatName() as we need special logic in json dataformat
         String dfn = definition.getDataFormatName();
         if (dfn != null) {
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/FhirDataFormatReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/FhirDataFormatReifier.java
index 2b16583..e0420f1 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/FhirDataFormatReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/FhirDataFormatReifier.java
@@ -18,13 +18,14 @@ package org.apache.camel.reifier.dataformat;
 
 import java.util.Map;
 
+import org.apache.camel.CamelContext;
 import org.apache.camel.model.DataFormatDefinition;
 import org.apache.camel.model.dataformat.FhirDataformat;
 
 public class FhirDataFormatReifier<T extends FhirDataformat> extends DataFormatReifier<T> {
 
-    public FhirDataFormatReifier(DataFormatDefinition definition) {
-        super((T)definition);
+    public FhirDataFormatReifier(CamelContext camelContext, DataFormatDefinition definition) {
+        super(camelContext, (T)definition);
     }
 
     @Override
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/FhirJsonDataFormatReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/FhirJsonDataFormatReifier.java
index c5c1865..62132ec 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/FhirJsonDataFormatReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/FhirJsonDataFormatReifier.java
@@ -16,13 +16,14 @@
  */
 package org.apache.camel.reifier.dataformat;
 
+import org.apache.camel.CamelContext;
 import org.apache.camel.model.DataFormatDefinition;
 import org.apache.camel.model.dataformat.FhirJsonDataFormat;
 
 public class FhirJsonDataFormatReifier extends FhirDataFormatReifier<FhirJsonDataFormat> {
 
-    public FhirJsonDataFormatReifier(DataFormatDefinition definition) {
-        super(definition);
+    public FhirJsonDataFormatReifier(CamelContext camelContext, DataFormatDefinition definition) {
+        super(camelContext, definition);
     }
 
 }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/FhirXmlDataFormatReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/FhirXmlDataFormatReifier.java
index 58fa502..afcff1f 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/FhirXmlDataFormatReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/FhirXmlDataFormatReifier.java
@@ -16,13 +16,14 @@
  */
 package org.apache.camel.reifier.dataformat;
 
+import org.apache.camel.CamelContext;
 import org.apache.camel.model.DataFormatDefinition;
 import org.apache.camel.model.dataformat.FhirXmlDataFormat;
 
 public class FhirXmlDataFormatReifier extends FhirDataFormatReifier<FhirXmlDataFormat> {
 
-    public FhirXmlDataFormatReifier(DataFormatDefinition definition) {
-        super(definition);
+    public FhirXmlDataFormatReifier(CamelContext camelContext, DataFormatDefinition definition) {
+        super(camelContext, definition);
     }
 
 }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/FlatpackDataFormatReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/FlatpackDataFormatReifier.java
index 89b6ea4..1d4815c 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/FlatpackDataFormatReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/FlatpackDataFormatReifier.java
@@ -18,13 +18,14 @@ package org.apache.camel.reifier.dataformat;
 
 import java.util.Map;
 
+import org.apache.camel.CamelContext;
 import org.apache.camel.model.DataFormatDefinition;
 import org.apache.camel.model.dataformat.FlatpackDataFormat;
 
 public class FlatpackDataFormatReifier extends DataFormatReifier<FlatpackDataFormat> {
 
-    public FlatpackDataFormatReifier(DataFormatDefinition definition) {
-        super((FlatpackDataFormat)definition);
+    public FlatpackDataFormatReifier(CamelContext camelContext, DataFormatDefinition definition) {
+        super(camelContext, (FlatpackDataFormat)definition);
     }
 
     @Override
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/GrokDataFormatReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/GrokDataFormatReifier.java
index d6906a1..5c5407b 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/GrokDataFormatReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/GrokDataFormatReifier.java
@@ -18,13 +18,14 @@ package org.apache.camel.reifier.dataformat;
 
 import java.util.Map;
 
+import org.apache.camel.CamelContext;
 import org.apache.camel.model.DataFormatDefinition;
 import org.apache.camel.model.dataformat.GrokDataFormat;
 
 public class GrokDataFormatReifier extends DataFormatReifier<GrokDataFormat> {
 
-    public GrokDataFormatReifier(DataFormatDefinition definition) {
-        super((GrokDataFormat)definition);
+    public GrokDataFormatReifier(CamelContext camelContext, DataFormatDefinition definition) {
+        super(camelContext, (GrokDataFormat)definition);
     }
 
     @Override
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/GzipDataFormatReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/GzipDataFormatReifier.java
index 6e134ad..2172b77 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/GzipDataFormatReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/GzipDataFormatReifier.java
@@ -18,13 +18,14 @@ package org.apache.camel.reifier.dataformat;
 
 import java.util.Map;
 
+import org.apache.camel.CamelContext;
 import org.apache.camel.model.DataFormatDefinition;
 import org.apache.camel.model.dataformat.GzipDataFormat;
 
 public class GzipDataFormatReifier extends DataFormatReifier<GzipDataFormat> {
 
-    public GzipDataFormatReifier(DataFormatDefinition definition) {
-        super((GzipDataFormat)definition);
+    public GzipDataFormatReifier(CamelContext camelContext, DataFormatDefinition definition) {
+        super(camelContext, (GzipDataFormat)definition);
     }
 
     @Override
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/HL7DataFormatReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/HL7DataFormatReifier.java
index 5c2c41e..58670c4 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/HL7DataFormatReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/HL7DataFormatReifier.java
@@ -18,13 +18,14 @@ package org.apache.camel.reifier.dataformat;
 
 import java.util.Map;
 
+import org.apache.camel.CamelContext;
 import org.apache.camel.model.DataFormatDefinition;
 import org.apache.camel.model.dataformat.HL7DataFormat;
 
 public class HL7DataFormatReifier extends DataFormatReifier<HL7DataFormat> {
 
-    public HL7DataFormatReifier(DataFormatDefinition definition) {
-        super((HL7DataFormat)definition);
+    public HL7DataFormatReifier(CamelContext camelContext, DataFormatDefinition definition) {
+        super(camelContext, (HL7DataFormat)definition);
     }
 
     @Override
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/IcalDataFormatReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/IcalDataFormatReifier.java
index b2680e4..e9ad75b 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/IcalDataFormatReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/IcalDataFormatReifier.java
@@ -18,13 +18,14 @@ package org.apache.camel.reifier.dataformat;
 
 import java.util.Map;
 
+import org.apache.camel.CamelContext;
 import org.apache.camel.model.DataFormatDefinition;
 import org.apache.camel.model.dataformat.IcalDataFormat;
 
 public class IcalDataFormatReifier extends DataFormatReifier<IcalDataFormat> {
 
-    public IcalDataFormatReifier(DataFormatDefinition definition) {
-        super((IcalDataFormat)definition);
+    public IcalDataFormatReifier(CamelContext camelContext, DataFormatDefinition definition) {
+        super(camelContext, (IcalDataFormat)definition);
     }
 
     @Override
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/JacksonXMLDataFormatReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/JacksonXMLDataFormatReifier.java
index 8c9aa5e..de84ca1 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/JacksonXMLDataFormatReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/JacksonXMLDataFormatReifier.java
@@ -18,13 +18,14 @@ package org.apache.camel.reifier.dataformat;
 
 import java.util.Map;
 
+import org.apache.camel.CamelContext;
 import org.apache.camel.model.DataFormatDefinition;
 import org.apache.camel.model.dataformat.JacksonXMLDataFormat;
 
 public class JacksonXMLDataFormatReifier extends DataFormatReifier<JacksonXMLDataFormat> {
 
-    public JacksonXMLDataFormatReifier(DataFormatDefinition definition) {
-        super((JacksonXMLDataFormat)definition);
+    public JacksonXMLDataFormatReifier(CamelContext camelContext, DataFormatDefinition definition) {
+        super(camelContext, (JacksonXMLDataFormat)definition);
     }
 
     @Override
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/JaxbDataFormatReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/JaxbDataFormatReifier.java
index ad4079e..5c3049c 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/JaxbDataFormatReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/JaxbDataFormatReifier.java
@@ -18,13 +18,14 @@ package org.apache.camel.reifier.dataformat;
 
 import java.util.Map;
 
+import org.apache.camel.CamelContext;
 import org.apache.camel.model.DataFormatDefinition;
 import org.apache.camel.model.dataformat.JaxbDataFormat;
 
 public class JaxbDataFormatReifier extends DataFormatReifier<JaxbDataFormat> {
 
-    public JaxbDataFormatReifier(DataFormatDefinition definition) {
-        super((JaxbDataFormat)definition);
+    public JaxbDataFormatReifier(CamelContext camelContext, DataFormatDefinition definition) {
+        super(camelContext, (JaxbDataFormat)definition);
     }
 
     @Override
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/JsonApiDataFormatReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/JsonApiDataFormatReifier.java
index f01e21c..a39dbcf 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/JsonApiDataFormatReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/JsonApiDataFormatReifier.java
@@ -18,13 +18,14 @@ package org.apache.camel.reifier.dataformat;
 
 import java.util.Map;
 
+import org.apache.camel.CamelContext;
 import org.apache.camel.model.DataFormatDefinition;
 import org.apache.camel.model.dataformat.JsonApiDataFormat;
 
 public class JsonApiDataFormatReifier extends DataFormatReifier<JsonApiDataFormat> {
 
-    public JsonApiDataFormatReifier(DataFormatDefinition definition) {
-        super((JsonApiDataFormat)definition);
+    public JsonApiDataFormatReifier(CamelContext camelContext, DataFormatDefinition definition) {
+        super(camelContext, (JsonApiDataFormat)definition);
     }
 
     @Override
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/JsonDataFormatReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/JsonDataFormatReifier.java
index bbd10ae..934e75b 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/JsonDataFormatReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/JsonDataFormatReifier.java
@@ -18,14 +18,15 @@ package org.apache.camel.reifier.dataformat;
 
 import java.util.Map;
 
+import org.apache.camel.CamelContext;
 import org.apache.camel.model.DataFormatDefinition;
 import org.apache.camel.model.dataformat.JsonDataFormat;
 import org.apache.camel.model.dataformat.JsonLibrary;
 
 public class JsonDataFormatReifier extends DataFormatReifier<JsonDataFormat> {
 
-    public JsonDataFormatReifier(DataFormatDefinition definition) {
-        super((JsonDataFormat)definition);
+    public JsonDataFormatReifier(CamelContext camelContext, DataFormatDefinition definition) {
+        super(camelContext, (JsonDataFormat)definition);
     }
 
     @Override
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/LZFDataFormatReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/LZFDataFormatReifier.java
index 9071712..58af48a 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/LZFDataFormatReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/LZFDataFormatReifier.java
@@ -18,13 +18,14 @@ package org.apache.camel.reifier.dataformat;
 
 import java.util.Map;
 
+import org.apache.camel.CamelContext;
 import org.apache.camel.model.DataFormatDefinition;
 import org.apache.camel.model.dataformat.LZFDataFormat;
 
 public class LZFDataFormatReifier extends DataFormatReifier<LZFDataFormat> {
 
-    public LZFDataFormatReifier(DataFormatDefinition definition) {
-        super((LZFDataFormat)definition);
+    public LZFDataFormatReifier(CamelContext camelContext, DataFormatDefinition definition) {
+        super(camelContext, (LZFDataFormat)definition);
     }
 
     @Override
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/MimeMultipartDataFormatReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/MimeMultipartDataFormatReifier.java
index e05d33f..98fe8a4 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/MimeMultipartDataFormatReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/MimeMultipartDataFormatReifier.java
@@ -18,13 +18,14 @@ package org.apache.camel.reifier.dataformat;
 
 import java.util.Map;
 
+import org.apache.camel.CamelContext;
 import org.apache.camel.model.DataFormatDefinition;
 import org.apache.camel.model.dataformat.MimeMultipartDataFormat;
 
 public class MimeMultipartDataFormatReifier extends DataFormatReifier<MimeMultipartDataFormat> {
 
-    public MimeMultipartDataFormatReifier(DataFormatDefinition definition) {
-        super((MimeMultipartDataFormat)definition);
+    public MimeMultipartDataFormatReifier(CamelContext camelContext, DataFormatDefinition definition) {
+        super(camelContext, (MimeMultipartDataFormat)definition);
     }
 
     @Override
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/PGPDataFormatReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/PGPDataFormatReifier.java
index 4974637..9e29791 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/PGPDataFormatReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/PGPDataFormatReifier.java
@@ -18,13 +18,14 @@ package org.apache.camel.reifier.dataformat;
 
 import java.util.Map;
 
+import org.apache.camel.CamelContext;
 import org.apache.camel.model.DataFormatDefinition;
 import org.apache.camel.model.dataformat.PGPDataFormat;
 
 public class PGPDataFormatReifier extends DataFormatReifier<PGPDataFormat> {
 
-    public PGPDataFormatReifier(DataFormatDefinition definition) {
-        super((PGPDataFormat)definition);
+    public PGPDataFormatReifier(CamelContext camelContext, DataFormatDefinition definition) {
+        super(camelContext, (PGPDataFormat)definition);
     }
 
     @Override
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/ProtobufDataFormatReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/ProtobufDataFormatReifier.java
index 8cf9fd7..7fa5a04 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/ProtobufDataFormatReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/ProtobufDataFormatReifier.java
@@ -18,13 +18,14 @@ package org.apache.camel.reifier.dataformat;
 
 import java.util.Map;
 
+import org.apache.camel.CamelContext;
 import org.apache.camel.model.DataFormatDefinition;
 import org.apache.camel.model.dataformat.ProtobufDataFormat;
 
 public class ProtobufDataFormatReifier extends DataFormatReifier<ProtobufDataFormat> {
 
-    public ProtobufDataFormatReifier(DataFormatDefinition definition) {
-        super((ProtobufDataFormat)definition);
+    public ProtobufDataFormatReifier(CamelContext camelContext, DataFormatDefinition definition) {
+        super(camelContext, (ProtobufDataFormat)definition);
     }
 
     @Override
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/RssDataFormatReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/RssDataFormatReifier.java
index fd9e754..b673590 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/RssDataFormatReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/RssDataFormatReifier.java
@@ -18,13 +18,14 @@ package org.apache.camel.reifier.dataformat;
 
 import java.util.Map;
 
+import org.apache.camel.CamelContext;
 import org.apache.camel.model.DataFormatDefinition;
 import org.apache.camel.model.dataformat.RssDataFormat;
 
 public class RssDataFormatReifier extends DataFormatReifier<RssDataFormat> {
 
-    public RssDataFormatReifier(DataFormatDefinition definition) {
-        super((RssDataFormat)definition);
+    public RssDataFormatReifier(CamelContext camelContext, DataFormatDefinition definition) {
+        super(camelContext, (RssDataFormat)definition);
     }
 
     @Override
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/SoapJaxbDataFormatReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/SoapJaxbDataFormatReifier.java
index 4dd6de3..a9f21d8 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/SoapJaxbDataFormatReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/SoapJaxbDataFormatReifier.java
@@ -18,13 +18,14 @@ package org.apache.camel.reifier.dataformat;
 
 import java.util.Map;
 
+import org.apache.camel.CamelContext;
 import org.apache.camel.model.DataFormatDefinition;
 import org.apache.camel.model.dataformat.SoapJaxbDataFormat;
 
 public class SoapJaxbDataFormatReifier extends DataFormatReifier<SoapJaxbDataFormat> {
 
-    public SoapJaxbDataFormatReifier(DataFormatDefinition definition) {
-        super((SoapJaxbDataFormat)definition);
+    public SoapJaxbDataFormatReifier(CamelContext camelContext, DataFormatDefinition definition) {
+        super(camelContext, (SoapJaxbDataFormat)definition);
     }
 
     @Override
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/SyslogDataFormatReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/SyslogDataFormatReifier.java
index 7bd76bb..37ecd2a 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/SyslogDataFormatReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/SyslogDataFormatReifier.java
@@ -18,13 +18,14 @@ package org.apache.camel.reifier.dataformat;
 
 import java.util.Map;
 
+import org.apache.camel.CamelContext;
 import org.apache.camel.model.DataFormatDefinition;
 import org.apache.camel.model.dataformat.SyslogDataFormat;
 
 public class SyslogDataFormatReifier extends DataFormatReifier<SyslogDataFormat> {
 
-    public SyslogDataFormatReifier(DataFormatDefinition definition) {
-        super((SyslogDataFormat)definition);
+    public SyslogDataFormatReifier(CamelContext camelContext, DataFormatDefinition definition) {
+        super(camelContext, (SyslogDataFormat)definition);
     }
 
     protected void prepareDataFormatConfig(Map<String, Object> properties) {
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/TarFileDataFormatReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/TarFileDataFormatReifier.java
index b37a25a..6e5e3dc 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/TarFileDataFormatReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/TarFileDataFormatReifier.java
@@ -18,13 +18,14 @@ package org.apache.camel.reifier.dataformat;
 
 import java.util.Map;
 
+import org.apache.camel.CamelContext;
 import org.apache.camel.model.DataFormatDefinition;
 import org.apache.camel.model.dataformat.TarFileDataFormat;
 
 public class TarFileDataFormatReifier extends DataFormatReifier<TarFileDataFormat> {
 
-    public TarFileDataFormatReifier(DataFormatDefinition definition) {
-        super((TarFileDataFormat)definition);
+    public TarFileDataFormatReifier(CamelContext camelContext, DataFormatDefinition definition) {
+        super(camelContext, (TarFileDataFormat)definition);
     }
 
     @Override
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/ThriftDataFormatReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/ThriftDataFormatReifier.java
index ec6ac26..8d58e39 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/ThriftDataFormatReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/ThriftDataFormatReifier.java
@@ -18,13 +18,14 @@ package org.apache.camel.reifier.dataformat;
 
 import java.util.Map;
 
+import org.apache.camel.CamelContext;
 import org.apache.camel.model.DataFormatDefinition;
 import org.apache.camel.model.dataformat.ThriftDataFormat;
 
 public class ThriftDataFormatReifier extends DataFormatReifier<ThriftDataFormat> {
 
-    public ThriftDataFormatReifier(DataFormatDefinition definition) {
-        super((ThriftDataFormat)definition);
+    public ThriftDataFormatReifier(CamelContext camelContext, DataFormatDefinition definition) {
+        super(camelContext, (ThriftDataFormat)definition);
     }
 
     @Override
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/TidyMarkupDataFormatReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/TidyMarkupDataFormatReifier.java
index ba48d1a..e9d9b54 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/TidyMarkupDataFormatReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/TidyMarkupDataFormatReifier.java
@@ -18,13 +18,14 @@ package org.apache.camel.reifier.dataformat;
 
 import java.util.Map;
 
+import org.apache.camel.CamelContext;
 import org.apache.camel.model.DataFormatDefinition;
 import org.apache.camel.model.dataformat.TidyMarkupDataFormat;
 
 public class TidyMarkupDataFormatReifier extends DataFormatReifier<TidyMarkupDataFormat> {
 
-    public TidyMarkupDataFormatReifier(DataFormatDefinition definition) {
-        super((TidyMarkupDataFormat)definition);
+    public TidyMarkupDataFormatReifier(CamelContext camelContext, DataFormatDefinition definition) {
+        super(camelContext, (TidyMarkupDataFormat)definition);
     }
 
     @Override
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/UniVocityAbstractDataFormatReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/UniVocityAbstractDataFormatReifier.java
index 510a7d6..fa29a96 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/UniVocityAbstractDataFormatReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/UniVocityAbstractDataFormatReifier.java
@@ -20,14 +20,15 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.camel.CamelContext;
 import org.apache.camel.model.DataFormatDefinition;
 import org.apache.camel.model.dataformat.UniVocityAbstractDataFormat;
 import org.apache.camel.model.dataformat.UniVocityHeader;
 
 public class UniVocityAbstractDataFormatReifier<T extends UniVocityAbstractDataFormat> extends DataFormatReifier<T> {
 
-    public UniVocityAbstractDataFormatReifier(DataFormatDefinition definition) {
-        super((T)definition);
+    public UniVocityAbstractDataFormatReifier(CamelContext camelContext, DataFormatDefinition definition) {
+        super(camelContext, (T)definition);
     }
 
     @Override
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/UniVocityCsvDataFormatReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/UniVocityCsvDataFormatReifier.java
index 90e1b7f..3db6b03 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/UniVocityCsvDataFormatReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/UniVocityCsvDataFormatReifier.java
@@ -18,13 +18,14 @@ package org.apache.camel.reifier.dataformat;
 
 import java.util.Map;
 
+import org.apache.camel.CamelContext;
 import org.apache.camel.model.DataFormatDefinition;
 import org.apache.camel.model.dataformat.UniVocityCsvDataFormat;
 
 public class UniVocityCsvDataFormatReifier extends UniVocityAbstractDataFormatReifier<UniVocityCsvDataFormat> {
 
-    public UniVocityCsvDataFormatReifier(DataFormatDefinition definition) {
-        super(definition);
+    public UniVocityCsvDataFormatReifier(CamelContext camelContext, DataFormatDefinition definition) {
+        super(camelContext, definition);
     }
 
     @Override
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/UniVocityFixedWidthDataFormatReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/UniVocityFixedWidthDataFormatReifier.java
index 6d2b4ad..67aa624 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/UniVocityFixedWidthDataFormatReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/UniVocityFixedWidthDataFormatReifier.java
@@ -18,14 +18,15 @@ package org.apache.camel.reifier.dataformat;
 
 import java.util.Map;
 
+import org.apache.camel.CamelContext;
 import org.apache.camel.model.DataFormatDefinition;
 import org.apache.camel.model.dataformat.UniVocityFixedWidthDataFormat;
 import org.apache.camel.model.dataformat.UniVocityHeader;
 
 public class UniVocityFixedWidthDataFormatReifier extends UniVocityAbstractDataFormatReifier<UniVocityFixedWidthDataFormat> {
 
-    public UniVocityFixedWidthDataFormatReifier(DataFormatDefinition definition) {
-        super(definition);
+    public UniVocityFixedWidthDataFormatReifier(CamelContext camelContext, DataFormatDefinition definition) {
+        super(camelContext, definition);
     }
 
     @Override
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/UniVocityTsvDataFormatReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/UniVocityTsvDataFormatReifier.java
index b385a3e..7784f73 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/UniVocityTsvDataFormatReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/UniVocityTsvDataFormatReifier.java
@@ -18,13 +18,14 @@ package org.apache.camel.reifier.dataformat;
 
 import java.util.Map;
 
+import org.apache.camel.CamelContext;
 import org.apache.camel.model.DataFormatDefinition;
 import org.apache.camel.model.dataformat.UniVocityTsvDataFormat;
 
 public class UniVocityTsvDataFormatReifier extends UniVocityAbstractDataFormatReifier<UniVocityTsvDataFormat> {
 
-    public UniVocityTsvDataFormatReifier(DataFormatDefinition definition) {
-        super(definition);
+    public UniVocityTsvDataFormatReifier(CamelContext camelContext, DataFormatDefinition definition) {
+        super(camelContext, definition);
     }
 
     @Override
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/XMLSecurityDataFormatReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/XMLSecurityDataFormatReifier.java
index abd1337..01cdfc9 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/XMLSecurityDataFormatReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/XMLSecurityDataFormatReifier.java
@@ -18,13 +18,14 @@ package org.apache.camel.reifier.dataformat;
 
 import java.util.Map;
 
+import org.apache.camel.CamelContext;
 import org.apache.camel.model.DataFormatDefinition;
 import org.apache.camel.model.dataformat.XMLSecurityDataFormat;
 
 public class XMLSecurityDataFormatReifier extends DataFormatReifier<XMLSecurityDataFormat> {
 
-    public XMLSecurityDataFormatReifier(DataFormatDefinition definition) {
-        super((XMLSecurityDataFormat)definition);
+    public XMLSecurityDataFormatReifier(CamelContext camelContext, DataFormatDefinition definition) {
+        super(camelContext, (XMLSecurityDataFormat)definition);
     }
 
     @Override
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/XStreamDataFormatReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/XStreamDataFormatReifier.java
index e326adc..5c2ea5e 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/XStreamDataFormatReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/XStreamDataFormatReifier.java
@@ -18,13 +18,14 @@ package org.apache.camel.reifier.dataformat;
 
 import java.util.Map;
 
+import org.apache.camel.CamelContext;
 import org.apache.camel.model.DataFormatDefinition;
 import org.apache.camel.model.dataformat.XStreamDataFormat;
 
 public class XStreamDataFormatReifier extends DataFormatReifier<XStreamDataFormat> {
 
-    public XStreamDataFormatReifier(DataFormatDefinition definition) {
-        super((XStreamDataFormat)definition);
+    public XStreamDataFormatReifier(CamelContext camelContext, DataFormatDefinition definition) {
+        super(camelContext, (XStreamDataFormat)definition);
     }
 
     @Override
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/XmlRpcDataFormatReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/XmlRpcDataFormatReifier.java
index fb4feb1..43dbb77 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/XmlRpcDataFormatReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/XmlRpcDataFormatReifier.java
@@ -18,13 +18,14 @@ package org.apache.camel.reifier.dataformat;
 
 import java.util.Map;
 
+import org.apache.camel.CamelContext;
 import org.apache.camel.model.DataFormatDefinition;
 import org.apache.camel.model.dataformat.XmlRpcDataFormat;
 
 public class XmlRpcDataFormatReifier extends DataFormatReifier<XmlRpcDataFormat> {
 
-    public XmlRpcDataFormatReifier(DataFormatDefinition definition) {
-        super((XmlRpcDataFormat)definition);
+    public XmlRpcDataFormatReifier(CamelContext camelContext, DataFormatDefinition definition) {
+        super(camelContext, (XmlRpcDataFormat)definition);
     }
 
     @Override
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/YAMLDataFormatReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/YAMLDataFormatReifier.java
index 39e146d..ee1b147 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/YAMLDataFormatReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/YAMLDataFormatReifier.java
@@ -20,6 +20,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.camel.CamelContext;
 import org.apache.camel.model.DataFormatDefinition;
 import org.apache.camel.model.dataformat.YAMLDataFormat;
 import org.apache.camel.model.dataformat.YAMLLibrary;
@@ -28,8 +29,8 @@ import org.apache.camel.model.dataformat.YAMLTypeFilterType;
 
 public class YAMLDataFormatReifier extends DataFormatReifier<YAMLDataFormat> {
 
-    public YAMLDataFormatReifier(DataFormatDefinition definition) {
-        super((YAMLDataFormat)definition);
+    public YAMLDataFormatReifier(CamelContext camelContext, DataFormatDefinition definition) {
+        super(camelContext, (YAMLDataFormat)definition);
     }
 
     @Override
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/ZipDataFormatReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/ZipDataFormatReifier.java
index 74b2208..fdc8220 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/ZipDataFormatReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/ZipDataFormatReifier.java
@@ -18,13 +18,14 @@ package org.apache.camel.reifier.dataformat;
 
 import java.util.Map;
 
+import org.apache.camel.CamelContext;
 import org.apache.camel.model.DataFormatDefinition;
 import org.apache.camel.model.dataformat.ZipDeflaterDataFormat;
 
 public class ZipDataFormatReifier extends DataFormatReifier<ZipDeflaterDataFormat> {
 
-    public ZipDataFormatReifier(DataFormatDefinition definition) {
-        super((ZipDeflaterDataFormat)definition);
+    public ZipDataFormatReifier(CamelContext camelContext, DataFormatDefinition definition) {
+        super(camelContext, (ZipDeflaterDataFormat)definition);
     }
 
     @Override
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/ZipFileDataFormatReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/ZipFileDataFormatReifier.java
index d5d437f..3f1042f 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/ZipFileDataFormatReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/ZipFileDataFormatReifier.java
@@ -18,13 +18,14 @@ package org.apache.camel.reifier.dataformat;
 
 import java.util.Map;
 
+import org.apache.camel.CamelContext;
 import org.apache.camel.model.DataFormatDefinition;
 import org.apache.camel.model.dataformat.ZipFileDataFormat;
 
 public class ZipFileDataFormatReifier extends DataFormatReifier<ZipFileDataFormat> {
 
-    public ZipFileDataFormatReifier(DataFormatDefinition definition) {
-        super((ZipFileDataFormat)definition);
+    public ZipFileDataFormatReifier(CamelContext camelContext, DataFormatDefinition definition) {
+        super(camelContext, (ZipFileDataFormat)definition);
     }
 
     @Override
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/errorhandler/DeadLetterChannelReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/errorhandler/DeadLetterChannelReifier.java
index 02da389..2a5c6a9 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/errorhandler/DeadLetterChannelReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/errorhandler/DeadLetterChannelReifier.java
@@ -27,30 +27,30 @@ import org.apache.camel.util.StringHelper;
 
 public class DeadLetterChannelReifier extends DefaultErrorHandlerReifier<DeadLetterChannelBuilder> {
 
-    public DeadLetterChannelReifier(ErrorHandlerFactory definition) {
-        super(definition);
+    public DeadLetterChannelReifier(RouteContext routeContext, ErrorHandlerFactory definition) {
+        super(routeContext, definition);
     }
 
     @Override
-    public Processor createErrorHandler(RouteContext routeContext, Processor processor) throws Exception {
-        validateDeadLetterUri(routeContext);
+    public Processor createErrorHandler(Processor processor) throws Exception {
+        validateDeadLetterUri();
 
-        DeadLetterChannel answer = new DeadLetterChannel(routeContext.getCamelContext(), processor, definition.getLogger(), definition.getOnRedelivery(),
+        DeadLetterChannel answer = new DeadLetterChannel(camelContext, processor, definition.getLogger(), definition.getOnRedelivery(),
                                                          definition.getRedeliveryPolicy(), definition.getExceptionPolicyStrategy(), definition.getFailureProcessor(),
                                                          definition.getDeadLetterUri(), definition.isDeadLetterHandleNewException(), definition.isUseOriginalMessage(),
-                                                         definition.isUseOriginalBody(), definition.getRetryWhilePolicy(routeContext.getCamelContext()),
-                                                         getExecutorService(routeContext.getCamelContext()), definition.getOnPrepareFailure(), definition.getOnExceptionOccurred());
+                                                         definition.isUseOriginalBody(), definition.getRetryWhilePolicy(camelContext),
+                                                         getExecutorService(camelContext), definition.getOnPrepareFailure(), definition.getOnExceptionOccurred());
         // configure error handler before we can use it
         configure(routeContext, answer);
         return answer;
     }
 
-    protected void validateDeadLetterUri(RouteContext routeContext) {
+    protected void validateDeadLetterUri() {
         Endpoint deadLetter = definition.getDeadLetter();
         String deadLetterUri = definition.getDeadLetterUri();
         if (deadLetter == null) {
             StringHelper.notEmpty(deadLetterUri, "deadLetterUri", this);
-            deadLetter = routeContext.getCamelContext().getEndpoint(deadLetterUri);
+            deadLetter = camelContext.getEndpoint(deadLetterUri);
             if (deadLetter == null) {
                 throw new NoSuchEndpointException(deadLetterUri);
             }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/errorhandler/DefaultErrorHandlerReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/errorhandler/DefaultErrorHandlerReifier.java
index af09175..30262b5 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/errorhandler/DefaultErrorHandlerReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/errorhandler/DefaultErrorHandlerReifier.java
@@ -29,15 +29,15 @@ import org.apache.camel.spi.ThreadPoolProfile;
 
 public class DefaultErrorHandlerReifier<T extends DefaultErrorHandlerBuilder> extends ErrorHandlerReifier<T> {
 
-    public DefaultErrorHandlerReifier(ErrorHandlerFactory definition) {
-        super((T)definition);
+    public DefaultErrorHandlerReifier(RouteContext routeContext, ErrorHandlerFactory definition) {
+        super(routeContext, (T)definition);
     }
 
     @Override
-    public Processor createErrorHandler(RouteContext routeContext, Processor processor) throws Exception {
-        DefaultErrorHandler answer = new DefaultErrorHandler(routeContext.getCamelContext(), processor, definition.getLogger(), definition.getOnRedelivery(),
+    public Processor createErrorHandler(Processor processor) throws Exception {
+        DefaultErrorHandler answer = new DefaultErrorHandler(camelContext, processor, definition.getLogger(), definition.getOnRedelivery(),
                                                              definition.getRedeliveryPolicy(), definition.getExceptionPolicyStrategy(),
-                                                             definition.getRetryWhilePolicy(routeContext.getCamelContext()), getExecutorService(routeContext.getCamelContext()),
+                                                             definition.getRetryWhilePolicy(camelContext), getExecutorService(camelContext),
                                                              definition.getOnPrepareFailure(), definition.getOnExceptionOccurred());
         // configure error handler before we can use it
         configure(routeContext, answer);
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/errorhandler/ErrorHandlerRefReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/errorhandler/ErrorHandlerRefReifier.java
index d095a0c..c7c466c 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/errorhandler/ErrorHandlerRefReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/errorhandler/ErrorHandlerRefReifier.java
@@ -23,12 +23,12 @@ import org.apache.camel.spi.RouteContext;
 
 public class ErrorHandlerRefReifier extends ErrorHandlerReifier<ErrorHandlerBuilderRef> {
 
-    public ErrorHandlerRefReifier(ErrorHandlerFactory definition) {
-        super((ErrorHandlerBuilderRef)definition);
+    public ErrorHandlerRefReifier(RouteContext routeContext, ErrorHandlerFactory definition) {
+        super(routeContext, (ErrorHandlerBuilderRef)definition);
     }
 
     @Override
-    public Processor createErrorHandler(RouteContext routeContext, Processor processor) throws Exception {
+    public Processor createErrorHandler(Processor processor) throws Exception {
         return definition.createErrorHandler(routeContext, processor);
     }
 
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/errorhandler/ErrorHandlerReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/errorhandler/ErrorHandlerReifier.java
index 2dab2d1..d185cb1 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/errorhandler/ErrorHandlerReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/errorhandler/ErrorHandlerReifier.java
@@ -18,7 +18,7 @@ package org.apache.camel.reifier.errorhandler;
 
 import java.util.HashMap;
 import java.util.Map;
-import java.util.function.Function;
+import java.util.function.BiFunction;
 
 import org.apache.camel.CamelContext;
 import org.apache.camel.ErrorHandlerFactory;
@@ -50,9 +50,9 @@ import org.apache.camel.util.ObjectHelper;
 public abstract class ErrorHandlerReifier<T extends ErrorHandlerBuilderSupport> extends AbstractReifier {
 
     public static final String DEFAULT_ERROR_HANDLER_BUILDER = "CamelDefaultErrorHandlerBuilder";
-    private static final Map<Class<?>, Function<ErrorHandlerFactory, ErrorHandlerReifier<? extends ErrorHandlerFactory>>> ERROR_HANDLERS;
+    private static final Map<Class<?>, BiFunction<RouteContext, ErrorHandlerFactory, ErrorHandlerReifier<? extends ErrorHandlerFactory>>> ERROR_HANDLERS;
     static {
-        Map<Class<?>, Function<ErrorHandlerFactory, ErrorHandlerReifier<? extends ErrorHandlerFactory>>> map = new HashMap<>();
+        Map<Class<?>, BiFunction<RouteContext, ErrorHandlerFactory, ErrorHandlerReifier<? extends ErrorHandlerFactory>>> map = new HashMap<>();
         map.put(DeadLetterChannelBuilder.class, DeadLetterChannelReifier::new);
         map.put(DefaultErrorHandlerBuilder.class, DefaultErrorHandlerReifier::new);
         map.put(ErrorHandlerBuilderRef.class, ErrorHandlerRefReifier::new);
@@ -65,22 +65,23 @@ public abstract class ErrorHandlerReifier<T extends ErrorHandlerBuilderSupport>
     /**
      * Utility classes should not have a public constructor.
      */
-    ErrorHandlerReifier(T definition) {
+    ErrorHandlerReifier(RouteContext routeContext, T definition) {
+        super(routeContext);
         this.definition = definition;
     }
 
-    public static void registerReifier(Class<?> errorHandlerClass, Function<ErrorHandlerFactory, ErrorHandlerReifier<? extends ErrorHandlerFactory>> creator) {
+    public static void registerReifier(Class<?> errorHandlerClass, BiFunction<RouteContext, ErrorHandlerFactory, ErrorHandlerReifier<? extends ErrorHandlerFactory>> creator) {
         ERROR_HANDLERS.put(errorHandlerClass, creator);
     }
 
-    public static ErrorHandlerReifier<? extends ErrorHandlerFactory> reifier(ErrorHandlerFactory definition) {
-        Function<ErrorHandlerFactory, ErrorHandlerReifier<? extends ErrorHandlerFactory>> reifier = ERROR_HANDLERS.get(definition.getClass());
+    public static ErrorHandlerReifier<? extends ErrorHandlerFactory> reifier(RouteContext routeContext, ErrorHandlerFactory definition) {
+        BiFunction<RouteContext, ErrorHandlerFactory, ErrorHandlerReifier<? extends ErrorHandlerFactory>> reifier = ERROR_HANDLERS.get(definition.getClass());
         if (reifier != null) {
-            return reifier.apply(definition);
+            return reifier.apply(routeContext, definition);
         } else if (definition instanceof ErrorHandlerBuilderSupport) {
-            return new ErrorHandlerReifier<ErrorHandlerBuilderSupport>((ErrorHandlerBuilderSupport)definition) {
+            return new ErrorHandlerReifier<ErrorHandlerBuilderSupport>(routeContext, (ErrorHandlerBuilderSupport)definition) {
                 @Override
-                public Processor createErrorHandler(RouteContext routeContext, Processor processor) throws Exception {
+                public Processor createErrorHandler(Processor processor) throws Exception {
                     return definition.createErrorHandler(routeContext, processor);
                 }
             };
@@ -89,10 +90,10 @@ public abstract class ErrorHandlerReifier<T extends ErrorHandlerBuilderSupport>
         }
     }
 
-    public static ExceptionPolicy createExceptionPolicy(OnExceptionDefinition def, RouteContext routeContext) {
+    public static ExceptionPolicy createExceptionPolicy(OnExceptionDefinition def, CamelContext camelContext) {
         return new ExceptionPolicy(def.getId(), CamelContextHelper.getRouteId(def),
-                                   def.getUseOriginalMessage() != null && parseBoolean(routeContext, def.getUseOriginalMessage()),
-                                   def.getUseOriginalBody() != null && parseBoolean(routeContext, def.getUseOriginalBody()),
+                                   def.getUseOriginalMessage() != null && CamelContextHelper.parseBoolean(camelContext, def.getUseOriginalMessage()),
+                                   def.getUseOriginalBody() != null && CamelContextHelper.parseBoolean(camelContext, def.getUseOriginalBody()),
                                    ObjectHelper.isNotEmpty(def.getOutputs()), def.getHandledPolicy(),
                                    def.getContinuedPolicy(), def.getRetryWhilePolicy(), def.getOnRedelivery(),
                                    def.getOnExceptionOccurred(), def.getRedeliveryPolicyRef(),
@@ -239,12 +240,11 @@ public abstract class ErrorHandlerReifier<T extends ErrorHandlerBuilderSupport>
     /**
      * Creates the error handler
      *
-     * @param routeContext the route context
      * @param processor the outer processor
      * @return the error handler
      * @throws Exception is thrown if the error handler could not be created
      */
-    public abstract Processor createErrorHandler(RouteContext routeContext, Processor processor) throws Exception;
+    public abstract Processor createErrorHandler(Processor processor) throws Exception;
 
     public void configure(RouteContext routeContext, ErrorHandler handler) {
         if (handler instanceof ErrorHandlerSupport) {
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/errorhandler/NoErrorHandlerReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/errorhandler/NoErrorHandlerReifier.java
index 118297b..d6c6401 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/errorhandler/NoErrorHandlerReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/errorhandler/NoErrorHandlerReifier.java
@@ -27,12 +27,12 @@ import org.apache.camel.support.processor.DelegateAsyncProcessor;
 
 public class NoErrorHandlerReifier extends ErrorHandlerReifier<NoErrorHandlerBuilder> {
 
-    public NoErrorHandlerReifier(ErrorHandlerFactory definition) {
-        super((NoErrorHandlerBuilder)definition);
+    public NoErrorHandlerReifier(RouteContext routeContext, ErrorHandlerFactory definition) {
+        super(routeContext, (NoErrorHandlerBuilder)definition);
     }
 
     @Override
-    public Processor createErrorHandler(RouteContext routeContext, Processor processor) throws Exception {
+    public Processor createErrorHandler(Processor processor) throws Exception {
         return new DelegateAsyncProcessor(processor) {
             @Override
             public boolean process(final Exchange exchange, final AsyncCallback callback) {
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/loadbalancer/CustomLoadBalancerReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/loadbalancer/CustomLoadBalancerReifier.java
index 34387da..cba3d83 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/loadbalancer/CustomLoadBalancerReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/loadbalancer/CustomLoadBalancerReifier.java
@@ -25,17 +25,17 @@ import org.apache.camel.util.StringHelper;
 
 public class CustomLoadBalancerReifier extends LoadBalancerReifier<CustomLoadBalancerDefinition> {
 
-    public CustomLoadBalancerReifier(LoadBalancerDefinition definition) {
-        super((CustomLoadBalancerDefinition)definition);
+    public CustomLoadBalancerReifier(RouteContext routeContext, LoadBalancerDefinition definition) {
+        super(routeContext, (CustomLoadBalancerDefinition)definition);
     }
 
     @Override
-    public LoadBalancer createLoadBalancer(RouteContext routeContext) {
+    public LoadBalancer createLoadBalancer() {
         if (definition.getCustomLoadBalancer() != null) {
             return definition.getCustomLoadBalancer();
         }
         StringHelper.notEmpty(definition.getRef(), "ref", this);
-        return CamelContextHelper.mandatoryLookup(routeContext.getCamelContext(), definition.getRef(), LoadBalancer.class);
+        return CamelContextHelper.mandatoryLookup(camelContext, definition.getRef(), LoadBalancer.class);
     }
 
 }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/loadbalancer/FailoverLoadBalancerReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/loadbalancer/FailoverLoadBalancerReifier.java
index 526c84f..2c3e58a 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/loadbalancer/FailoverLoadBalancerReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/loadbalancer/FailoverLoadBalancerReifier.java
@@ -28,12 +28,12 @@ import org.apache.camel.util.ObjectHelper;
 
 public class FailoverLoadBalancerReifier extends LoadBalancerReifier<FailoverLoadBalancerDefinition> {
 
-    public FailoverLoadBalancerReifier(LoadBalancerDefinition definition) {
-        super((FailoverLoadBalancerDefinition)definition);
+    public FailoverLoadBalancerReifier(RouteContext routeContext, LoadBalancerDefinition definition) {
+        super(routeContext, (FailoverLoadBalancerDefinition)definition);
     }
 
     @Override
-    public LoadBalancer createLoadBalancer(RouteContext routeContext) {
+    public LoadBalancer createLoadBalancer() {
         FailOverLoadBalancer answer;
 
         List<Class<?>> classes = new ArrayList<>();
@@ -41,7 +41,7 @@ public class FailoverLoadBalancerReifier extends LoadBalancerReifier<FailoverLoa
             classes.addAll(definition.getExceptionTypes());
         } else if (!definition.getExceptions().isEmpty()) {
             for (String name : definition.getExceptions()) {
-                Class<?> type = routeContext.getCamelContext().getClassResolver().resolveClass(name);
+                Class<?> type = camelContext.getClassResolver().resolveClass(name);
                 if (type == null) {
                     throw new IllegalArgumentException("Cannot find class: " + name + " in the classpath");
                 }
@@ -58,13 +58,13 @@ public class FailoverLoadBalancerReifier extends LoadBalancerReifier<FailoverLoa
         }
 
         if (definition.getMaximumFailoverAttempts() != null) {
-            answer.setMaximumFailoverAttempts(parseInt(routeContext, definition.getMaximumFailoverAttempts()));
+            answer.setMaximumFailoverAttempts(parseInt(definition.getMaximumFailoverAttempts()));
         }
         if (definition.getRoundRobin() != null) {
-            answer.setRoundRobin(parseBoolean(routeContext, definition.getRoundRobin()));
+            answer.setRoundRobin(parseBoolean(definition.getRoundRobin()));
         }
         if (definition.getSticky() != null) {
-            answer.setSticky(parseBoolean(routeContext, definition.getSticky()));
+            answer.setSticky(parseBoolean(definition.getSticky()));
         }
 
         return answer;
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/loadbalancer/LoadBalancerReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/loadbalancer/LoadBalancerReifier.java
index 23bc7ee..e672c62 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/loadbalancer/LoadBalancerReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/loadbalancer/LoadBalancerReifier.java
@@ -18,6 +18,7 @@ package org.apache.camel.reifier.loadbalancer;
 
 import java.util.HashMap;
 import java.util.Map;
+import java.util.function.BiFunction;
 import java.util.function.Function;
 
 import org.apache.camel.model.LoadBalancerDefinition;
@@ -35,9 +36,9 @@ import org.apache.camel.util.StringHelper;
 
 public class LoadBalancerReifier<T extends LoadBalancerDefinition> extends AbstractReifier {
 
-    private static final Map<Class<?>, Function<LoadBalancerDefinition, LoadBalancerReifier<? extends LoadBalancerDefinition>>> LOAD_BALANCERS;
+    private static final Map<Class<?>, BiFunction<RouteContext, LoadBalancerDefinition, LoadBalancerReifier<? extends LoadBalancerDefinition>>> LOAD_BALANCERS;
     static {
-        Map<Class<?>, Function<LoadBalancerDefinition, LoadBalancerReifier<? extends LoadBalancerDefinition>>> map = new HashMap<>();
+        Map<Class<?>, BiFunction<RouteContext, LoadBalancerDefinition, LoadBalancerReifier<? extends LoadBalancerDefinition>>> map = new HashMap<>();
         map.put(LoadBalancerDefinition.class, LoadBalancerReifier::new);
         map.put(CustomLoadBalancerDefinition.class, CustomLoadBalancerReifier::new);
         map.put(FailoverLoadBalancerDefinition.class, FailoverLoadBalancerReifier::new);
@@ -51,14 +52,15 @@ public class LoadBalancerReifier<T extends LoadBalancerDefinition> extends Abstr
 
     protected final T definition;
 
-    public LoadBalancerReifier(T definition) {
+    public LoadBalancerReifier(RouteContext routeContext, T definition) {
+        super(routeContext);
         this.definition = definition;
     }
 
-    public static LoadBalancerReifier<? extends LoadBalancerDefinition> reifier(LoadBalancerDefinition definition) {
-        Function<LoadBalancerDefinition, LoadBalancerReifier<? extends LoadBalancerDefinition>> reifier = LOAD_BALANCERS.get(definition.getClass());
+    public static LoadBalancerReifier<? extends LoadBalancerDefinition> reifier(RouteContext routeContext, LoadBalancerDefinition definition) {
+        BiFunction<RouteContext, LoadBalancerDefinition, LoadBalancerReifier<? extends LoadBalancerDefinition>> reifier = LOAD_BALANCERS.get(definition.getClass());
         if (reifier != null) {
-            return reifier.apply(definition);
+            return reifier.apply(routeContext, definition);
         }
         throw new IllegalStateException("Unsupported definition: " + definition);
     }
@@ -66,17 +68,17 @@ public class LoadBalancerReifier<T extends LoadBalancerDefinition> extends Abstr
     /**
      * Factory method to create the load balancer from the loadBalancerTypeName
      */
-    public LoadBalancer createLoadBalancer(RouteContext routeContext) {
+    public LoadBalancer createLoadBalancer() {
         String loadBalancerTypeName = definition.getLoadBalancerTypeName();
         StringHelper.notEmpty(loadBalancerTypeName, "loadBalancerTypeName", this);
 
         LoadBalancer answer = null;
         if (loadBalancerTypeName != null) {
-            Class<?> type = routeContext.getCamelContext().getClassResolver().resolveClass(loadBalancerTypeName, LoadBalancer.class);
+            Class<?> type = camelContext.getClassResolver().resolveClass(loadBalancerTypeName, LoadBalancer.class);
             if (type == null) {
                 throw new IllegalArgumentException("Cannot find class: " + loadBalancerTypeName + " in the classpath");
             }
-            answer = (LoadBalancer)routeContext.getCamelContext().getInjector().newInstance(type, false);
+            answer = (LoadBalancer) camelContext.getInjector().newInstance(type, false);
             definition.configureLoadBalancer(answer);
         }
 
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/loadbalancer/RandomLoadBalancerReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/loadbalancer/RandomLoadBalancerReifier.java
index df170c7..4e9922a 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/loadbalancer/RandomLoadBalancerReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/loadbalancer/RandomLoadBalancerReifier.java
@@ -24,12 +24,12 @@ import org.apache.camel.spi.RouteContext;
 
 public class RandomLoadBalancerReifier extends LoadBalancerReifier<RandomLoadBalancerDefinition> {
 
-    public RandomLoadBalancerReifier(LoadBalancerDefinition definition) {
-        super((RandomLoadBalancerDefinition)definition);
+    public RandomLoadBalancerReifier(RouteContext routeContext, LoadBalancerDefinition definition) {
+        super(routeContext, (RandomLoadBalancerDefinition)definition);
     }
 
     @Override
-    public LoadBalancer createLoadBalancer(RouteContext routeContext) {
+    public LoadBalancer createLoadBalancer() {
         return new RandomLoadBalancer();
     }
 
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/loadbalancer/RoundRobinLoadBalancerReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/loadbalancer/RoundRobinLoadBalancerReifier.java
index 0706b76..d5244a3 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/loadbalancer/RoundRobinLoadBalancerReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/loadbalancer/RoundRobinLoadBalancerReifier.java
@@ -24,12 +24,12 @@ import org.apache.camel.spi.RouteContext;
 
 public class RoundRobinLoadBalancerReifier extends LoadBalancerReifier<RoundRobinLoadBalancerDefinition> {
 
-    public RoundRobinLoadBalancerReifier(LoadBalancerDefinition definition) {
-        super((RoundRobinLoadBalancerDefinition)definition);
+    public RoundRobinLoadBalancerReifier(RouteContext routeContext, LoadBalancerDefinition definition) {
+        super(routeContext, (RoundRobinLoadBalancerDefinition)definition);
     }
 
     @Override
-    public LoadBalancer createLoadBalancer(RouteContext routeContext) {
+    public LoadBalancer createLoadBalancer() {
         return new RoundRobinLoadBalancer();
     }
 
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/loadbalancer/StickyLoadBalancerReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/loadbalancer/StickyLoadBalancerReifier.java
index 08a7da0..a05102f 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/loadbalancer/StickyLoadBalancerReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/loadbalancer/StickyLoadBalancerReifier.java
@@ -24,12 +24,12 @@ import org.apache.camel.spi.RouteContext;
 
 public class StickyLoadBalancerReifier extends LoadBalancerReifier<StickyLoadBalancerDefinition> {
 
-    public StickyLoadBalancerReifier(LoadBalancerDefinition definition) {
-        super((StickyLoadBalancerDefinition)definition);
+    public StickyLoadBalancerReifier(RouteContext routeContext, LoadBalancerDefinition definition) {
+        super(routeContext, (StickyLoadBalancerDefinition)definition);
     }
 
     @Override
-    public LoadBalancer createLoadBalancer(RouteContext routeContext) {
+    public LoadBalancer createLoadBalancer() {
         return new StickyLoadBalancer(definition.getCorrelationExpression().createExpression(routeContext));
     }
 
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/loadbalancer/TopicLoadBalancerReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/loadbalancer/TopicLoadBalancerReifier.java
index ac4a02e..4e749c6 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/loadbalancer/TopicLoadBalancerReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/loadbalancer/TopicLoadBalancerReifier.java
@@ -24,12 +24,12 @@ import org.apache.camel.spi.RouteContext;
 
 public class TopicLoadBalancerReifier extends LoadBalancerReifier<TopicLoadBalancerDefinition> {
 
-    public TopicLoadBalancerReifier(LoadBalancerDefinition definition) {
-        super((TopicLoadBalancerDefinition)definition);
+    public TopicLoadBalancerReifier(RouteContext routeContext, LoadBalancerDefinition definition) {
+        super(routeContext, (TopicLoadBalancerDefinition)definition);
     }
 
     @Override
-    public LoadBalancer createLoadBalancer(RouteContext routeContext) {
+    public LoadBalancer createLoadBalancer() {
         return new TopicLoadBalancer();
     }
 
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/loadbalancer/WeightedLoadBalancerReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/loadbalancer/WeightedLoadBalancerReifier.java
index 742f330..3487b38 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/loadbalancer/WeightedLoadBalancerReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/loadbalancer/WeightedLoadBalancerReifier.java
@@ -30,22 +30,22 @@ import org.apache.camel.spi.RouteContext;
 
 public class WeightedLoadBalancerReifier extends LoadBalancerReifier<WeightedLoadBalancerDefinition> {
 
-    public WeightedLoadBalancerReifier(LoadBalancerDefinition definition) {
-        super((WeightedLoadBalancerDefinition)definition);
+    public WeightedLoadBalancerReifier(RouteContext routeContext, LoadBalancerDefinition definition) {
+        super(routeContext, (WeightedLoadBalancerDefinition)definition);
     }
 
     @Override
-    public LoadBalancer createLoadBalancer(RouteContext routeContext) {
+    public LoadBalancer createLoadBalancer() {
         WeightedLoadBalancer loadBalancer;
         List<Integer> distributionRatioList = new ArrayList<>();
 
         try {
             String[] ratios = definition.getDistributionRatio().split(definition.getDistributionRatioDelimiter());
             for (String ratio : ratios) {
-                distributionRatioList.add(parseInt(routeContext, ratio.trim()));
+                distributionRatioList.add(parseInt(ratio.trim()));
             }
 
-            boolean isRoundRobin = definition.getRoundRobin() != null && parseBoolean(routeContext, definition.getRoundRobin());
+            boolean isRoundRobin = definition.getRoundRobin() != null && parseBoolean(definition.getRoundRobin());
             if (isRoundRobin) {
                 loadBalancer = new WeightedRoundRobinLoadBalancer(distributionRatioList);
             } else {
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/rest/RestBindingReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/rest/RestBindingReifier.java
index b0b8d6d..46671c2 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/rest/RestBindingReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/rest/RestBindingReifier.java
@@ -21,7 +21,6 @@ import java.util.Map;
 
 import javax.xml.bind.JAXBContext;
 
-import org.apache.camel.CamelContext;
 import org.apache.camel.ExtendedCamelContext;
 import org.apache.camel.model.rest.RestBindingDefinition;
 import org.apache.camel.processor.RestBindingAdvice;
@@ -35,14 +34,13 @@ public class RestBindingReifier extends AbstractReifier {
 
     private final RestBindingDefinition definition;
 
-    public RestBindingReifier(RestBindingDefinition definition) {
+    public RestBindingReifier(RouteContext routeContext, RestBindingDefinition definition) {
+        super(routeContext);
         this.definition = definition;
     }
 
-    public RestBindingAdvice createRestBindingAdvice(RouteContext routeContext) throws Exception {
-
-        CamelContext context = routeContext.getCamelContext();
-        RestConfiguration config = context.getRestConfiguration(definition.getComponent(), true);
+    public RestBindingAdvice createRestBindingAdvice() throws Exception {
+        RestConfiguration config = camelContext.getRestConfiguration(definition.getComponent(), true);
 
         // these options can be overridden per rest verb
         String mode = config.getBindingMode().name();
@@ -51,15 +49,15 @@ public class RestBindingReifier extends AbstractReifier {
         }
         boolean cors = config.isEnableCORS();
         if (definition.getEnableCORS() != null) {
-            cors = parseBoolean(routeContext, definition.getEnableCORS());
+            cors = parseBoolean(definition.getEnableCORS());
         }
         boolean skip = config.isSkipBindingOnErrorCode();
         if (definition.getSkipBindingOnErrorCode() != null) {
-            skip = parseBoolean(routeContext, definition.getSkipBindingOnErrorCode());
+            skip = parseBoolean(definition.getSkipBindingOnErrorCode());
         }
         boolean validation = config.isClientRequestValidation();
         if (definition.getClientRequestValidation() != null) {
-            validation = parseBoolean(routeContext, definition.getClientRequestValidation());
+            validation = parseBoolean(definition.getClientRequestValidation());
         }
 
         // cors headers
@@ -67,7 +65,7 @@ public class RestBindingReifier extends AbstractReifier {
 
         if (mode == null || "off".equals(mode)) {
             // binding mode is off, so create a off mode binding processor
-            return new RestBindingAdvice(context, null, null, null, null, definition.getConsumes(), definition.getProduces(), mode, skip, validation, cors, corsHeaders,
+            return new RestBindingAdvice(camelContext, null, null, null, null, definition.getConsumes(), definition.getProduces(), mode, skip, validation, cors, corsHeaders,
                                          definition.getDefaultValues(), definition.getRequiredBody() != null ? definition.getRequiredBody() : false,
                                          definition.getRequiredQueryParameters(), definition.getRequiredHeaders());
         }
@@ -79,7 +77,7 @@ public class RestBindingReifier extends AbstractReifier {
             String name = config.getJsonDataFormat();
             if (name != null) {
                 // must only be a name, not refer to an existing instance
-                Object instance = context.getRegistry().lookupByName(name);
+                Object instance = camelContext.getRegistry().lookupByName(name);
                 if (instance != null) {
                     throw new IllegalArgumentException("JsonDataFormat name: " + name + " must not be an existing bean instance from the registry");
                 }
@@ -88,11 +86,11 @@ public class RestBindingReifier extends AbstractReifier {
             }
             // this will create a new instance as the name was not already
             // pre-created
-            json = context.resolveDataFormat(name);
-            outJson = context.resolveDataFormat(name);
+            json = camelContext.resolveDataFormat(name);
+            outJson = camelContext.resolveDataFormat(name);
 
             if (json != null) {
-                setupJson(context, config, definition.getType(), definition.getOutType(), json, outJson);
+                setupJson(config, definition.getType(), definition.getOutType(), json, outJson);
             }
         }
 
@@ -103,7 +101,7 @@ public class RestBindingReifier extends AbstractReifier {
             String name = config.getXmlDataFormat();
             if (name != null) {
                 // must only be a name, not refer to an existing instance
-                Object instance = context.getRegistry().lookupByName(name);
+                Object instance = camelContext.getRegistry().lookupByName(name);
                 if (instance != null) {
                     throw new IllegalArgumentException("XmlDataFormat name: " + name + " must not be an existing bean instance from the registry");
                 }
@@ -112,8 +110,8 @@ public class RestBindingReifier extends AbstractReifier {
             }
             // this will create a new instance as the name was not already
             // pre-created
-            jaxb = context.resolveDataFormat(name);
-            outJaxb = context.resolveDataFormat(name);
+            jaxb = camelContext.resolveDataFormat(name);
+            outJaxb = camelContext.resolveDataFormat(name);
 
             // is xml binding required?
             if (mode.contains("xml") && jaxb == null) {
@@ -121,68 +119,68 @@ public class RestBindingReifier extends AbstractReifier {
             }
 
             if (jaxb != null) {
-                setupJaxb(context, config, definition.getType(), definition.getOutType(), jaxb, outJaxb);
+                setupJaxb(config, definition.getType(), definition.getOutType(), jaxb, outJaxb);
             }
         }
 
-        return new RestBindingAdvice(context, json, jaxb, outJson, outJaxb, definition.getConsumes(), definition.getProduces(), mode, skip, validation, cors, corsHeaders,
+        return new RestBindingAdvice(camelContext, json, jaxb, outJson, outJaxb, definition.getConsumes(), definition.getProduces(), mode, skip, validation, cors, corsHeaders,
                                      definition.getDefaultValues(), definition.getRequiredBody() != null ? definition.getRequiredBody() : false,
                                      definition.getRequiredQueryParameters(), definition.getRequiredHeaders());
     }
 
-    protected void setupJson(CamelContext context, RestConfiguration config, String type, String outType, DataFormat json, DataFormat outJson) throws Exception {
+    protected void setupJson(RestConfiguration config, String type, String outType, DataFormat json, DataFormat outJson) throws Exception {
         Class<?> clazz = null;
         if (type != null) {
             String typeName = type.endsWith("[]") ? type.substring(0, type.length() - 2) : type;
-            clazz = context.getClassResolver().resolveMandatoryClass(typeName);
+            clazz = camelContext.getClassResolver().resolveMandatoryClass(typeName);
         }
         if (clazz != null) {
-            context.adapt(ExtendedCamelContext.class).getBeanIntrospection().setProperty(context, json, "unmarshalType", clazz);
-            context.adapt(ExtendedCamelContext.class).getBeanIntrospection().setProperty(context, json, "useList", type.endsWith("[]"));
+            camelContext.adapt(ExtendedCamelContext.class).getBeanIntrospection().setProperty(camelContext, json, "unmarshalType", clazz);
+            camelContext.adapt(ExtendedCamelContext.class).getBeanIntrospection().setProperty(camelContext, json, "useList", type.endsWith("[]"));
         }
-        setAdditionalConfiguration(config, context, json, "json.in.");
+        setAdditionalConfiguration(config, json, "json.in.");
 
         Class<?> outClazz = null;
         if (outType != null) {
             String typeName = outType.endsWith("[]") ? outType.substring(0, outType.length() - 2) : outType;
-            outClazz = context.getClassResolver().resolveMandatoryClass(typeName);
+            outClazz = camelContext.getClassResolver().resolveMandatoryClass(typeName);
         }
         if (outClazz != null) {
-            context.adapt(ExtendedCamelContext.class).getBeanIntrospection().setProperty(context, outJson, "unmarshalType", outClazz);
-            context.adapt(ExtendedCamelContext.class).getBeanIntrospection().setProperty(context, outJson, "useList", outType.endsWith("[]"));
+            camelContext.adapt(ExtendedCamelContext.class).getBeanIntrospection().setProperty(camelContext, outJson, "unmarshalType", outClazz);
+            camelContext.adapt(ExtendedCamelContext.class).getBeanIntrospection().setProperty(camelContext, outJson, "useList", outType.endsWith("[]"));
         }
-        setAdditionalConfiguration(config, context, outJson, "json.out.");
+        setAdditionalConfiguration(config, outJson, "json.out.");
     }
 
-    protected void setupJaxb(CamelContext context, RestConfiguration config, String type, String outType, DataFormat jaxb, DataFormat outJaxb) throws Exception {
+    protected void setupJaxb(RestConfiguration config, String type, String outType, DataFormat jaxb, DataFormat outJaxb) throws Exception {
         Class<?> clazz = null;
         if (type != null) {
             String typeName = type.endsWith("[]") ? type.substring(0, type.length() - 2) : type;
-            clazz = context.getClassResolver().resolveMandatoryClass(typeName);
+            clazz = camelContext.getClassResolver().resolveMandatoryClass(typeName);
         }
         if (clazz != null) {
             JAXBContext jc = JAXBContext.newInstance(clazz);
-            context.adapt(ExtendedCamelContext.class).getBeanIntrospection().setProperty(context, jaxb, "context", jc);
+            camelContext.adapt(ExtendedCamelContext.class).getBeanIntrospection().setProperty(camelContext, jaxb, "context", jc);
         }
-        setAdditionalConfiguration(config, context, jaxb, "xml.in.");
+        setAdditionalConfiguration(config, jaxb, "xml.in.");
 
         Class<?> outClazz = null;
         if (outType != null) {
             String typeName = outType.endsWith("[]") ? outType.substring(0, outType.length() - 2) : outType;
-            outClazz = context.getClassResolver().resolveMandatoryClass(typeName);
+            outClazz = camelContext.getClassResolver().resolveMandatoryClass(typeName);
         }
         if (outClazz != null) {
             JAXBContext jc = JAXBContext.newInstance(outClazz);
-            context.adapt(ExtendedCamelContext.class).getBeanIntrospection().setProperty(context, outJaxb, "context", jc);
+            camelContext.adapt(ExtendedCamelContext.class).getBeanIntrospection().setProperty(camelContext, outJaxb, "context", jc);
         } else if (clazz != null) {
             // fallback and use the context from the input
             JAXBContext jc = JAXBContext.newInstance(clazz);
-            context.adapt(ExtendedCamelContext.class).getBeanIntrospection().setProperty(context, outJaxb, "context", jc);
+            camelContext.adapt(ExtendedCamelContext.class).getBeanIntrospection().setProperty(camelContext, outJaxb, "context", jc);
         }
-        setAdditionalConfiguration(config, context, outJaxb, "xml.out.");
+        setAdditionalConfiguration(config, outJaxb, "xml.out.");
     }
 
-    private void setAdditionalConfiguration(RestConfiguration config, CamelContext context, DataFormat dataFormat, String prefix) throws Exception {
+    private void setAdditionalConfiguration(RestConfiguration config, DataFormat dataFormat, String prefix) throws Exception {
         if (config.getDataFormatProperties() != null && !config.getDataFormatProperties().isEmpty()) {
             // must use a copy as otherwise the options gets removed during
             // introspection setProperties
@@ -207,7 +205,7 @@ public class RestBindingReifier extends AbstractReifier {
                 }
             }
 
-            PropertyBindingSupport.build().bind(context, dataFormat, copy);
+            PropertyBindingSupport.build().bind(camelContext, dataFormat, copy);
         }
     }
 
diff --git a/core/camel-core/src/test/java/org/apache/camel/reifier/DataFormatReifierTest.java b/core/camel-core/src/test/java/org/apache/camel/reifier/DataFormatReifierTest.java
index 06c4a03..e98248d 100644
--- a/core/camel-core/src/test/java/org/apache/camel/reifier/DataFormatReifierTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/reifier/DataFormatReifierTest.java
@@ -30,14 +30,14 @@ public class DataFormatReifierTest {
     @Test
     public void testHandleCustomDataFormat() {
         try {
-            DataFormatReifier.reifier(new MyDataFormat());
+            DataFormatReifier.reifier(null, new MyDataFormat());
 
             fail("Should throw IllegalStateException instead");
         } catch (IllegalStateException e) {
         }
 
         DataFormatReifier.registerReifier(MyDataFormat.class, CustomDataFormatReifier::new);
-        DataFormatReifier.reifier(new MyDataFormat());
+        DataFormatReifier.reifier(null, new MyDataFormat());
     }
 
     public static class MyDataFormat extends CustomDataFormat {
diff --git a/core/camel-core/src/test/java/org/apache/camel/reifier/ProcessorReifierTest.java b/core/camel-core/src/test/java/org/apache/camel/reifier/ProcessorReifierTest.java
index e2c953c..d6a0c86 100644
--- a/core/camel-core/src/test/java/org/apache/camel/reifier/ProcessorReifierTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/reifier/ProcessorReifierTest.java
@@ -16,7 +16,9 @@
  */
 package org.apache.camel.reifier;
 
+import org.apache.camel.impl.engine.DefaultRouteContext;
 import org.apache.camel.model.ProcessDefinition;
+import org.apache.camel.spi.RouteContext;
 import org.junit.Test;
 
 import static junit.framework.TestCase.fail;
@@ -24,15 +26,16 @@ import static junit.framework.TestCase.fail;
 public class ProcessorReifierTest {
     @Test
     public void testHandleCustomProcessorDefinition() {
+        RouteContext ctx = new DefaultRouteContext(null, null, null);
         try {
-            ProcessorReifier.reifier(new MyProcessor());
+            ProcessorReifier.reifier(ctx, new MyProcessor());
 
             fail("Should throw IllegalStateException instead");
         } catch (IllegalStateException e) {
         }
 
         ProcessorReifier.registerReifier(MyProcessor.class, ProcessReifier::new);
-        ProcessorReifier.reifier(new ProcessDefinition());
+        ProcessorReifier.reifier(ctx, new ProcessDefinition());
     }
 
     public static class MyProcessor extends ProcessDefinition {
diff --git a/core/camel-support/src/main/java/org/apache/camel/support/CamelContextHelper.java b/core/camel-support/src/main/java/org/apache/camel/support/CamelContextHelper.java
index ff0fb7a..a635de2 100644
--- a/core/camel-support/src/main/java/org/apache/camel/support/CamelContextHelper.java
+++ b/core/camel-support/src/main/java/org/apache/camel/support/CamelContextHelper.java
@@ -378,11 +378,23 @@ public final class CamelContextHelper {
     }
 
     /**
+     * Parses the given text and converts it to an Integer and handling property placeholders as well
+     *
+     * @param camelContext the camel context
+     * @param text  the text
+     * @return the int value, or <tt>null</tt> if the text was <tt>null</tt>
+     * @throws IllegalStateException is thrown if illegal argument or type conversion not possible
+     */
+    public static Integer parseInt(CamelContext camelContext, String text) {
+        return parse(camelContext, Integer.class, text);
+    }
+
+    /**
      * Parses the given text and converts it to an Long and handling property placeholders as well
      *
      * @param camelContext the camel context
      * @param text  the text
-     * @return the long vale, or <tt>null</tt> if the text was <tt>null</tt>
+     * @return the long value, or <tt>null</tt> if the text was <tt>null</tt>
      * @throws IllegalStateException is thrown if illegal argument or type conversion not possible
      */
     public static Long parseLong(CamelContext camelContext, String text) {

Reply | Threaded
Open this post in threaded view
|

[camel] 02/18: Fix unit test

Guillaume Nodet-2
In reply to this post by Guillaume Nodet-2
This is an automated email from the ASF dual-hosted git repository.

gnodet pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 6a1092804ae17a83635f7e102226b603ff5e1b21
Author: Guillaume Nodet <[hidden email]>
AuthorDate: Mon Feb 10 15:14:33 2020 +0100

    Fix unit test
---
 .../ValidatorEndpointClearCachedSchemaTest.java       | 19 ++++---------------
 1 file changed, 4 insertions(+), 15 deletions(-)

diff --git a/core/camel-core/src/test/java/org/apache/camel/component/validator/ValidatorEndpointClearCachedSchemaTest.java b/core/camel-core/src/test/java/org/apache/camel/component/validator/ValidatorEndpointClearCachedSchemaTest.java
index 8bc6fb3..39ba2f7 100644
--- a/core/camel-core/src/test/java/org/apache/camel/component/validator/ValidatorEndpointClearCachedSchemaTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/component/validator/ValidatorEndpointClearCachedSchemaTest.java
@@ -18,7 +18,6 @@ package org.apache.camel.component.validator;
 
 import java.nio.charset.StandardCharsets;
 import java.util.Collection;
-import java.util.List;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.TimeUnit;
@@ -26,7 +25,6 @@ import java.util.concurrent.TimeUnit;
 import org.apache.camel.CamelContext;
 import org.apache.camel.ContextTestSupport;
 import org.apache.camel.Endpoint;
-import org.apache.camel.Exchange;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.impl.DefaultCamelContext;
@@ -42,16 +40,11 @@ public class ValidatorEndpointClearCachedSchemaTest extends ContextTestSupport {
 
     private static final Logger LOG = LoggerFactory.getLogger(ValidatorEndpointClearCachedSchemaTest.class);
 
-    private CamelContext context;
-
     @Test
     public void testClearCachedSchema() throws Exception {
 
         MockEndpoint mock = getMockEndpoint("mock:result");
 
-        // send one message for start up to finish.
-        new Sender().run();
-
         // send with 5 sender threads in parallel and call clear cache in
         // between
         ExecutorService senderPool = Executors.newFixedThreadPool(5);
@@ -59,7 +52,7 @@ public class ValidatorEndpointClearCachedSchemaTest extends ContextTestSupport {
         for (int i = 0; i < 5; i++) {
             senderPool.execute(new Sender());
             if (i == 2) {
-                /**
+                /*
                  * The clear cache thread calls xsdEndpoint.clearCachedSchema
                  */
                 executorClearCache.execute(new ClearCache());
@@ -69,17 +62,13 @@ public class ValidatorEndpointClearCachedSchemaTest extends ContextTestSupport {
         senderPool.shutdown();
         executorClearCache.shutdown();
 
-        senderPool.awaitTermination(2, TimeUnit.SECONDS);
-
-        List<Exchange> exchanges = mock.getExchanges();
-
-        assertNotNull(exchanges);
+        senderPool.awaitTermination(4, TimeUnit.SECONDS);
 
         // expect at least 5 correct sent messages, the messages sent before
         // the clearCacheSchema method is called will fail with a validation
         // error and will nor result in an exchange
-        assertTrue("Less then expected exchanges", exchanges.size() > 5);
-
+        mock.expectedMinimumMessageCount(5);
+        mock.assertIsSatisfied();
     }
 
     @Override

Reply | Threaded
Open this post in threaded view
|

[camel] 03/18: Move a few methods from ProcessorDefinitionHelper to ProcessorDefinition

Guillaume Nodet-2
In reply to this post by Guillaume Nodet-2
This is an automated email from the ASF dual-hosted git repository.

gnodet pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 52451f1d13a9a873f633f82721c9bfae08a80aa9
Author: Guillaume Nodet <[hidden email]>
AuthorDate: Mon Feb 10 15:22:17 2020 +0100

    Move a few methods from ProcessorDefinitionHelper to ProcessorDefinition
---
 .../component/resilience4j/ResilienceReifier.java  |   3 +-
 .../camel/model/ProcessorDefinitionHelper.java     | 259 -------------------
 .../org/apache/camel/reifier/AggregateReifier.java |  21 +-
 .../org/apache/camel/reifier/DelayReifier.java     |   5 +-
 .../apache/camel/reifier/LoadBalanceReifier.java   |   4 +-
 .../org/apache/camel/reifier/MulticastReifier.java |   5 +-
 .../apache/camel/reifier/OnCompletionReifier.java  |   5 +-
 .../apache/camel/reifier/OnExceptionReifier.java   |   2 +-
 .../org/apache/camel/reifier/ProcessorReifier.java | 287 +++++++++++++++++++--
 .../apache/camel/reifier/RecipientListReifier.java |   7 +-
 .../org/apache/camel/reifier/RouteReifier.java     |   5 +-
 .../org/apache/camel/reifier/SplitReifier.java     |   5 +-
 .../org/apache/camel/reifier/ThreadsReifier.java   |   5 +-
 .../org/apache/camel/reifier/ThrottleReifier.java  |   5 +-
 .../org/apache/camel/reifier/WireTapReifier.java   |   7 +-
 .../camel/reifier/rest/RestBindingReifier.java     |  10 +-
 16 files changed, 308 insertions(+), 327 deletions(-)

diff --git a/components/camel-resilience4j/src/main/java/org/apache/camel/component/resilience4j/ResilienceReifier.java b/components/camel-resilience4j/src/main/java/org/apache/camel/component/resilience4j/ResilienceReifier.java
index ffefa52..6eb6c27 100644
--- a/components/camel-resilience4j/src/main/java/org/apache/camel/component/resilience4j/ResilienceReifier.java
+++ b/components/camel-resilience4j/src/main/java/org/apache/camel/component/resilience4j/ResilienceReifier.java
@@ -31,7 +31,6 @@ import org.apache.camel.ExtendedCamelContext;
 import org.apache.camel.Processor;
 import org.apache.camel.model.CircuitBreakerDefinition;
 import org.apache.camel.model.Model;
-import org.apache.camel.model.ProcessorDefinitionHelper;
 import org.apache.camel.model.Resilience4jConfigurationCommon;
 import org.apache.camel.model.Resilience4jConfigurationDefinition;
 import org.apache.camel.reifier.ProcessorReifier;
@@ -152,7 +151,7 @@ public class ResilienceReifier extends ProcessorReifier<CircuitBreakerDefinition
             boolean shutdownThreadPool = false;
             ExecutorService executorService = routeContext.lookup(ref, ExecutorService.class);
             if (executorService == null) {
-                executorService = ProcessorDefinitionHelper.lookupExecutorServiceRef(routeContext, "CircuitBreaker", definition, ref);
+                executorService = lookupExecutorServiceRef("CircuitBreaker", definition, ref);
                 shutdownThreadPool = true;
             }
             processor.setExecutorService(executorService);
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/model/ProcessorDefinitionHelper.java b/core/camel-core-engine/src/main/java/org/apache/camel/model/ProcessorDefinitionHelper.java
index da812b8..1996c1f 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/model/ProcessorDefinitionHelper.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/model/ProcessorDefinitionHelper.java
@@ -24,24 +24,17 @@ import java.util.List;
 import java.util.Map;
 import java.util.Objects;
 import java.util.Set;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.ScheduledExecutorService;
 import java.util.function.Consumer;
 import java.util.function.Supplier;
 
-import javax.xml.namespace.QName;
-
 import org.apache.camel.CamelContext;
 import org.apache.camel.Exchange;
 import org.apache.camel.ExchangeConstantProvider;
 import org.apache.camel.NamedNode;
 import org.apache.camel.RuntimeCamelException;
-import org.apache.camel.spi.ExecutorServiceManager;
 import org.apache.camel.spi.PropertiesComponent;
 import org.apache.camel.spi.PropertyPlaceholderConfigurer;
-import org.apache.camel.spi.RouteContext;
 import org.apache.camel.support.PropertyBindingSupport;
-import org.apache.camel.util.ObjectHelper;
 import org.apache.camel.util.StringHelper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -369,258 +362,6 @@ public final class ProcessorDefinitionHelper {
     }
 
     /**
-     * Is there any outputs in the given list.
-     * <p/>
-     * Is used for check if the route output has any real outputs (non
-     * abstracts)
-     *
-     * @param outputs the outputs
-     * @param excludeAbstract whether or not to exclude abstract outputs (e.g.
-     *            skip onException etc.)
-     * @return <tt>true</tt> if has outputs, otherwise <tt>false</tt> is
-     *         returned
-     */
-    @SuppressWarnings({"unchecked", "rawtypes"})
-    public static boolean hasOutputs(List<ProcessorDefinition<?>> outputs, boolean excludeAbstract) {
-        if (outputs == null || outputs.isEmpty()) {
-            return false;
-        }
-        if (!excludeAbstract) {
-            return !outputs.isEmpty();
-        }
-        for (ProcessorDefinition output : outputs) {
-            if (output.isWrappingEntireOutput()) {
-                // special for those as they wrap entire output, so we should
-                // just check its output
-                return hasOutputs(output.getOutputs(), excludeAbstract);
-            }
-            if (!output.isAbstract()) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    /**
-     * Determines whether a new thread pool will be created or not.
-     * <p/>
-     * This is used to know if a new thread pool will be created, and therefore
-     * is not shared by others, and therefore exclusive to the definition.
-     *
-     * @param routeContext the route context
-     * @param definition the node definition which may leverage executor
-     *            service.
-     * @param useDefault whether to fallback and use a default thread pool, if
-     *            no explicit configured
-     * @return <tt>true</tt> if a new thread pool will be created,
-     *         <tt>false</tt> if not
-     * @see #getConfiguredExecutorService(org.apache.camel.spi.RouteContext,
-     *      String, ExecutorServiceAwareDefinition, boolean)
-     */
-    public static boolean willCreateNewThreadPool(RouteContext routeContext, ExecutorServiceAwareDefinition<?> definition, boolean useDefault) {
-        ExecutorServiceManager manager = routeContext.getCamelContext().getExecutorServiceManager();
-        ObjectHelper.notNull(manager, "ExecutorServiceManager", routeContext.getCamelContext());
-
-        if (definition.getExecutorService() != null) {
-            // no there is a custom thread pool configured
-            return false;
-        } else if (definition.getExecutorServiceRef() != null) {
-            ExecutorService answer = routeContext.lookup(definition.getExecutorServiceRef(), ExecutorService.class);
-            // if no existing thread pool, then we will have to create a new
-            // thread pool
-            return answer == null;
-        } else if (useDefault) {
-            return true;
-        }
-
-        return false;
-    }
-
-    /**
-     * Will lookup in {@link org.apache.camel.spi.Registry} for a
-     * {@link ExecutorService} registered with the given
-     * <tt>executorServiceRef</tt> name.
-     * <p/>
-     * This method will lookup for configured thread pool in the following order
-     * <ul>
-     * <li>from the {@link org.apache.camel.spi.Registry} if found</li>
-     * <li>from the known list of {@link org.apache.camel.spi.ThreadPoolProfile
-     * ThreadPoolProfile(s)}.</li>
-     * <li>if none found, then <tt>null</tt> is returned.</li>
-     * </ul>
-     *
-     * @param routeContext the route context
-     * @param name name which is appended to the thread name, when the
-     *            {@link java.util.concurrent.ExecutorService} is created based
-     *            on a {@link org.apache.camel.spi.ThreadPoolProfile}.
-     * @param source the source to use the thread pool
-     * @param executorServiceRef reference name of the thread pool
-     * @return the executor service, or <tt>null</tt> if none was found.
-     */
-    public static ExecutorService lookupExecutorServiceRef(RouteContext routeContext, String name, Object source, String executorServiceRef) {
-
-        ExecutorServiceManager manager = routeContext.getCamelContext().getExecutorServiceManager();
-        ObjectHelper.notNull(manager, "ExecutorServiceManager", routeContext.getCamelContext());
-        ObjectHelper.notNull(executorServiceRef, "executorServiceRef");
-
-        // lookup in registry first and use existing thread pool if exists
-        ExecutorService answer = routeContext.lookup(executorServiceRef, ExecutorService.class);
-        if (answer == null) {
-            // then create a thread pool assuming the ref is a thread pool
-            // profile id
-            answer = manager.newThreadPool(source, name, executorServiceRef);
-        }
-        return answer;
-    }
-
-    /**
-     * Will lookup and get the configured
-     * {@link java.util.concurrent.ExecutorService} from the given definition.
-     * <p/>
-     * This method will lookup for configured thread pool in the following order
-     * <ul>
-     * <li>from the definition if any explicit configured executor service.</li>
-     * <li>from the {@link org.apache.camel.spi.Registry} if found</li>
-     * <li>from the known list of {@link org.apache.camel.spi.ThreadPoolProfile
-     * ThreadPoolProfile(s)}.</li>
-     * <li>if none found, then <tt>null</tt> is returned.</li>
-     * </ul>
-     * The various {@link ExecutorServiceAwareDefinition} should use this helper
-     * method to ensure they support configured executor services in the same
-     * coherent way.
-     *
-     * @param routeContext the route context
-     * @param name name which is appended to the thread name, when the
-     *            {@link java.util.concurrent.ExecutorService} is created based
-     *            on a {@link org.apache.camel.spi.ThreadPoolProfile}.
-     * @param definition the node definition which may leverage executor
-     *            service.
-     * @param useDefault whether to fallback and use a default thread pool, if
-     *            no explicit configured
-     * @return the configured executor service, or <tt>null</tt> if none was
-     *         configured.
-     * @throws IllegalArgumentException is thrown if lookup of executor service
-     *             in {@link org.apache.camel.spi.Registry} was not found
-     */
-    public static ExecutorService getConfiguredExecutorService(RouteContext routeContext, String name, ExecutorServiceAwareDefinition<?> definition, boolean useDefault)
-        throws IllegalArgumentException {
-        ExecutorServiceManager manager = routeContext.getCamelContext().getExecutorServiceManager();
-        ObjectHelper.notNull(manager, "ExecutorServiceManager", routeContext.getCamelContext());
-
-        // prefer to use explicit configured executor on the definition
-        if (definition.getExecutorService() != null) {
-            return definition.getExecutorService();
-        } else if (definition.getExecutorServiceRef() != null) {
-            // lookup in registry first and use existing thread pool if exists
-            ExecutorService answer = lookupExecutorServiceRef(routeContext, name, definition, definition.getExecutorServiceRef());
-            if (answer == null) {
-                throw new IllegalArgumentException("ExecutorServiceRef " + definition.getExecutorServiceRef()
-                                                   + " not found in registry (as an ExecutorService instance) or as a thread pool profile.");
-            }
-            return answer;
-        } else if (useDefault) {
-            return manager.newDefaultThreadPool(definition, name);
-        }
-
-        return null;
-    }
-
-    /**
-     * Will lookup in {@link org.apache.camel.spi.Registry} for a
-     * {@link ScheduledExecutorService} registered with the given
-     * <tt>executorServiceRef</tt> name.
-     * <p/>
-     * This method will lookup for configured thread pool in the following order
-     * <ul>
-     * <li>from the {@link org.apache.camel.spi.Registry} if found</li>
-     * <li>from the known list of {@link org.apache.camel.spi.ThreadPoolProfile
-     * ThreadPoolProfile(s)}.</li>
-     * <li>if none found, then <tt>null</tt> is returned.</li>
-     * </ul>
-     *
-     * @param routeContext the route context
-     * @param name name which is appended to the thread name, when the
-     *            {@link java.util.concurrent.ExecutorService} is created based
-     *            on a {@link org.apache.camel.spi.ThreadPoolProfile}.
-     * @param source the source to use the thread pool
-     * @param executorServiceRef reference name of the thread pool
-     * @return the executor service, or <tt>null</tt> if none was found.
-     */
-    public static ScheduledExecutorService lookupScheduledExecutorServiceRef(RouteContext routeContext, String name, Object source, String executorServiceRef) {
-
-        ExecutorServiceManager manager = routeContext.getCamelContext().getExecutorServiceManager();
-        ObjectHelper.notNull(manager, "ExecutorServiceManager", routeContext.getCamelContext());
-        ObjectHelper.notNull(executorServiceRef, "executorServiceRef");
-
-        // lookup in registry first and use existing thread pool if exists
-        ScheduledExecutorService answer = routeContext.lookup(executorServiceRef, ScheduledExecutorService.class);
-        if (answer == null) {
-            // then create a thread pool assuming the ref is a thread pool
-            // profile id
-            answer = manager.newScheduledThreadPool(source, name, executorServiceRef);
-        }
-        return answer;
-    }
-
-    /**
-     * Will lookup and get the configured
-     * {@link java.util.concurrent.ScheduledExecutorService} from the given
-     * definition.
-     * <p/>
-     * This method will lookup for configured thread pool in the following order
-     * <ul>
-     * <li>from the definition if any explicit configured executor service.</li>
-     * <li>from the {@link org.apache.camel.spi.Registry} if found</li>
-     * <li>from the known list of {@link org.apache.camel.spi.ThreadPoolProfile
-     * ThreadPoolProfile(s)}.</li>
-     * <li>if none found, then <tt>null</tt> is returned.</li>
-     * </ul>
-     * The various {@link ExecutorServiceAwareDefinition} should use this helper
-     * method to ensure they support configured executor services in the same
-     * coherent way.
-     *
-     * @param routeContext the rout context
-     * @param name name which is appended to the thread name, when the
-     *            {@link java.util.concurrent.ExecutorService} is created based
-     *            on a {@link org.apache.camel.spi.ThreadPoolProfile}.
-     * @param definition the node definition which may leverage executor
-     *            service.
-     * @param useDefault whether to fallback and use a default thread pool, if
-     *            no explicit configured
-     * @return the configured executor service, or <tt>null</tt> if none was
-     *         configured.
-     * @throws IllegalArgumentException is thrown if the found instance is not a
-     *             ScheduledExecutorService type, or lookup of executor service
-     *             in {@link org.apache.camel.spi.Registry} was not found
-     */
-    public static ScheduledExecutorService getConfiguredScheduledExecutorService(RouteContext routeContext, String name, ExecutorServiceAwareDefinition<?> definition,
-                                                                                 boolean useDefault)
-        throws IllegalArgumentException {
-        ExecutorServiceManager manager = routeContext.getCamelContext().getExecutorServiceManager();
-        ObjectHelper.notNull(manager, "ExecutorServiceManager", routeContext.getCamelContext());
-
-        // prefer to use explicit configured executor on the definition
-        if (definition.getExecutorService() != null) {
-            ExecutorService executorService = definition.getExecutorService();
-            if (executorService instanceof ScheduledExecutorService) {
-                return (ScheduledExecutorService)executorService;
-            }
-            throw new IllegalArgumentException("ExecutorServiceRef " + definition.getExecutorServiceRef() + " is not an ScheduledExecutorService instance");
-        } else if (definition.getExecutorServiceRef() != null) {
-            ScheduledExecutorService answer = lookupScheduledExecutorServiceRef(routeContext, name, definition, definition.getExecutorServiceRef());
-            if (answer == null) {
-                throw new IllegalArgumentException("ExecutorServiceRef " + definition.getExecutorServiceRef()
-                                                   + " not found in registry (as an ScheduledExecutorService instance) or as a thread pool profile.");
-            }
-            return answer;
-        } else if (useDefault) {
-            return manager.newDefaultScheduledThreadPool(definition, name);
-        }
-
-        return null;
-    }
-
-    /**
      * The RestoreAction is used to track all the undo/restore actions that need
      * to be performed to undo any resolution to property placeholders that have
      * been applied to the camel route defs. This class is private so it does
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/AggregateReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/AggregateReifier.java
index defa9af..81f129f 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/AggregateReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/AggregateReifier.java
@@ -20,7 +20,6 @@ import java.util.concurrent.ExecutorService;
 import java.util.concurrent.ScheduledExecutorService;
 
 import org.apache.camel.AggregationStrategy;
-import org.apache.camel.CamelContext;
 import org.apache.camel.CamelContextAware;
 import org.apache.camel.Expression;
 import org.apache.camel.Predicate;
@@ -28,7 +27,6 @@ import org.apache.camel.Processor;
 import org.apache.camel.model.AggregateDefinition;
 import org.apache.camel.model.OptimisticLockRetryPolicyDefinition;
 import org.apache.camel.model.ProcessorDefinition;
-import org.apache.camel.model.ProcessorDefinitionHelper;
 import org.apache.camel.processor.CamelInternalProcessor;
 import org.apache.camel.processor.aggregate.AggregateController;
 import org.apache.camel.processor.aggregate.AggregateProcessor;
@@ -36,7 +34,6 @@ import org.apache.camel.processor.aggregate.AggregationStrategyBeanAdapter;
 import org.apache.camel.processor.aggregate.OptimisticLockRetryPolicy;
 import org.apache.camel.spi.AggregationRepository;
 import org.apache.camel.spi.RouteContext;
-import org.apache.camel.support.CamelContextHelper;
 import org.apache.camel.util.concurrent.SynchronousExecutorService;
 
 public class AggregateReifier extends ProcessorReifier<AggregateDefinition> {
@@ -61,8 +58,8 @@ public class AggregateReifier extends ProcessorReifier<AggregateDefinition> {
         AggregationStrategy strategy = createAggregationStrategy(routeContext);
 
         boolean parallel = parseBoolean(definition.getParallelProcessing());
-        boolean shutdownThreadPool = ProcessorDefinitionHelper.willCreateNewThreadPool(routeContext, definition, parallel);
-        ExecutorService threadPool = ProcessorDefinitionHelper.getConfiguredExecutorService(routeContext, "Aggregator", definition, parallel);
+        boolean shutdownThreadPool = willCreateNewThreadPool(definition, parallel);
+        ExecutorService threadPool = getConfiguredExecutorService("Aggregator", definition, parallel);
         if (threadPool == null && !parallel) {
             // executor service is mandatory for the Aggregator
             // we do not run in parallel mode, but use a synchronous executor,
@@ -169,7 +166,7 @@ public class AggregateReifier extends ProcessorReifier<AggregateDefinition> {
         }
         if (definition.getOptimisticLockRetryPolicy() == null) {
             if (definition.getOptimisticLockRetryPolicyDefinition() != null) {
-                answer.setOptimisticLockRetryPolicy(createOptimisticLockRetryPolicy(camelContext, definition.getOptimisticLockRetryPolicyDefinition()));
+                answer.setOptimisticLockRetryPolicy(createOptimisticLockRetryPolicy(definition.getOptimisticLockRetryPolicyDefinition()));
             }
         } else {
             answer.setOptimisticLockRetryPolicy(definition.getOptimisticLockRetryPolicy());
@@ -183,22 +180,22 @@ public class AggregateReifier extends ProcessorReifier<AggregateDefinition> {
         return answer;
     }
 
-    public static OptimisticLockRetryPolicy createOptimisticLockRetryPolicy(CamelContext camelContext, OptimisticLockRetryPolicyDefinition definition) {
+    public OptimisticLockRetryPolicy createOptimisticLockRetryPolicy(OptimisticLockRetryPolicyDefinition definition) {
         OptimisticLockRetryPolicy policy = new OptimisticLockRetryPolicy();
         if (definition.getMaximumRetries() != null) {
-            policy.setMaximumRetries(CamelContextHelper.parseInt(camelContext, definition.getMaximumRetries()));
+            policy.setMaximumRetries(parseInt(definition.getMaximumRetries()));
         }
         if (definition.getRetryDelay() != null) {
-            policy.setRetryDelay(CamelContextHelper.parseLong(camelContext, definition.getRetryDelay()));
+            policy.setRetryDelay(parseLong(definition.getRetryDelay()));
         }
         if (definition.getMaximumRetryDelay() != null) {
-            policy.setMaximumRetryDelay(CamelContextHelper.parseLong(camelContext, definition.getMaximumRetryDelay()));
+            policy.setMaximumRetryDelay(parseLong(definition.getMaximumRetryDelay()));
         }
         if (definition.getExponentialBackOff() != null) {
-            policy.setExponentialBackOff(CamelContextHelper.parseBoolean(camelContext, definition.getExponentialBackOff()));
+            policy.setExponentialBackOff(parseBoolean(definition.getExponentialBackOff()));
         }
         if (definition.getRandomBackOff() != null) {
-            policy.setRandomBackOff(CamelContextHelper.parseBoolean(camelContext, definition.getRandomBackOff()));
+            policy.setRandomBackOff(parseBoolean(definition.getRandomBackOff()));
         }
         return policy;
     }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/DelayReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/DelayReifier.java
index 044069b..69bcd4f 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/DelayReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/DelayReifier.java
@@ -22,7 +22,6 @@ import org.apache.camel.Expression;
 import org.apache.camel.Processor;
 import org.apache.camel.model.DelayDefinition;
 import org.apache.camel.model.ProcessorDefinition;
-import org.apache.camel.model.ProcessorDefinitionHelper;
 import org.apache.camel.model.language.ExpressionDefinition;
 import org.apache.camel.processor.Delayer;
 import org.apache.camel.spi.RouteContext;
@@ -39,8 +38,8 @@ public class DelayReifier extends ExpressionReifier<DelayDefinition> {
         Expression delay = createAbsoluteTimeDelayExpression(routeContext);
 
         boolean async = definition.getAsyncDelayed() == null || Boolean.parseBoolean(definition.getAsyncDelayed());
-        boolean shutdownThreadPool = ProcessorDefinitionHelper.willCreateNewThreadPool(routeContext, definition, async);
-        ScheduledExecutorService threadPool = ProcessorDefinitionHelper.getConfiguredScheduledExecutorService(routeContext, "Delay", definition, async);
+        boolean shutdownThreadPool = willCreateNewThreadPool(definition, async);
+        ScheduledExecutorService threadPool = getConfiguredScheduledExecutorService("Delay", definition, async);
 
         Delayer answer = new Delayer(camelContext, childProcessor, delay, threadPool, shutdownThreadPool);
         answer.setAsyncDelayed(async);
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/LoadBalanceReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/LoadBalanceReifier.java
index 0ed74e3..72c3d03 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/LoadBalanceReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/LoadBalanceReifier.java
@@ -58,7 +58,7 @@ public class LoadBalanceReifier extends ProcessorReifier<LoadBalanceDefinition>
                     throw new IllegalArgumentException("Loadbalancer already configured to: " + definition.getLoadBalancerType() + ". Cannot set it to: " + processorType);
                 }
                 Processor processor = createProcessor(processorType);
-                Channel channel = wrapChannel(routeContext, processor, processorType);
+                Channel channel = wrapChannel(processor, processorType);
                 loadBalancer.addProcessor(channel);
             }
         }
@@ -71,7 +71,7 @@ public class LoadBalanceReifier extends ProcessorReifier<LoadBalanceDefinition>
             // handler can react afterwards
             inherit = true;
         }
-        Processor target = wrapChannel(routeContext, loadBalancer, definition, inherit);
+        Processor target = wrapChannel(loadBalancer, definition, inherit);
         return target;
     }
 
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/MulticastReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/MulticastReifier.java
index 71a7b4c..e66b2dd 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/MulticastReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/MulticastReifier.java
@@ -25,7 +25,6 @@ import org.apache.camel.CamelContextAware;
 import org.apache.camel.Processor;
 import org.apache.camel.model.MulticastDefinition;
 import org.apache.camel.model.ProcessorDefinition;
-import org.apache.camel.model.ProcessorDefinitionHelper;
 import org.apache.camel.processor.MulticastProcessor;
 import org.apache.camel.processor.aggregate.AggregationStrategyBeanAdapter;
 import org.apache.camel.processor.aggregate.ShareUnitOfWorkAggregationStrategy;
@@ -64,8 +63,8 @@ public class MulticastReifier extends ProcessorReifier<MulticastDefinition> {
         boolean isParallelAggregate = definition.getParallelAggregate() != null && parseBoolean(definition.getParallelAggregate());
         boolean isStopOnAggregateException = definition.getStopOnAggregateException() != null && parseBoolean(definition.getStopOnAggregateException());
 
-        boolean shutdownThreadPool = ProcessorDefinitionHelper.willCreateNewThreadPool(routeContext, definition, isParallelProcessing);
-        ExecutorService threadPool = ProcessorDefinitionHelper.getConfiguredExecutorService(routeContext, "Multicast", definition, isParallelProcessing);
+        boolean shutdownThreadPool = willCreateNewThreadPool(definition, isParallelProcessing);
+        ExecutorService threadPool = getConfiguredExecutorService("Multicast", definition, isParallelProcessing);
 
         long timeout = definition.getTimeout() != null ? parseLong(definition.getTimeout()) : 0;
         if (timeout > 0 && !isParallelProcessing) {
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/OnCompletionReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/OnCompletionReifier.java
index bc71d5b..eb47895 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/OnCompletionReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/OnCompletionReifier.java
@@ -23,7 +23,6 @@ import org.apache.camel.Processor;
 import org.apache.camel.model.OnCompletionDefinition;
 import org.apache.camel.model.OnCompletionMode;
 import org.apache.camel.model.ProcessorDefinition;
-import org.apache.camel.model.ProcessorDefinitionHelper;
 import org.apache.camel.processor.CamelInternalProcessor;
 import org.apache.camel.processor.OnCompletionProcessor;
 import org.apache.camel.spi.RouteContext;
@@ -76,8 +75,8 @@ public class OnCompletionReifier extends ProcessorReifier<OnCompletionDefinition
             when = definition.getOnWhen().getExpression().createPredicate(routeContext);
         }
 
-        boolean shutdownThreadPool = ProcessorDefinitionHelper.willCreateNewThreadPool(routeContext, definition, isParallelProcessing);
-        ExecutorService threadPool = ProcessorDefinitionHelper.getConfiguredExecutorService(routeContext, "OnCompletion", definition, isParallelProcessing);
+        boolean shutdownThreadPool = willCreateNewThreadPool(definition, isParallelProcessing);
+        ExecutorService threadPool = getConfiguredExecutorService("OnCompletion", definition, isParallelProcessing);
 
         // should be after consumer by default
         boolean afterConsumer = definition.getMode() == null || definition.getMode() == OnCompletionMode.AfterConsumer;
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/OnExceptionReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/OnExceptionReifier.java
index 57a3425..5f94c72 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/OnExceptionReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/OnExceptionReifier.java
@@ -38,7 +38,7 @@ public class OnExceptionReifier extends ProcessorReifier<OnExceptionDefinition>
     }
 
     @Override
-    public void addRoutes(RouteContext routeContext) throws Exception {
+    public void addRoutes() throws Exception {
         // assign whether this was a route scoped onException or not
         // we need to know this later when setting the parent, as only route
         // scoped should have parent
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ProcessorReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ProcessorReifier.java
index d7627ed..0e0bd5c 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ProcessorReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ProcessorReifier.java
@@ -21,6 +21,8 @@ import java.util.Collection;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.ScheduledExecutorService;
 import java.util.function.BiFunction;
 
 import org.apache.camel.CamelContext;
@@ -38,6 +40,7 @@ import org.apache.camel.model.ConvertBodyDefinition;
 import org.apache.camel.model.DelayDefinition;
 import org.apache.camel.model.DynamicRouterDefinition;
 import org.apache.camel.model.EnrichDefinition;
+import org.apache.camel.model.ExecutorServiceAwareDefinition;
 import org.apache.camel.model.ExpressionNode;
 import org.apache.camel.model.FilterDefinition;
 import org.apache.camel.model.FinallyDefinition;
@@ -103,11 +106,13 @@ import org.apache.camel.processor.InterceptEndpointProcessor;
 import org.apache.camel.processor.Pipeline;
 import org.apache.camel.processor.channel.DefaultChannel;
 import org.apache.camel.reifier.errorhandler.ErrorHandlerReifier;
+import org.apache.camel.spi.ExecutorServiceManager;
 import org.apache.camel.spi.IdAware;
 import org.apache.camel.spi.InterceptStrategy;
 import org.apache.camel.spi.LifecycleStrategy;
 import org.apache.camel.spi.RouteContext;
 import org.apache.camel.spi.RouteIdAware;
+import org.apache.camel.util.ObjectHelper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -212,6 +217,253 @@ public abstract class ProcessorReifier<T extends ProcessorDefinition<?>> extends
     }
 
     /**
+     * Determines whether a new thread pool will be created or not.
+     * <p/>
+     * This is used to know if a new thread pool will be created, and therefore
+     * is not shared by others, and therefore exclusive to the definition.
+     *
+     * @param definition the node definition which may leverage executor
+     *            service.
+     * @param useDefault whether to fallback and use a default thread pool, if
+     *            no explicit configured
+     * @return <tt>true</tt> if a new thread pool will be created,
+     *         <tt>false</tt> if not
+     * @see #getConfiguredExecutorService(String, ExecutorServiceAwareDefinition, boolean)
+     */
+    public boolean willCreateNewThreadPool(ExecutorServiceAwareDefinition<?> definition, boolean useDefault) {
+        ExecutorServiceManager manager = camelContext.getExecutorServiceManager();
+        ObjectHelper.notNull(manager, "ExecutorServiceManager", camelContext);
+
+        if (definition.getExecutorService() != null) {
+            // no there is a custom thread pool configured
+            return false;
+        } else if (definition.getExecutorServiceRef() != null) {
+            ExecutorService answer = routeContext.lookup(definition.getExecutorServiceRef(), ExecutorService.class);
+            // if no existing thread pool, then we will have to create a new
+            // thread pool
+            return answer == null;
+        } else if (useDefault) {
+            return true;
+        }
+
+        return false;
+    }
+
+    /**
+     * Will lookup and get the configured
+     * {@link ExecutorService} from the given definition.
+     * <p/>
+     * This method will lookup for configured thread pool in the following order
+     * <ul>
+     * <li>from the definition if any explicit configured executor service.</li>
+     * <li>from the {@link org.apache.camel.spi.Registry} if found</li>
+     * <li>from the known list of {@link org.apache.camel.spi.ThreadPoolProfile
+     * ThreadPoolProfile(s)}.</li>
+     * <li>if none found, then <tt>null</tt> is returned.</li>
+     * </ul>
+     * The various {@link ExecutorServiceAwareDefinition} should use this helper
+     * method to ensure they support configured executor services in the same
+     * coherent way.
+     *
+     * @param name name which is appended to the thread name, when the
+     *            {@link ExecutorService} is created based
+     *            on a {@link org.apache.camel.spi.ThreadPoolProfile}.
+     * @param definition the node definition which may leverage executor
+     *            service.
+     * @param useDefault whether to fallback and use a default thread pool, if
+     *            no explicit configured
+     * @return the configured executor service, or <tt>null</tt> if none was
+     *         configured.
+     * @throws IllegalArgumentException is thrown if lookup of executor service
+     *             in {@link org.apache.camel.spi.Registry} was not found
+     */
+    public ExecutorService getConfiguredExecutorService(String name, ExecutorServiceAwareDefinition<?> definition, boolean useDefault)
+        throws IllegalArgumentException {
+        ExecutorServiceManager manager = camelContext.getExecutorServiceManager();
+        ObjectHelper.notNull(manager, "ExecutorServiceManager", camelContext);
+
+        // prefer to use explicit configured executor on the definition
+        if (definition.getExecutorService() != null) {
+            return definition.getExecutorService();
+        } else if (definition.getExecutorServiceRef() != null) {
+            // lookup in registry first and use existing thread pool if exists
+            ExecutorService answer = lookupExecutorServiceRef(name, definition, definition.getExecutorServiceRef());
+            if (answer == null) {
+                throw new IllegalArgumentException("ExecutorServiceRef " + definition.getExecutorServiceRef()
+                                                   + " not found in registry (as an ExecutorService instance) or as a thread pool profile.");
+            }
+            return answer;
+        } else if (useDefault) {
+            return manager.newDefaultThreadPool(definition, name);
+        }
+
+        return null;
+    }
+
+    /**
+     * Will lookup and get the configured
+     * {@link java.util.concurrent.ScheduledExecutorService} from the given
+     * definition.
+     * <p/>
+     * This method will lookup for configured thread pool in the following order
+     * <ul>
+     * <li>from the definition if any explicit configured executor service.</li>
+     * <li>from the {@link org.apache.camel.spi.Registry} if found</li>
+     * <li>from the known list of {@link org.apache.camel.spi.ThreadPoolProfile
+     * ThreadPoolProfile(s)}.</li>
+     * <li>if none found, then <tt>null</tt> is returned.</li>
+     * </ul>
+     * The various {@link ExecutorServiceAwareDefinition} should use this helper
+     * method to ensure they support configured executor services in the same
+     * coherent way.
+     *
+     * @param name name which is appended to the thread name, when the
+     *            {@link ExecutorService} is created based
+     *            on a {@link org.apache.camel.spi.ThreadPoolProfile}.
+     * @param definition the node definition which may leverage executor
+     *            service.
+     * @param useDefault whether to fallback and use a default thread pool, if
+     *            no explicit configured
+     * @return the configured executor service, or <tt>null</tt> if none was
+     *         configured.
+     * @throws IllegalArgumentException is thrown if the found instance is not a
+     *             ScheduledExecutorService type, or lookup of executor service
+     *             in {@link org.apache.camel.spi.Registry} was not found
+     */
+    public ScheduledExecutorService getConfiguredScheduledExecutorService(String name, ExecutorServiceAwareDefinition<?> definition,
+                                                                                 boolean useDefault)
+        throws IllegalArgumentException {
+        ExecutorServiceManager manager = camelContext.getExecutorServiceManager();
+        ObjectHelper.notNull(manager, "ExecutorServiceManager", camelContext);
+
+        // prefer to use explicit configured executor on the definition
+        if (definition.getExecutorService() != null) {
+            ExecutorService executorService = definition.getExecutorService();
+            if (executorService instanceof ScheduledExecutorService) {
+                return (ScheduledExecutorService)executorService;
+            }
+            throw new IllegalArgumentException("ExecutorServiceRef " + definition.getExecutorServiceRef() + " is not an ScheduledExecutorService instance");
+        } else if (definition.getExecutorServiceRef() != null) {
+            ScheduledExecutorService answer = lookupScheduledExecutorServiceRef(name, definition, definition.getExecutorServiceRef());
+            if (answer == null) {
+                throw new IllegalArgumentException("ExecutorServiceRef " + definition.getExecutorServiceRef()
+                                                   + " not found in registry (as an ScheduledExecutorService instance) or as a thread pool profile.");
+            }
+            return answer;
+        } else if (useDefault) {
+            return manager.newDefaultScheduledThreadPool(definition, name);
+        }
+
+        return null;
+    }
+
+    /**
+     * Will lookup in {@link org.apache.camel.spi.Registry} for a
+     * {@link ScheduledExecutorService} registered with the given
+     * <tt>executorServiceRef</tt> name.
+     * <p/>
+     * This method will lookup for configured thread pool in the following order
+     * <ul>
+     * <li>from the {@link org.apache.camel.spi.Registry} if found</li>
+     * <li>from the known list of {@link org.apache.camel.spi.ThreadPoolProfile
+     * ThreadPoolProfile(s)}.</li>
+     * <li>if none found, then <tt>null</tt> is returned.</li>
+     * </ul>
+     *
+     * @param routeContext the route context
+     * @param name name which is appended to the thread name, when the
+     *            {@link ExecutorService} is created based
+     *            on a {@link org.apache.camel.spi.ThreadPoolProfile}.
+     * @param source the source to use the thread pool
+     * @param executorServiceRef reference name of the thread pool
+     * @return the executor service, or <tt>null</tt> if none was found.
+     */
+    public ScheduledExecutorService lookupScheduledExecutorServiceRef(String name, Object source, String executorServiceRef) {
+
+        ExecutorServiceManager manager = routeContext.getCamelContext().getExecutorServiceManager();
+        ObjectHelper.notNull(manager, "ExecutorServiceManager", routeContext.getCamelContext());
+        ObjectHelper.notNull(executorServiceRef, "executorServiceRef");
+
+        // lookup in registry first and use existing thread pool if exists
+        ScheduledExecutorService answer = routeContext.lookup(executorServiceRef, ScheduledExecutorService.class);
+        if (answer == null) {
+            // then create a thread pool assuming the ref is a thread pool
+            // profile id
+            answer = manager.newScheduledThreadPool(source, name, executorServiceRef);
+        }
+        return answer;
+    }
+
+    /**
+     * Will lookup in {@link org.apache.camel.spi.Registry} for a
+     * {@link ExecutorService} registered with the given
+     * <tt>executorServiceRef</tt> name.
+     * <p/>
+     * This method will lookup for configured thread pool in the following order
+     * <ul>
+     * <li>from the {@link org.apache.camel.spi.Registry} if found</li>
+     * <li>from the known list of {@link org.apache.camel.spi.ThreadPoolProfile
+     * ThreadPoolProfile(s)}.</li>
+     * <li>if none found, then <tt>null</tt> is returned.</li>
+     * </ul>
+     *
+     * @param name name which is appended to the thread name, when the
+     *            {@link ExecutorService} is created based
+     *            on a {@link org.apache.camel.spi.ThreadPoolProfile}.
+     * @param source the source to use the thread pool
+     * @param executorServiceRef reference name of the thread pool
+     * @return the executor service, or <tt>null</tt> if none was found.
+     */
+    public ExecutorService lookupExecutorServiceRef(String name, Object source, String executorServiceRef) {
+
+        ExecutorServiceManager manager = camelContext.getExecutorServiceManager();
+        ObjectHelper.notNull(manager, "ExecutorServiceManager", camelContext);
+        ObjectHelper.notNull(executorServiceRef, "executorServiceRef");
+
+        // lookup in registry first and use existing thread pool if exists
+        ExecutorService answer = routeContext.lookup(executorServiceRef, ExecutorService.class);
+        if (answer == null) {
+            // then create a thread pool assuming the ref is a thread pool
+            // profile id
+            answer = manager.newThreadPool(source, name, executorServiceRef);
+        }
+        return answer;
+    }
+
+    /**
+     * Is there any outputs in the given list.
+     * <p/>
+     * Is used for check if the route output has any real outputs (non
+     * abstracts)
+     *
+     * @param outputs the outputs
+     * @param excludeAbstract whether or not to exclude abstract outputs (e.g.
+     *            skip onException etc.)
+     * @return <tt>true</tt> if has outputs, otherwise <tt>false</tt> is
+     *         returned
+     */
+    @SuppressWarnings({"unchecked", "rawtypes"})
+    public boolean hasOutputs(List<ProcessorDefinition<?>> outputs, boolean excludeAbstract) {
+        if (outputs == null || outputs.isEmpty()) {
+            return false;
+        }
+        if (!excludeAbstract) {
+            return true;
+        }
+        for (ProcessorDefinition output : outputs) {
+            if (output.isWrappingEntireOutput()) {
+                // special for those as they wrap entire output, so we should
+                // just check its output
+                return hasOutputs(output.getOutputs(), excludeAbstract);
+            }
+            if (!output.isAbstract()) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    /**
      * Override this in definition class and implement logic to create the
      * processor based on the definition model.
      */
@@ -253,7 +505,7 @@ public abstract class ProcessorReifier<T extends ProcessorDefinition<?>> extends
         return children;
     }
 
-    public void addRoutes(RouteContext routeContext) throws Exception {
+    public void addRoutes() throws Exception {
         Channel processor = makeProcessor();
         if (processor == null) {
             // no processor to add
@@ -280,19 +532,19 @@ public abstract class ProcessorReifier<T extends ProcessorDefinition<?>> extends
      * Wraps the child processor in whatever necessary interceptors and error
      * handlers
      */
-    public Channel wrapProcessor(RouteContext routeContext, Processor processor) throws Exception {
+    public Channel wrapProcessor(Processor processor) throws Exception {
         // don't double wrap
         if (processor instanceof Channel) {
             return (Channel)processor;
         }
-        return wrapChannel(routeContext, processor, null);
+        return wrapChannel(processor, null);
     }
 
-    protected Channel wrapChannel(RouteContext routeContext, Processor processor, ProcessorDefinition<?> child) throws Exception {
-        return wrapChannel(routeContext, processor, child, definition.isInheritErrorHandler());
+    protected Channel wrapChannel(Processor processor, ProcessorDefinition<?> child) throws Exception {
+        return wrapChannel(processor, child, definition.isInheritErrorHandler());
     }
 
-    protected Channel wrapChannel(RouteContext routeContext, Processor processor, ProcessorDefinition<?> child, Boolean inheritErrorHandler) throws Exception {
+    protected Channel wrapChannel(Processor processor, ProcessorDefinition<?> child, Boolean inheritErrorHandler) throws Exception {
         // put a channel in between this and each output to control the route
         // flow logic
         DefaultChannel channel = new DefaultChannel(camelContext);
@@ -300,9 +552,9 @@ public abstract class ProcessorReifier<T extends ProcessorDefinition<?>> extends
         // add interceptor strategies to the channel must be in this order:
         // camel context, route context, local
         List<InterceptStrategy> interceptors = new ArrayList<>();
-        addInterceptStrategies(routeContext, interceptors, camelContext.adapt(ExtendedCamelContext.class).getInterceptStrategies());
-        addInterceptStrategies(routeContext, interceptors, routeContext.getInterceptStrategies());
-        addInterceptStrategies(routeContext, interceptors, definition.getInterceptStrategies());
+        addInterceptStrategies(interceptors, camelContext.adapt(ExtendedCamelContext.class).getInterceptStrategies());
+        addInterceptStrategies(interceptors, routeContext.getInterceptStrategies());
+        addInterceptStrategies(interceptors, definition.getInterceptStrategies());
 
         // force the creation of an id
         RouteDefinitionHelper.forceAssignIds(camelContext, definition);
@@ -385,7 +637,7 @@ public abstract class ProcessorReifier<T extends ProcessorDefinition<?>> extends
             wrap = true;
         }
         if (wrap) {
-            wrapChannelInErrorHandler(channel, routeContext, inheritErrorHandler);
+            wrapChannelInErrorHandler(channel, inheritErrorHandler);
         }
 
         // do post init at the end
@@ -399,15 +651,14 @@ public abstract class ProcessorReifier<T extends ProcessorDefinition<?>> extends
      * Wraps the given channel in error handler (if error handler is inherited)
      *
      * @param channel the channel
-     * @param routeContext the route context
      * @param inheritErrorHandler whether to inherit error handler
      * @throws Exception can be thrown if failed to create error handler builder
      */
-    private void wrapChannelInErrorHandler(DefaultChannel channel, RouteContext routeContext, Boolean inheritErrorHandler) throws Exception {
+    private void wrapChannelInErrorHandler(DefaultChannel channel, Boolean inheritErrorHandler) throws Exception {
         if (inheritErrorHandler == null || inheritErrorHandler) {
             log.trace("{} is configured to inheritErrorHandler", definition);
             Processor output = channel.getOutput();
-            Processor errorHandler = wrapInErrorHandler(routeContext, output);
+            Processor errorHandler = wrapInErrorHandler(output);
             // set error handler on channel
             channel.setErrorHandler(errorHandler);
         } else {
@@ -418,12 +669,11 @@ public abstract class ProcessorReifier<T extends ProcessorDefinition<?>> extends
     /**
      * Wraps the given output in an error handler
      *
-     * @param routeContext the route context
      * @param output the output
      * @return the output wrapped with the error handler
      * @throws Exception can be thrown if failed to create error handler builder
      */
-    protected Processor wrapInErrorHandler(RouteContext routeContext, Processor output) throws Exception {
+    protected Processor wrapInErrorHandler(Processor output) throws Exception {
         ErrorHandlerFactory builder = routeContext.getErrorHandlerFactory();
         // create error handler
         Processor errorHandler = ErrorHandlerReifier.reifier(routeContext, builder).createErrorHandler(output);
@@ -439,11 +689,10 @@ public abstract class ProcessorReifier<T extends ProcessorDefinition<?>> extends
     /**
      * Adds the given list of interceptors to the channel.
      *
-     * @param routeContext the route context
      * @param interceptors the list to add strategies
      * @param strategies list of strategies to add.
      */
-    protected void addInterceptStrategies(RouteContext routeContext, List<InterceptStrategy> interceptors, List<InterceptStrategy> strategies) {
+    protected void addInterceptStrategies(List<InterceptStrategy> interceptors, List<InterceptStrategy> strategies) {
         interceptors.addAll(strategies);
     }
 
@@ -503,7 +752,7 @@ public abstract class ProcessorReifier<T extends ProcessorDefinition<?>> extends
                 continue;
             }
 
-            Processor channel = wrapChannel(routeContext, processor, output);
+            Processor channel = wrapChannel(processor, output);
             list.add(channel);
         }
 
@@ -594,7 +843,7 @@ public abstract class ProcessorReifier<T extends ProcessorDefinition<?>> extends
             // no processor to make
             return null;
         }
-        return wrapProcessor(routeContext, processor);
+        return wrapProcessor(processor);
     }
 
     /**
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/RecipientListReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/RecipientListReifier.java
index 950815b..68cc91c 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/RecipientListReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/RecipientListReifier.java
@@ -25,7 +25,6 @@ import org.apache.camel.CamelContextAware;
 import org.apache.camel.Expression;
 import org.apache.camel.Processor;
 import org.apache.camel.model.ProcessorDefinition;
-import org.apache.camel.model.ProcessorDefinitionHelper;
 import org.apache.camel.model.RecipientListDefinition;
 import org.apache.camel.processor.EvaluateExpressionProcessor;
 import org.apache.camel.processor.Pipeline;
@@ -81,8 +80,8 @@ public class RecipientListReifier extends ProcessorReifier<RecipientListDefiniti
             answer.setTimeout(parseLong(definition.getTimeout()));
         }
 
-        boolean shutdownThreadPool = ProcessorDefinitionHelper.willCreateNewThreadPool(routeContext, definition, isParallelProcessing);
-        ExecutorService threadPool = ProcessorDefinitionHelper.getConfiguredExecutorService(routeContext, "RecipientList", definition, isParallelProcessing);
+        boolean shutdownThreadPool = willCreateNewThreadPool(definition, isParallelProcessing);
+        ExecutorService threadPool = getConfiguredExecutorService("RecipientList", definition, isParallelProcessing);
         answer.setExecutorService(threadPool);
         answer.setShutdownExecutorService(shutdownThreadPool);
         long timeout = definition.getTimeout() != null ? parseLong(definition.getTimeout()) : 0;
@@ -102,7 +101,7 @@ public class RecipientListReifier extends ProcessorReifier<RecipientListDefiniti
         // special error handling
         // when sending to the recipients individually
         Processor evalProcessor = new EvaluateExpressionProcessor(expression);
-        evalProcessor = super.wrapInErrorHandler(routeContext, evalProcessor);
+        evalProcessor = super.wrapInErrorHandler(evalProcessor);
 
         pipe.add(evalProcessor);
         pipe.add(answer);
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/RouteReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/RouteReifier.java
index 04b972b..cd20c51 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/RouteReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/RouteReifier.java
@@ -34,7 +34,6 @@ import org.apache.camel.builder.EndpointConsumerBuilder;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.model.Model;
 import org.apache.camel.model.ProcessorDefinition;
-import org.apache.camel.model.ProcessorDefinitionHelper;
 import org.apache.camel.model.PropertyDefinition;
 import org.apache.camel.model.RouteDefinition;
 import org.apache.camel.model.RoutesDefinition;
@@ -374,7 +373,7 @@ public class RouteReifier extends ProcessorReifier<RouteDefinition> {
         }
 
         // validate route has output processors
-        if (!ProcessorDefinitionHelper.hasOutputs(definition.getOutputs(), true)) {
+        if (!hasOutputs(definition.getOutputs(), true)) {
             String at = definition.getInput().toString();
             Exception cause = new IllegalArgumentException("Route " + definition.getId() + " has no output processors."
                                                            + " You need to add outputs to the route such as to(\"log:foo\").");
@@ -384,7 +383,7 @@ public class RouteReifier extends ProcessorReifier<RouteDefinition> {
         List<ProcessorDefinition<?>> list = new ArrayList<>(definition.getOutputs());
         for (ProcessorDefinition<?> output : list) {
             try {
-                ProcessorReifier.reifier(routeContext, output).addRoutes(routeContext);
+                ProcessorReifier.reifier(routeContext, output).addRoutes();
             } catch (Exception e) {
                 throw new FailedToCreateRouteException(definition.getId(), definition.toString(), output.toString(), e);
             }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/SplitReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/SplitReifier.java
index 8d1bda4..d678766 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/SplitReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/SplitReifier.java
@@ -23,7 +23,6 @@ import org.apache.camel.CamelContextAware;
 import org.apache.camel.Expression;
 import org.apache.camel.Processor;
 import org.apache.camel.model.ProcessorDefinition;
-import org.apache.camel.model.ProcessorDefinitionHelper;
 import org.apache.camel.model.SplitDefinition;
 import org.apache.camel.processor.Splitter;
 import org.apache.camel.processor.aggregate.AggregationStrategyBeanAdapter;
@@ -47,8 +46,8 @@ public class SplitReifier extends ExpressionReifier<SplitDefinition> {
         boolean isShareUnitOfWork = definition.getShareUnitOfWork() != null && definition.getShareUnitOfWork();
         boolean isParallelAggregate = definition.getParallelAggregate() != null && definition.getParallelAggregate();
         boolean isStopOnAggregateException = definition.getStopOnAggregateException() != null && definition.getStopOnAggregateException();
-        boolean shutdownThreadPool = ProcessorDefinitionHelper.willCreateNewThreadPool(routeContext, definition, isParallelProcessing);
-        ExecutorService threadPool = ProcessorDefinitionHelper.getConfiguredExecutorService(routeContext, "Split", definition, isParallelProcessing);
+        boolean shutdownThreadPool = willCreateNewThreadPool(definition, isParallelProcessing);
+        ExecutorService threadPool = getConfiguredExecutorService("Split", definition, isParallelProcessing);
 
         long timeout = definition.getTimeout() != null ? definition.getTimeout() : 0;
         if (timeout > 0 && !isParallelProcessing) {
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ThreadsReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ThreadsReifier.java
index f66a43f..8137a12 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ThreadsReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ThreadsReifier.java
@@ -22,7 +22,6 @@ import java.util.concurrent.TimeUnit;
 import org.apache.camel.Processor;
 import org.apache.camel.builder.ThreadPoolProfileBuilder;
 import org.apache.camel.model.ProcessorDefinition;
-import org.apache.camel.model.ProcessorDefinitionHelper;
 import org.apache.camel.model.ThreadsDefinition;
 import org.apache.camel.processor.ThreadsProcessor;
 import org.apache.camel.spi.ExecutorServiceManager;
@@ -41,8 +40,8 @@ public class ThreadsReifier extends ProcessorReifier<ThreadsDefinition> {
         // the threads name
         String name = definition.getThreadName() != null ? definition.getThreadName() : "Threads";
         // prefer any explicit configured executor service
-        boolean shutdownThreadPool = ProcessorDefinitionHelper.willCreateNewThreadPool(routeContext, definition, true);
-        ExecutorService threadPool = ProcessorDefinitionHelper.getConfiguredExecutorService(routeContext, name, definition, false);
+        boolean shutdownThreadPool = willCreateNewThreadPool(definition, true);
+        ExecutorService threadPool = getConfiguredExecutorService(name, definition, false);
 
         // resolve what rejected policy to use
         ThreadPoolRejectedPolicy policy = resolveRejectedPolicy(routeContext);
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ThrottleReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ThrottleReifier.java
index fb7f853..f4c3dc6 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ThrottleReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ThrottleReifier.java
@@ -21,7 +21,6 @@ import java.util.concurrent.ScheduledExecutorService;
 import org.apache.camel.Expression;
 import org.apache.camel.Processor;
 import org.apache.camel.model.ProcessorDefinition;
-import org.apache.camel.model.ProcessorDefinitionHelper;
 import org.apache.camel.model.ThrottleDefinition;
 import org.apache.camel.model.language.ExpressionDefinition;
 import org.apache.camel.processor.Throttler;
@@ -36,8 +35,8 @@ public class ThrottleReifier extends ExpressionReifier<ThrottleDefinition> {
     @Override
     public Processor createProcessor() throws Exception {
         boolean async = definition.getAsyncDelayed() != null && definition.getAsyncDelayed();
-        boolean shutdownThreadPool = ProcessorDefinitionHelper.willCreateNewThreadPool(routeContext, definition, true);
-        ScheduledExecutorService threadPool = ProcessorDefinitionHelper.getConfiguredScheduledExecutorService(routeContext, "Throttle", definition, true);
+        boolean shutdownThreadPool = willCreateNewThreadPool(definition, true);
+        ScheduledExecutorService threadPool = getConfiguredScheduledExecutorService("Throttle", definition, true);
 
         // should be default 1000 millis
         long period = definition.getTimePeriodMillis() != null ? definition.getTimePeriodMillis() : 1000L;
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/WireTapReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/WireTapReifier.java
index 267eeed..b720c1a 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/WireTapReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/WireTapReifier.java
@@ -23,7 +23,6 @@ import org.apache.camel.Expression;
 import org.apache.camel.Processor;
 import org.apache.camel.builder.ExpressionBuilder;
 import org.apache.camel.model.ProcessorDefinition;
-import org.apache.camel.model.ProcessorDefinitionHelper;
 import org.apache.camel.model.SetHeaderDefinition;
 import org.apache.camel.model.WireTapDefinition;
 import org.apache.camel.processor.CamelInternalProcessor;
@@ -41,8 +40,8 @@ public class WireTapReifier extends ToDynamicReifier<WireTapDefinition<?>> {
     @Override
     public Processor createProcessor() throws Exception {
         // executor service is mandatory for wire tap
-        boolean shutdownThreadPool = ProcessorDefinitionHelper.willCreateNewThreadPool(routeContext, definition, true);
-        ExecutorService threadPool = ProcessorDefinitionHelper.getConfiguredExecutorService(routeContext, "WireTap", definition, true);
+        boolean shutdownThreadPool = willCreateNewThreadPool(definition, true);
+        ExecutorService threadPool = getConfiguredExecutorService("WireTap", definition, true);
 
         // must use InOnly for WireTap
         definition.setPattern(ExchangePattern.InOnly.name());
@@ -51,7 +50,7 @@ public class WireTapReifier extends ToDynamicReifier<WireTapDefinition<?>> {
         SendDynamicProcessor dynamicTo = (SendDynamicProcessor)super.createProcessor();
 
         // create error handler we need to use for processing the wire tapped
-        Processor target = wrapInErrorHandler(routeContext, dynamicTo);
+        Processor target = wrapInErrorHandler(dynamicTo);
 
         // and wrap in unit of work
         CamelInternalProcessor internal = new CamelInternalProcessor(camelContext, target);
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/rest/RestBindingReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/rest/RestBindingReifier.java
index 46671c2..bb1c68d 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/rest/RestBindingReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/rest/RestBindingReifier.java
@@ -160,7 +160,7 @@ public class RestBindingReifier extends AbstractReifier {
         }
         if (clazz != null) {
             JAXBContext jc = JAXBContext.newInstance(clazz);
-            camelContext.adapt(ExtendedCamelContext.class).getBeanIntrospection().setProperty(camelContext, jaxb, "context", jc);
+            setJaxbContext(jaxb, jc);
         }
         setAdditionalConfiguration(config, jaxb, "xml.in.");
 
@@ -171,15 +171,19 @@ public class RestBindingReifier extends AbstractReifier {
         }
         if (outClazz != null) {
             JAXBContext jc = JAXBContext.newInstance(outClazz);
-            camelContext.adapt(ExtendedCamelContext.class).getBeanIntrospection().setProperty(camelContext, outJaxb, "context", jc);
+            setJaxbContext(outJaxb, jc);
         } else if (clazz != null) {
             // fallback and use the context from the input
             JAXBContext jc = JAXBContext.newInstance(clazz);
-            camelContext.adapt(ExtendedCamelContext.class).getBeanIntrospection().setProperty(camelContext, outJaxb, "context", jc);
+            setJaxbContext(outJaxb, jc);
         }
         setAdditionalConfiguration(config, outJaxb, "xml.out.");
     }
 
+    private void setJaxbContext(DataFormat jaxb, JAXBContext jc) throws Exception {
+        camelContext.adapt(ExtendedCamelContext.class).getBeanIntrospection().setProperty(camelContext, jaxb, "context", jc);
+    }
+
     private void setAdditionalConfiguration(RestConfiguration config, DataFormat dataFormat, String prefix) throws Exception {
         if (config.getDataFormatProperties() != null && !config.getDataFormatProperties().isEmpty()) {
             // must use a copy as otherwise the options gets removed during

Reply | Threaded
Open this post in threaded view
|

[camel] 04/18: Make RouteContext / CamelContext a constructor argument of the reifiers

Guillaume Nodet-2
In reply to this post by Guillaume Nodet-2
This is an automated email from the ASF dual-hosted git repository.

gnodet pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit cf948dbabacf5095acd68569dbbeb18aab8f5b48
Author: Guillaume Nodet <[hidden email]>
AuthorDate: Mon Feb 10 17:16:07 2020 +0100

    Make RouteContext / CamelContext a constructor argument of the reifiers
---
 .../org/apache/camel/builder/RouteBuilder.java     |  2 +-
 .../org/apache/camel/reifier/DelayReifier.java     |  4 ++--
 .../apache/camel/reifier/ExpressionReifier.java    |  8 +++----
 .../org/apache/camel/reifier/FilterReifier.java    |  6 ++---
 .../org/apache/camel/reifier/ProcessorReifier.java |  3 ---
 .../org/apache/camel/reifier/ThrottleReifier.java  |  2 +-
 .../java/org/apache/camel/reifier/WhenReifier.java |  2 +-
 .../reifier/WhenSkipSendToEndpointReifier.java     |  6 ++---
 .../reifier/validator/CustomValidatorReifier.java  | 14 ++++++------
 .../validator/EndpointValidatorReifier.java        | 10 ++++-----
 .../validator/PredicateValidatorReifier.java       | 10 ++++-----
 .../camel/reifier/validator/ValidatorReifier.java  | 26 ++++++++++++----------
 .../core/xml/AbstractCamelContextFactoryBean.java  |  2 +-
 13 files changed, 46 insertions(+), 49 deletions(-)

diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/builder/RouteBuilder.java b/core/camel-core-engine/src/main/java/org/apache/camel/builder/RouteBuilder.java
index 4fc6bef..61f2a6a 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/builder/RouteBuilder.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/builder/RouteBuilder.java
@@ -600,7 +600,7 @@ public abstract class RouteBuilder extends BuilderSupport implements RoutesBuild
 
         // create and register validators on validator registry
         for (ValidatorDefinition def : camelContext.getExtension(Model.class).getValidators()) {
-            Validator validator = ValidatorReifier.reifier(def).createValidator(camelContext);
+            Validator validator = ValidatorReifier.reifier(camelContext, def).createValidator();
             camelContext.getValidatorRegistry().put(createValidatorKey(def), validator);
         }
     }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/DelayReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/DelayReifier.java
index 69bcd4f..8109f5b 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/DelayReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/DelayReifier.java
@@ -35,7 +35,7 @@ public class DelayReifier extends ExpressionReifier<DelayDefinition> {
     @Override
     public Processor createProcessor() throws Exception {
         Processor childProcessor = this.createChildProcessor(false);
-        Expression delay = createAbsoluteTimeDelayExpression(routeContext);
+        Expression delay = createAbsoluteTimeDelayExpression();
 
         boolean async = definition.getAsyncDelayed() == null || Boolean.parseBoolean(definition.getAsyncDelayed());
         boolean shutdownThreadPool = willCreateNewThreadPool(definition, async);
@@ -48,7 +48,7 @@ public class DelayReifier extends ExpressionReifier<DelayDefinition> {
         return answer;
     }
 
-    private Expression createAbsoluteTimeDelayExpression(RouteContext routeContext) {
+    private Expression createAbsoluteTimeDelayExpression() {
         ExpressionDefinition expr = definition.getExpression();
         if (expr != null) {
             return expr.createExpression(routeContext);
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ExpressionReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ExpressionReifier.java
index c70744e..30772b6 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ExpressionReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ExpressionReifier.java
@@ -31,22 +31,20 @@ abstract class ExpressionReifier<T extends ExpressionNode> extends ProcessorReif
     /**
      * Creates the {@link FilterProcessor} from the expression node.
      *
-     * @param routeContext the route context
      * @return the created {@link FilterProcessor}
      * @throws Exception is thrown if error creating the processor
      */
-    protected FilterProcessor createFilterProcessor(RouteContext routeContext) throws Exception {
+    protected FilterProcessor createFilterProcessor() throws Exception {
         Processor childProcessor = createOutputsProcessor();
-        return new FilterProcessor(createPredicate(routeContext), childProcessor);
+        return new FilterProcessor(createPredicate(), childProcessor);
     }
 
     /**
      * Creates the {@link Predicate} from the expression node.
      *
-     * @param routeContext the route context
      * @return the created predicate
      */
-    protected Predicate createPredicate(RouteContext routeContext) {
+    protected Predicate createPredicate() {
         return definition.getExpression().createPredicate(routeContext);
     }
 
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/FilterReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/FilterReifier.java
index f18fe37..a440805 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/FilterReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/FilterReifier.java
@@ -30,14 +30,14 @@ public class FilterReifier extends ExpressionReifier<FilterDefinition> {
 
     @Override
     public FilterProcessor createProcessor() throws Exception {
-        return createFilterProcessor(routeContext);
+        return createFilterProcessor();
     }
 
     @Override
-    protected FilterProcessor createFilterProcessor(RouteContext routeContext) throws Exception {
+    protected FilterProcessor createFilterProcessor() throws Exception {
         // filter EIP should have child outputs
         Processor childProcessor = this.createChildProcessor(true);
-        return new FilterProcessor(createPredicate(routeContext), childProcessor);
+        return new FilterProcessor(createPredicate(), childProcessor);
     }
 
 }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ProcessorReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ProcessorReifier.java
index 0e0bd5c..cb43e6f 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ProcessorReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ProcessorReifier.java
@@ -41,7 +41,6 @@ import org.apache.camel.model.DelayDefinition;
 import org.apache.camel.model.DynamicRouterDefinition;
 import org.apache.camel.model.EnrichDefinition;
 import org.apache.camel.model.ExecutorServiceAwareDefinition;
-import org.apache.camel.model.ExpressionNode;
 import org.apache.camel.model.FilterDefinition;
 import org.apache.camel.model.FinallyDefinition;
 import org.apache.camel.model.IdempotentConsumerDefinition;
@@ -101,7 +100,6 @@ import org.apache.camel.model.WhenDefinition;
 import org.apache.camel.model.WhenSkipSendToEndpointDefinition;
 import org.apache.camel.model.WireTapDefinition;
 import org.apache.camel.model.cloud.ServiceCallDefinition;
-import org.apache.camel.model.language.ExpressionDefinition;
 import org.apache.camel.processor.InterceptEndpointProcessor;
 import org.apache.camel.processor.Pipeline;
 import org.apache.camel.processor.channel.DefaultChannel;
@@ -370,7 +368,6 @@ public abstract class ProcessorReifier<T extends ProcessorDefinition<?>> extends
      * <li>if none found, then <tt>null</tt> is returned.</li>
      * </ul>
      *
-     * @param routeContext the route context
      * @param name name which is appended to the thread name, when the
      *            {@link ExecutorService} is created based
      *            on a {@link org.apache.camel.spi.ThreadPoolProfile}.
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ThrottleReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ThrottleReifier.java
index f4c3dc6..7c69045 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ThrottleReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ThrottleReifier.java
@@ -66,7 +66,7 @@ public class ThrottleReifier extends ExpressionReifier<ThrottleDefinition> {
         return answer;
     }
 
-    private Expression createMaxRequestsPerPeriodExpression(RouteContext routeContext) {
+    private Expression createMaxRequestsPerPeriodExpression() {
         ExpressionDefinition expr = definition.getExpression();
         if (expr != null) {
             return expr.createExpression(routeContext);
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/WhenReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/WhenReifier.java
index ce5dc57..53009eb 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/WhenReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/WhenReifier.java
@@ -29,6 +29,6 @@ public class WhenReifier extends ExpressionReifier<WhenDefinition> {
 
     @Override
     public FilterProcessor createProcessor() throws Exception {
-        return createFilterProcessor(routeContext);
+        return createFilterProcessor();
     }
 }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/WhenSkipSendToEndpointReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/WhenSkipSendToEndpointReifier.java
index 334fa91..d1facb2 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/WhenSkipSendToEndpointReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/WhenSkipSendToEndpointReifier.java
@@ -31,15 +31,15 @@ public class WhenSkipSendToEndpointReifier extends ExpressionReifier<WhenSkipSen
 
     @Override
     public FilterProcessor createProcessor() throws Exception {
-        return createFilterProcessor(routeContext);
+        return createFilterProcessor();
     }
 
     @Override
-    protected Predicate createPredicate(RouteContext routeContext) {
+    protected Predicate createPredicate() {
         // we need to keep track whether the when matches or not, so delegate
         // the predicate and add the matches result as a property on the
         // exchange
-        final Predicate delegate = super.createPredicate(routeContext);
+        final Predicate delegate = super.createPredicate();
         return new Predicate() {
             @Override
             public boolean matches(Exchange exchange) {
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/validator/CustomValidatorReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/validator/CustomValidatorReifier.java
index 42e612b..bca3380 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/validator/CustomValidatorReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/validator/CustomValidatorReifier.java
@@ -23,18 +23,18 @@ import org.apache.camel.spi.Validator;
 
 public class CustomValidatorReifier extends ValidatorReifier<CustomValidatorDefinition> {
 
-    public CustomValidatorReifier(ValidatorDefinition definition) {
-        super((CustomValidatorDefinition)definition);
+    public CustomValidatorReifier(CamelContext camelContext, ValidatorDefinition definition) {
+        super(camelContext, (CustomValidatorDefinition)definition);
     }
 
     @Override
-    protected Validator doCreateValidator(CamelContext context) {
+    protected Validator doCreateValidator() {
         if (definition.getRef() == null && definition.getClassName() == null) {
             throw new IllegalArgumentException("'ref' or 'type' must be specified for customValidator");
         }
         Validator validator;
         if (definition.getRef() != null) {
-            validator = context.getRegistry().lookupByNameAndType(definition.getRef(), Validator.class);
+            validator = camelContext.getRegistry().lookupByNameAndType(definition.getRef(), Validator.class);
             if (validator == null) {
                 throw new IllegalArgumentException("Cannot find validator with ref:" + definition.getRef());
             }
@@ -42,13 +42,13 @@ public class CustomValidatorReifier extends ValidatorReifier<CustomValidatorDefi
                 throw new IllegalArgumentException(String.format("Validator '%s' is already in use. Please check if duplicate validator exists.", definition.getRef()));
             }
         } else {
-            Class<Validator> validatorClass = context.getClassResolver().resolveClass(definition.getClassName(), Validator.class);
+            Class<Validator> validatorClass = camelContext.getClassResolver().resolveClass(definition.getClassName(), Validator.class);
             if (validatorClass == null) {
                 throw new IllegalArgumentException("Cannot find validator class: " + definition.getClassName());
             }
-            validator = context.getInjector().newInstance(validatorClass, false);
+            validator = camelContext.getInjector().newInstance(validatorClass, false);
         }
-        validator.setCamelContext(context);
+        validator.setCamelContext(camelContext);
         return validator.setType(definition.getType());
     }
 
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/validator/EndpointValidatorReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/validator/EndpointValidatorReifier.java
index b8364df..7652bce 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/validator/EndpointValidatorReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/validator/EndpointValidatorReifier.java
@@ -27,15 +27,15 @@ import org.apache.camel.spi.Validator;
 
 public class EndpointValidatorReifier extends ValidatorReifier<EndpointValidatorDefinition> {
 
-    public EndpointValidatorReifier(ValidatorDefinition definition) {
-        super((EndpointValidatorDefinition)definition);
+    public EndpointValidatorReifier(CamelContext camelContext, ValidatorDefinition definition) {
+        super(camelContext, (EndpointValidatorDefinition)definition);
     }
 
     @Override
-    protected Validator doCreateValidator(CamelContext context) {
-        Endpoint endpoint = definition.getUri() != null ? context.getEndpoint(definition.getUri()) : context.getRegistry().lookupByNameAndType(definition.getRef(), Endpoint.class);
+    protected Validator doCreateValidator() {
+        Endpoint endpoint = definition.getUri() != null ? camelContext.getEndpoint(definition.getUri()) : camelContext.getRegistry().lookupByNameAndType(definition.getRef(), Endpoint.class);
         SendProcessor processor = new SendProcessor(endpoint, ExchangePattern.InOut);
-        return new ProcessorValidator(context).setProcessor(processor).setType(definition.getType());
+        return new ProcessorValidator(camelContext).setProcessor(processor).setType(definition.getType());
     }
 
 }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/validator/PredicateValidatorReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/validator/PredicateValidatorReifier.java
index 494af80..2c1b7f1 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/validator/PredicateValidatorReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/validator/PredicateValidatorReifier.java
@@ -26,15 +26,15 @@ import org.apache.camel.support.processor.PredicateValidatingProcessor;
 
 public class PredicateValidatorReifier extends ValidatorReifier<PredicateValidatorDefinition> {
 
-    public PredicateValidatorReifier(ValidatorDefinition definition) {
-        super((PredicateValidatorDefinition)definition);
+    public PredicateValidatorReifier(CamelContext camelContext, ValidatorDefinition definition) {
+        super(camelContext, (PredicateValidatorDefinition)definition);
     }
 
     @Override
-    protected Validator doCreateValidator(CamelContext context) {
-        Predicate pred = definition.getExpression().createPredicate(context);
+    protected Validator doCreateValidator() {
+        Predicate pred = createPredicate(definition.getExpression());
         PredicateValidatingProcessor processor = new PredicateValidatingProcessor(pred);
-        return new ProcessorValidator(context).setProcessor(processor).setType(definition.getType());
+        return new ProcessorValidator(camelContext).setProcessor(processor).setType(definition.getType());
     }
 
 }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/validator/ValidatorReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/validator/ValidatorReifier.java
index cc90525..8789f3b 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/validator/ValidatorReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/validator/ValidatorReifier.java
@@ -18,20 +18,21 @@ package org.apache.camel.reifier.validator;
 
 import java.util.HashMap;
 import java.util.Map;
-import java.util.function.Function;
+import java.util.function.BiFunction;
 
 import org.apache.camel.CamelContext;
 import org.apache.camel.model.validator.CustomValidatorDefinition;
 import org.apache.camel.model.validator.EndpointValidatorDefinition;
 import org.apache.camel.model.validator.PredicateValidatorDefinition;
 import org.apache.camel.model.validator.ValidatorDefinition;
+import org.apache.camel.reifier.AbstractReifier;
 import org.apache.camel.spi.Validator;
 
-public abstract class ValidatorReifier<T> {
+public abstract class ValidatorReifier<T> extends AbstractReifier  {
 
-    private static final Map<Class<?>, Function<ValidatorDefinition, ValidatorReifier<? extends ValidatorDefinition>>> VALIDATORS;
+    private static final Map<Class<?>, BiFunction<CamelContext, ValidatorDefinition, ValidatorReifier<? extends ValidatorDefinition>>> VALIDATORS;
     static {
-        Map<Class<?>, Function<ValidatorDefinition, ValidatorReifier<? extends ValidatorDefinition>>> map = new HashMap<>();
+        Map<Class<?>, BiFunction<CamelContext, ValidatorDefinition, ValidatorReifier<? extends ValidatorDefinition>>> map = new HashMap<>();
         map.put(CustomValidatorDefinition.class, CustomValidatorReifier::new);
         map.put(EndpointValidatorDefinition.class, EndpointValidatorReifier::new);
         map.put(PredicateValidatorDefinition.class, PredicateValidatorReifier::new);
@@ -40,26 +41,27 @@ public abstract class ValidatorReifier<T> {
 
     protected final T definition;
 
-    public ValidatorReifier(T definition) {
+    public ValidatorReifier(CamelContext camelContext, T definition) {
+        super(camelContext);
         this.definition = definition;
     }
 
-    public static void registerReifier(Class<?> processorClass, Function<ValidatorDefinition, ValidatorReifier<? extends ValidatorDefinition>> creator) {
+    public static void registerReifier(Class<?> processorClass, BiFunction<CamelContext, ValidatorDefinition, ValidatorReifier<? extends ValidatorDefinition>> creator) {
         VALIDATORS.put(processorClass, creator);
     }
 
-    public static ValidatorReifier<? extends ValidatorDefinition> reifier(ValidatorDefinition definition) {
-        Function<ValidatorDefinition, ValidatorReifier<? extends ValidatorDefinition>> reifier = VALIDATORS.get(definition.getClass());
+    public static ValidatorReifier<? extends ValidatorDefinition> reifier(CamelContext camelContext, ValidatorDefinition definition) {
+        BiFunction<CamelContext, ValidatorDefinition, ValidatorReifier<? extends ValidatorDefinition>> reifier = VALIDATORS.get(definition.getClass());
         if (reifier != null) {
-            return reifier.apply(definition);
+            return reifier.apply(camelContext, definition);
         }
         throw new IllegalStateException("Unsupported definition: " + definition);
     }
 
-    public Validator createValidator(CamelContext context) {
-        return doCreateValidator(context);
+    public Validator createValidator() {
+        return doCreateValidator();
     }
 
-    protected abstract Validator doCreateValidator(CamelContext context);
+    protected abstract Validator doCreateValidator();
 
 }
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 21a6b70..6bce66e 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
@@ -498,7 +498,7 @@ public abstract class AbstractCamelContextFactoryBean<T extends ModelCamelContex
         if (getValidators() != null) {
             for (ValidatorDefinition def : getValidators().getValidators()) {
                 // create and register validators on validator registry
-                Validator validator = ValidatorReifier.reifier(def).createValidator(getContext());
+                Validator validator = ValidatorReifier.reifier(getContext(), def).createValidator();
                 getContext().getValidatorRegistry().put(createValidatorKey(def), validator);
             }
         }

Reply | Threaded
Open this post in threaded view
|

[camel] 05/18: Introduce reifiers for expressions

Guillaume Nodet-2
In reply to this post by Guillaume Nodet-2
This is an automated email from the ASF dual-hosted git repository.

gnodet pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 351013beb2cd500708db9c65db26daf67bd6b043
Author: Guillaume Nodet <[hidden email]>
AuthorDate: Mon Feb 10 20:19:50 2020 +0100

    Introduce reifiers for expressions
---
 .../model/ExpressionSubElementDefinition.java      |  48 +----
 .../apache/camel/model/RouteDefinitionHelper.java  |  17 +-
 .../camel/model/language/ExpressionDefinition.java | 162 +++--------------
 .../camel/model/language/JsonPathExpression.java   |  62 -------
 .../camel/model/language/MethodCallExpression.java |  48 -----
 .../model/language/NamespaceAwareExpression.java   |  18 --
 .../camel/model/language/SimpleExpression.java     |  31 ----
 .../camel/model/language/TokenizerExpression.java  |  43 -----
 .../model/language/XMLTokenizerExpression.java     |  31 +---
 .../camel/model/language/XPathExpression.java      | 112 ++----------
 .../camel/model/language/XQueryExpression.java     |  40 +----
 .../org/apache/camel/reifier/AbstractReifier.java  |  21 +++
 .../org/apache/camel/reifier/AggregateReifier.java |   8 +-
 .../org/apache/camel/reifier/CatchReifier.java     |   2 +-
 .../org/apache/camel/reifier/DelayReifier.java     |   7 +-
 .../apache/camel/reifier/DynamicRouterReifier.java |   2 +-
 .../org/apache/camel/reifier/EnrichReifier.java    |   2 +-
 .../apache/camel/reifier/ExpressionReifier.java    |   2 +-
 .../camel/reifier/IdempotentConsumerReifier.java   |   2 +-
 .../java/org/apache/camel/reifier/LoopReifier.java |   4 +-
 .../apache/camel/reifier/OnCompletionReifier.java  |   2 +-
 .../apache/camel/reifier/OnExceptionReifier.java   |  19 +-
 .../apache/camel/reifier/PollEnrichReifier.java    |   2 +-
 .../apache/camel/reifier/RecipientListReifier.java |   2 +-
 .../apache/camel/reifier/ResequenceReifier.java    |   4 +-
 .../apache/camel/reifier/RoutingSlipReifier.java   |   2 +-
 .../org/apache/camel/reifier/ScriptReifier.java    |   2 +-
 .../org/apache/camel/reifier/SetBodyReifier.java   |   2 +-
 .../org/apache/camel/reifier/SetHeaderReifier.java |   2 +-
 .../apache/camel/reifier/SetPropertyReifier.java   |   2 +-
 .../java/org/apache/camel/reifier/SortReifier.java |   2 +-
 .../org/apache/camel/reifier/SplitReifier.java     |   2 +-
 .../org/apache/camel/reifier/ThrottleReifier.java  |  11 +-
 .../org/apache/camel/reifier/TransformReifier.java |   2 +-
 .../org/apache/camel/reifier/ValidateReifier.java  |   2 +-
 .../org/apache/camel/reifier/WireTapReifier.java   |   2 +-
 .../camel/reifier/language/ExpressionReifier.java  | 200 +++++++++++++++++++++
 .../language/JsonPathExpressionReifier.java        |  58 ++++++
 .../language/MethodCallExpressionReifier.java      |  64 +++++++
 .../reifier/language/SimpleExpressionReifier.java  |  54 ++++++
 .../language/TokenizerExpressionReifier.java       |  73 ++++++++
 .../language/XMLTokenizerExpressionReifier.java    |  66 +++++++
 .../reifier/language/XPathExpressionReifier.java   |  69 +++++++
 .../reifier/language/XQueryExpressionReifier.java  |  63 +++++++
 .../loadbalancer/StickyLoadBalancerReifier.java    |   2 +-
 45 files changed, 767 insertions(+), 604 deletions(-)

diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/model/ExpressionSubElementDefinition.java b/core/camel-core-engine/src/main/java/org/apache/camel/model/ExpressionSubElementDefinition.java
index 7db2521..3bb97af 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/model/ExpressionSubElementDefinition.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/model/ExpressionSubElementDefinition.java
@@ -20,12 +20,10 @@ import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlElementRef;
 import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlTransient;
 
 import org.apache.camel.Expression;
 import org.apache.camel.Predicate;
 import org.apache.camel.model.language.ExpressionDefinition;
-import org.apache.camel.spi.RouteContext;
 
 /**
  * Represents an expression sub element
@@ -35,20 +33,16 @@ import org.apache.camel.spi.RouteContext;
 public class ExpressionSubElementDefinition {
     @XmlElementRef
     private ExpressionDefinition expressionType;
-    @XmlTransient
-    private Expression expression;
-    @XmlTransient
-    private Predicate predicate;
 
     public ExpressionSubElementDefinition() {
     }
 
     public ExpressionSubElementDefinition(Expression expression) {
-        this.expression = expression;
+        this.expressionType = new ExpressionDefinition(expression);
     }
 
     public ExpressionSubElementDefinition(Predicate predicate) {
-        this.predicate = predicate;
+        this.expressionType = new ExpressionDefinition(predicate);
     }
 
     public ExpressionDefinition getExpressionType() {
@@ -59,46 +53,10 @@ public class ExpressionSubElementDefinition {
         this.expressionType = expressionType;
     }
 
-    public Expression getExpression() {
-        return expression;
-    }
-
-    public void setExpression(Expression expression) {
-        this.expression = expression;
-    }
-
-    public void setPredicate(Predicate predicate) {
-        this.predicate = predicate;
-    }
-
-    public Predicate getPredicate() {
-        return predicate;
-    }
-
-    public Expression createExpression(RouteContext routeContext) {
-        ExpressionDefinition expressionType = getExpressionType();
-        if (expressionType != null && expression == null) {
-            expression = expressionType.createExpression(routeContext);
-        }
-        return expression;
-    }
-
-    public Predicate createPredicate(RouteContext routeContext) {
-        ExpressionDefinition expressionType = getExpressionType();
-        if (expressionType != null && getPredicate() == null) {
-            setPredicate(expressionType.createPredicate(routeContext));
-        }
-        return getPredicate();
-    }
-
     @Override
     public String toString() {
-        if (expression != null) {
-            return expression.toString();
-        } else if (expressionType != null) {
+        if (expressionType != null) {
             return expressionType.toString();
-        } else if (predicate != null) {
-            return predicate.toString();
         }
         return super.toString();
     }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/model/RouteDefinitionHelper.java b/core/camel-core-engine/src/main/java/org/apache/camel/model/RouteDefinitionHelper.java
index 02b07ca..643a1cd 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/model/RouteDefinitionHelper.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/model/RouteDefinitionHelper.java
@@ -451,15 +451,14 @@ public final class RouteDefinitionHelper {
     }
 
     private static void initRouteInput(CamelContext camelContext, FromDefinition input) {
-        // resolve property placeholders on route input which hasn't been done
-        // yet
-        if (input != null) {
-            try {
-                ProcessorDefinitionHelper.resolvePropertyPlaceholders(camelContext, input);
-            } catch (Exception e) {
-                throw RuntimeCamelException.wrapRuntimeCamelException(e);
-            }
-        }
+//        // resolve property placeholders on route input which hasn't been done yet
+//        if (input != null) {
+//            try {
+//                ProcessorDefinitionHelper.resolvePropertyPlaceholders(camelContext, input);
+//            } catch (Exception e) {
+//                throw RuntimeCamelException.wrapRuntimeCamelException(e);
+//            }
+//        }
     }
 
     private static void initParentAndErrorHandlerBuilder(CamelContext context, RouteDefinition route, List<ProcessorDefinition<?>> abstracts,
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/model/language/ExpressionDefinition.java b/core/camel-core-engine/src/main/java/org/apache/camel/model/language/ExpressionDefinition.java
index f273cc7..e6fb629 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/model/language/ExpressionDefinition.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/model/language/ExpressionDefinition.java
@@ -28,24 +28,16 @@ import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlTransient;
 import javax.xml.bind.annotation.XmlType;
 import javax.xml.bind.annotation.XmlValue;
-import javax.xml.namespace.QName;
 
-import org.apache.camel.AfterPropertiesConfigured;
 import org.apache.camel.CamelContext;
-import org.apache.camel.CamelContextAware;
 import org.apache.camel.Exchange;
 import org.apache.camel.Expression;
 import org.apache.camel.ExpressionFactory;
-import org.apache.camel.ExtendedCamelContext;
-import org.apache.camel.NoSuchLanguageException;
 import org.apache.camel.Predicate;
 import org.apache.camel.model.DefinitionPropertyPlaceholderConfigurer;
 import org.apache.camel.model.OtherAttributesAware;
-import org.apache.camel.spi.Language;
+import org.apache.camel.reifier.language.ExpressionReifier;
 import org.apache.camel.spi.Metadata;
-import org.apache.camel.spi.RouteContext;
-import org.apache.camel.support.ExpressionToPredicateAdapter;
-import org.apache.camel.support.ScriptHelper;
 import org.apache.camel.util.CollectionStringBuffer;
 import org.apache.camel.util.ObjectHelper;
 
@@ -122,113 +114,10 @@ public class ExpressionDefinition implements Expression, Predicate, OtherAttribu
         return sb.toString();
     }
 
-    public Object evaluate(Exchange exchange) {
-        return evaluate(exchange, Object.class);
-    }
-
-    @Override
-    public <T> T evaluate(Exchange exchange, Class<T> type) {
-        if (expressionValue == null) {
-            expressionValue = createExpression(exchange.getContext());
-        }
-        ObjectHelper.notNull(expressionValue, "expressionValue");
-        return expressionValue.evaluate(exchange, type);
-    }
-
-    public void assertMatches(String text, Exchange exchange) throws AssertionError {
-        if (!matches(exchange)) {
-            throw new AssertionError(text + getExpression() + " for exchange: " + exchange);
-        }
-    }
-
-    @Override
-    public boolean matches(Exchange exchange) {
-        if (predicate == null) {
-            predicate = createPredicate(exchange.getContext());
-        }
-        ObjectHelper.notNull(predicate, "predicate");
-        return predicate.matches(exchange);
-    }
-
     public String getLanguage() {
         return "";
     }
 
-    public final Predicate createPredicate(RouteContext routeContext) {
-        return createPredicate(routeContext.getCamelContext());
-    }
-
-    public Predicate createPredicate(CamelContext camelContext) {
-        if (predicate == null) {
-            if (getExpressionType() != null) {
-                predicate = getExpressionType().createPredicate(camelContext);
-            } else if (getExpressionValue() != null) {
-                predicate = new ExpressionToPredicateAdapter(getExpressionValue());
-            } else if (getExpression() != null) {
-                ObjectHelper.notNull("language", getLanguage());
-                Language language = camelContext.resolveLanguage(getLanguage());
-                if (language == null) {
-                    throw new NoSuchLanguageException(getLanguage());
-                }
-                String exp = getExpression();
-                // should be true by default
-                boolean isTrim = getTrim() == null || Boolean.parseBoolean(getTrim());
-                // trim if configured to trim
-                if (exp != null && isTrim) {
-                    exp = exp.trim();
-                }
-                // resolve the expression as it may be an external script from
-                // the classpath/file etc
-                exp = ScriptHelper.resolveOptionalExternalScript(camelContext, exp);
-
-                predicate = language.createPredicate(exp);
-                configurePredicate(camelContext, predicate);
-            }
-        }
-        // inject CamelContext if its aware
-        if (predicate instanceof CamelContextAware) {
-            ((CamelContextAware)predicate).setCamelContext(camelContext);
-        }
-        return predicate;
-    }
-
-    public final Expression createExpression(RouteContext routeContext) {
-        return createExpression(routeContext.getCamelContext());
-    }
-
-    @Override
-    public Expression createExpression(CamelContext camelContext) {
-        if (getExpressionValue() == null) {
-            if (getExpressionType() != null) {
-                setExpressionValue(getExpressionType().createExpression(camelContext));
-            } else if (getExpression() != null) {
-                ObjectHelper.notNull("language", getLanguage());
-                Language language = camelContext.resolveLanguage(getLanguage());
-                if (language == null) {
-                    throw new NoSuchLanguageException(getLanguage());
-                }
-                String exp = getExpression();
-                // should be true by default
-                boolean isTrim = getTrim() == null || Boolean.parseBoolean(getTrim());
-                // trim if configured to trim
-                if (exp != null && isTrim) {
-                    exp = exp.trim();
-                }
-                // resolve the expression as it may be an external script from
-                // the classpath/file etc
-                exp = ScriptHelper.resolveOptionalExternalScript(camelContext, exp);
-
-                setExpressionValue(language.createExpression(exp));
-                configureExpression(camelContext, getExpressionValue());
-            }
-        }
-        // inject CamelContext if its aware
-        if (getExpressionValue() instanceof CamelContextAware) {
-            ((CamelContextAware)getExpressionValue()).setCamelContext(camelContext);
-        }
-        return getExpressionValue();
-    }
-
     public String getExpression() {
         return expression;
     }
@@ -314,32 +203,39 @@ public class ExpressionDefinition implements Expression, Predicate, OtherAttribu
         this.expressionType = expressionType;
     }
 
-    protected void configurePredicate(CamelContext camelContext, Predicate predicate) {
-        // allows to perform additional logic after the properties has been
-        // configured which may be needed
-        // in the various camel components outside camel-core
-        if (predicate instanceof AfterPropertiesConfigured) {
-            ((AfterPropertiesConfigured)predicate).afterPropertiesConfigured(camelContext);
-        }
+    //
+    // ExpressionFactory
+    //
+
+    @Override
+    public Expression createExpression(CamelContext camelContext) {
+        return ExpressionReifier.reifier(camelContext, this).createExpression();
     }
 
-    protected void configureExpression(CamelContext camelContext, Expression expression) {
-        // allows to perform additional logic after the properties has been
-        // configured which may be needed
-        // in the various camel components outside camel-core
-        if (expression instanceof AfterPropertiesConfigured) {
-            ((AfterPropertiesConfigured)expression).afterPropertiesConfigured(camelContext);
+    //
+    // Expression
+    //
+
+    @Override
+    public <T> T evaluate(Exchange exchange, Class<T> type) {
+        if (expressionValue == null) {
+            expressionValue = createExpression(exchange.getContext());
         }
+        ObjectHelper.notNull(expressionValue, "expressionValue");
+        return expressionValue.evaluate(exchange, type);
     }
 
-    /**
-     * Sets a named property on the object instance using introspection
-     */
-    protected void setProperty(CamelContext camelContext, Object bean, String name, Object value) {
-        try {
-            camelContext.adapt(ExtendedCamelContext.class).getBeanIntrospection().setProperty(camelContext, bean, name, value);
-        } catch (Exception e) {
-            throw new IllegalArgumentException("Failed to set property " + name + " on " + bean + ". Reason: " + e, e);
+    //
+    // Predicate
+    //
+
+    @Override
+    public boolean matches(Exchange exchange) {
+        if (predicate == null) {
+            predicate = ExpressionReifier.reifier(exchange.getContext(), this).createPredicate();
         }
+        ObjectHelper.notNull(predicate, "predicate");
+        return predicate.matches(exchange);
     }
+
 }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/model/language/JsonPathExpression.java b/core/camel-core-engine/src/main/java/org/apache/camel/model/language/JsonPathExpression.java
index 1596961..75dd3d0 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/model/language/JsonPathExpression.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/model/language/JsonPathExpression.java
@@ -22,10 +22,6 @@ import javax.xml.bind.annotation.XmlAttribute;
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlTransient;
 
-import org.apache.camel.CamelContext;
-import org.apache.camel.Expression;
-import org.apache.camel.Predicate;
-import org.apache.camel.RuntimeCamelException;
 import org.apache.camel.spi.Metadata;
 
 /**
@@ -145,62 +141,4 @@ public class JsonPathExpression extends ExpressionDefinition {
         return "jsonpath";
     }
 
-    @Override
-    public Expression createExpression(CamelContext camelContext) {
-        if (resultType == null && resultTypeName != null) {
-            try {
-                resultType = camelContext.getClassResolver().resolveMandatoryClass(resultTypeName);
-            } catch (ClassNotFoundException e) {
-                throw RuntimeCamelException.wrapRuntimeCamelException(e);
-            }
-        }
-        return super.createExpression(camelContext);
-    }
-
-    @Override
-    protected void configureExpression(CamelContext camelContext, Expression expression) {
-        if (resultType != null) {
-            setProperty(camelContext, expression, "resultType", resultType);
-        }
-        if (suppressExceptions != null) {
-            setProperty(camelContext, expression, "suppressExceptions", suppressExceptions);
-        }
-        if (allowSimple != null) {
-            setProperty(camelContext, expression, "allowSimple", allowSimple);
-        }
-        if (allowEasyPredicate != null) {
-            setProperty(camelContext, expression, "allowEasyPredicate", allowEasyPredicate);
-        }
-        if (writeAsString != null) {
-            setProperty(camelContext, expression, "writeAsString", writeAsString);
-        }
-        if (headerName != null) {
-            setProperty(camelContext, expression, "headerName", headerName);
-        }
-        super.configureExpression(camelContext, expression);
-    }
-
-    @Override
-    protected void configurePredicate(CamelContext camelContext, Predicate predicate) {
-        if (resultType != null) {
-            setProperty(camelContext, predicate, "resultType", resultType);
-        }
-        if (suppressExceptions != null) {
-            setProperty(camelContext, predicate, "suppressExceptions", suppressExceptions);
-        }
-        if (allowSimple != null) {
-            setProperty(camelContext, predicate, "allowSimple", allowSimple);
-        }
-        if (allowEasyPredicate != null) {
-            setProperty(camelContext, predicate, "allowEasyPredicate", allowEasyPredicate);
-        }
-        if (writeAsString != null) {
-            setProperty(camelContext, predicate, "writeAsString", writeAsString);
-        }
-        if (headerName != null) {
-            setProperty(camelContext, predicate, "headerName", headerName);
-        }
-        super.configurePredicate(camelContext, predicate);
-    }
-
 }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/model/language/MethodCallExpression.java b/core/camel-core-engine/src/main/java/org/apache/camel/model/language/MethodCallExpression.java
index 587b24c..fc65cfd 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/model/language/MethodCallExpression.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/model/language/MethodCallExpression.java
@@ -22,12 +22,6 @@ import javax.xml.bind.annotation.XmlAttribute;
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlTransient;
 
-import org.apache.camel.AfterPropertiesConfigured;
-import org.apache.camel.CamelContext;
-import org.apache.camel.Expression;
-import org.apache.camel.Predicate;
-import org.apache.camel.RuntimeCamelException;
-import org.apache.camel.spi.Language;
 import org.apache.camel.spi.Metadata;
 import org.apache.camel.util.ObjectHelper;
 
@@ -151,48 +145,6 @@ public class MethodCallExpression extends ExpressionDefinition {
         }
     }
 
-    @Override
-    public Expression createExpression(CamelContext camelContext) {
-        if (beanType == null && beanTypeName != null) {
-            try {
-                beanType = camelContext.getClassResolver().resolveMandatoryClass(beanTypeName);
-            } catch (ClassNotFoundException e) {
-                throw RuntimeCamelException.wrapRuntimeCamelException(e);
-            }
-        }
-
-        // special for bean language where we need to configure it first
-        Language lan = camelContext.resolveLanguage("bean");
-        configureLanguage(camelContext, lan);
-        // .. and create expression with null value as we use the configured
-        // properties instead
-        Expression exp = lan.createExpression(null);
-        if (exp instanceof AfterPropertiesConfigured) {
-            ((AfterPropertiesConfigured)exp).afterPropertiesConfigured(camelContext);
-        }
-        return exp;
-    }
-
-    protected void configureLanguage(CamelContext camelContext, Language language) {
-        if (instance != null) {
-            setProperty(camelContext, language, "bean", instance);
-        }
-        if (beanType != null) {
-            setProperty(camelContext, language, "beanType", beanType);
-        }
-        if (ref != null) {
-            setProperty(camelContext, language, "ref", ref);
-        }
-        if (method != null) {
-            setProperty(camelContext, language, "method", method);
-        }
-    }
-
-    @Override
-    public Predicate createPredicate(CamelContext camelContext) {
-        return (Predicate)createExpression(camelContext);
-    }
-
     private String beanName() {
         if (ref != null) {
             return ref;
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/model/language/NamespaceAwareExpression.java b/core/camel-core-engine/src/main/java/org/apache/camel/model/language/NamespaceAwareExpression.java
index 3411cb7..66c7d59 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/model/language/NamespaceAwareExpression.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/model/language/NamespaceAwareExpression.java
@@ -59,22 +59,4 @@ public abstract class NamespaceAwareExpression extends ExpressionDefinition impl
         this.namespaces = namespaces;
     }
 
-    @Override
-    protected void configureExpression(CamelContext camelContext, Expression expression) {
-        configureNamespaceAware(expression);
-        super.configureExpression(camelContext, expression);
-    }
-
-    @Override
-    protected void configurePredicate(CamelContext camelContext, Predicate predicate) {
-        configureNamespaceAware(predicate);
-        super.configurePredicate(camelContext, predicate);
-    }
-
-    protected void configureNamespaceAware(Object builder) {
-        if (namespaces != null && builder instanceof NamespaceAware) {
-            NamespaceAware namespaceAware = (NamespaceAware)builder;
-            namespaceAware.setNamespaces(namespaces);
-        }
-    }
 }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/model/language/SimpleExpression.java b/core/camel-core-engine/src/main/java/org/apache/camel/model/language/SimpleExpression.java
index ba19330..5951d6f 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/model/language/SimpleExpression.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/model/language/SimpleExpression.java
@@ -22,11 +22,7 @@ import javax.xml.bind.annotation.XmlAttribute;
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlTransient;
 
-import org.apache.camel.CamelContext;
 import org.apache.camel.Expression;
-import org.apache.camel.Predicate;
-import org.apache.camel.RuntimeCamelException;
-import org.apache.camel.builder.SimpleBuilder;
 import org.apache.camel.spi.Metadata;
 
 /**
@@ -79,31 +75,4 @@ public class SimpleExpression extends ExpressionDefinition {
         this.resultTypeName = resultTypeName;
     }
 
-    @Override
-    public Expression createExpression(CamelContext camelContext) {
-        if (resultType == null && resultTypeName != null) {
-            try {
-                resultType = camelContext.getClassResolver().resolveMandatoryClass(resultTypeName);
-            } catch (ClassNotFoundException e) {
-                throw RuntimeCamelException.wrapRuntimeCamelException(e);
-            }
-        }
-
-        String exp = getExpression();
-        // should be true by default
-        boolean isTrim = getTrim() == null || Boolean.parseBoolean(getTrim());
-        if (exp != null && isTrim) {
-            exp = exp.trim();
-        }
-
-        SimpleBuilder answer = new SimpleBuilder(exp);
-        answer.setResultType(resultType);
-        return answer;
-    }
-
-    @Override
-    public Predicate createPredicate(CamelContext camelContext) {
-        // SimpleBuilder is also a Predicate
-        return (Predicate)createExpression(camelContext);
-    }
 }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/model/language/TokenizerExpression.java b/core/camel-core-engine/src/main/java/org/apache/camel/model/language/TokenizerExpression.java
index 3883f05..bd9e4ed 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/model/language/TokenizerExpression.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/model/language/TokenizerExpression.java
@@ -21,12 +21,8 @@ import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlAttribute;
 import javax.xml.bind.annotation.XmlRootElement;
 
-import org.apache.camel.CamelContext;
-import org.apache.camel.Expression;
-import org.apache.camel.Predicate;
 import org.apache.camel.language.tokenizer.TokenizeLanguage;
 import org.apache.camel.spi.Metadata;
-import org.apache.camel.support.ExpressionToPredicateAdapter;
 
 /**
  * To use Camel message body or header with a tokenizer in Camel expressions or
@@ -198,45 +194,6 @@ public class TokenizerExpression extends ExpressionDefinition {
     }
 
     @Override
-    public Expression createExpression(CamelContext camelContext) {
-        // special for new line tokens, if defined from XML then its 2
-        // characters, so we replace that back to a single char
-        if (token.startsWith("\\n")) {
-            token = '\n' + token.substring(2);
-        }
-
-        TokenizeLanguage language = new TokenizeLanguage();
-        language.setToken(token);
-        language.setEndToken(endToken);
-        language.setInheritNamespaceTagName(inheritNamespaceTagName);
-        language.setHeaderName(headerName);
-        language.setGroupDelimiter(groupDelimiter);
-        if (regex != null) {
-            language.setRegex(Boolean.parseBoolean(regex));
-        }
-        if (xml != null) {
-            language.setXml(Boolean.parseBoolean(xml));
-        }
-        if (includeTokens != null) {
-            language.setIncludeTokens(Boolean.parseBoolean(includeTokens));
-        }
-        if (group != null && !"0".equals(group)) {
-            language.setGroup(group);
-        }
-
-        if (skipFirst != null) {
-            language.setSkipFirst(Boolean.parseBoolean(skipFirst));
-        }
-        return language.createExpression();
-    }
-
-    @Override
-    public Predicate createPredicate(CamelContext camelContext) {
-        Expression exp = createExpression(camelContext);
-        return ExpressionToPredicateAdapter.toPredicate(exp);
-    }
-
-    @Override
     public String toString() {
         if (endToken != null) {
             return "tokenize{body() using tokens: " + token + "..." + endToken + "}";
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/model/language/XMLTokenizerExpression.java b/core/camel-core-engine/src/main/java/org/apache/camel/model/language/XMLTokenizerExpression.java
index 93a5997..d206a4e 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/model/language/XMLTokenizerExpression.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/model/language/XMLTokenizerExpression.java
@@ -16,6 +16,9 @@
  */
 package org.apache.camel.model.language;
 
+import java.util.HashMap;
+import java.util.Map;
+
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlAttribute;
@@ -96,32 +99,4 @@ public class XMLTokenizerExpression extends NamespaceAwareExpression {
         this.group = group;
     }
 
-    @Override
-    protected void configureExpression(CamelContext camelContext, Expression expression) {
-        if (headerName != null) {
-            setProperty(camelContext, expression, "headerName", headerName);
-        }
-        if (mode != null) {
-            setProperty(camelContext, expression, "mode", mode);
-        }
-        if (group != null) {
-            setProperty(camelContext, expression, "group", group);
-        }
-        super.configureExpression(camelContext, expression);
-    }
-
-    @Override
-    protected void configurePredicate(CamelContext camelContext, Predicate predicate) {
-        if (headerName != null) {
-            setProperty(camelContext, predicate, "headerName", headerName);
-        }
-        if (mode != null) {
-            setProperty(camelContext, predicate, "mode", mode);
-        }
-        if (group != null) {
-            setProperty(camelContext, predicate, "group", group);
-        }
-        super.configurePredicate(camelContext, predicate);
-    }
-
 }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/model/language/XPathExpression.java b/core/camel-core-engine/src/main/java/org/apache/camel/model/language/XPathExpression.java
index 4cad7f6..8acd6da 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/model/language/XPathExpression.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/model/language/XPathExpression.java
@@ -16,6 +16,9 @@
  */
 package org.apache.camel.model.language;
 
+import java.util.HashMap;
+import java.util.Map;
+
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlAttribute;
@@ -190,6 +193,14 @@ public class XPathExpression extends NamespaceAwareExpression {
         this.headerName = headerName;
     }
 
+    public XPathFactory getXPathFactory() {
+        return xpathFactory;
+    }
+
+    public void setXPathFactory(XPathFactory xpathFactory) {
+        this.xpathFactory = xpathFactory;
+    }
+
     public String getThreadSafety() {
         return threadSafety;
     }
@@ -210,107 +221,6 @@ public class XPathExpression extends NamespaceAwareExpression {
         this.threadSafety = threadSafety;
     }
 
-    @Override
-    public Expression createExpression(CamelContext camelContext) {
-        if (documentType == null && documentTypeName != null) {
-            try {
-                documentType = camelContext.getClassResolver().resolveMandatoryClass(documentTypeName);
-            } catch (ClassNotFoundException e) {
-                throw RuntimeCamelException.wrapRuntimeCamelException(e);
-            }
-        }
-        if (resultType == null && resultTypeName != null) {
-            try {
-                resultType = camelContext.getClassResolver().resolveMandatoryClass(resultTypeName);
-            } catch (ClassNotFoundException e) {
-                throw RuntimeCamelException.wrapRuntimeCamelException(e);
-            }
-        }
-        resolveXPathFactory(camelContext);
-        return super.createExpression(camelContext);
-    }
-
-    @Override
-    public Predicate createPredicate(CamelContext camelContext) {
-        if (documentType == null && documentTypeName != null) {
-            try {
-                documentType = camelContext.getClassResolver().resolveMandatoryClass(documentTypeName);
-            } catch (ClassNotFoundException e) {
-                throw RuntimeCamelException.wrapRuntimeCamelException(e);
-            }
-        }
-        resolveXPathFactory(camelContext);
-        return super.createPredicate(camelContext);
-    }
-
-    @Override
-    protected void configureExpression(CamelContext camelContext, Expression expression) {
-        boolean isSaxon = getSaxon() != null && Boolean.parseBoolean(getSaxon());
-        boolean isLogNamespaces = getLogNamespaces() != null && Boolean.parseBoolean(getLogNamespaces());
-
-        if (documentType != null) {
-            setProperty(camelContext, expression, "documentType", documentType);
-        }
-        if (resultType != null) {
-            setProperty(camelContext, expression, "resultType", resultType);
-        }
-        if (isSaxon) {
-            setProperty(camelContext, expression, "useSaxon", true);
-        }
-        if (xpathFactory != null) {
-            setProperty(camelContext, expression, "xPathFactory", xpathFactory);
-        }
-        if (objectModel != null) {
-            setProperty(camelContext, expression, "objectModelUri", objectModel);
-        }
-        if (threadSafety != null) {
-            setProperty(camelContext, expression, "threadSafety", threadSafety);
-        }
-        if (isLogNamespaces) {
-            setProperty(camelContext, expression, "logNamespaces", true);
-        }
-        if (ObjectHelper.isNotEmpty(getHeaderName())) {
-            setProperty(camelContext, expression, "headerName", getHeaderName());
-        }
-        // moved the super configuration to the bottom so that the namespace
-        // init picks up the newly set XPath Factory
-        super.configureExpression(camelContext, expression);
-    }
-
-    @Override
-    protected void configurePredicate(CamelContext camelContext, Predicate predicate) {
-        boolean isSaxon = getSaxon() != null && Boolean.parseBoolean(getSaxon());
-        boolean isLogNamespaces = getLogNamespaces() != null && Boolean.parseBoolean(getLogNamespaces());
-
-        if (documentType != null) {
-            setProperty(camelContext, predicate, "documentType", documentType);
-        }
-        if (resultType != null) {
-            setProperty(camelContext, predicate, "resultType", resultType);
-        }
-        if (isSaxon) {
-            setProperty(camelContext, predicate, "useSaxon", true);
-        }
-        if (xpathFactory != null) {
-            setProperty(camelContext, predicate, "xPathFactory", xpathFactory);
-        }
-        if (objectModel != null) {
-            setProperty(camelContext, predicate, "objectModelUri", objectModel);
-        }
-        if (threadSafety != null) {
-            setProperty(camelContext, predicate, "threadSafety", threadSafety);
-        }
-        if (isLogNamespaces) {
-            setProperty(camelContext, predicate, "logNamespaces", true);
-        }
-        if (ObjectHelper.isNotEmpty(getHeaderName())) {
-            setProperty(camelContext, predicate, "headerName", getHeaderName());
-        }
-        // moved the super configuration to the bottom so that the namespace
-        // init picks up the newly set XPath Factory
-        super.configurePredicate(camelContext, predicate);
-    }
-
     private void resolveXPathFactory(CamelContext camelContext) {
         // Factory and Object Model can be set simultaneously. The underlying
         // XPathBuilder allows for setting Saxon too, as it is simply a shortcut
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/model/language/XQueryExpression.java b/core/camel-core-engine/src/main/java/org/apache/camel/model/language/XQueryExpression.java
index c84679e..eaa9e27 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/model/language/XQueryExpression.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/model/language/XQueryExpression.java
@@ -16,6 +16,9 @@
  */
 package org.apache.camel.model.language;
 
+import java.util.HashMap;
+import java.util.Map;
+
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlAttribute;
@@ -25,9 +28,7 @@ import javax.xml.bind.annotation.XmlTransient;
 import org.apache.camel.CamelContext;
 import org.apache.camel.Expression;
 import org.apache.camel.Predicate;
-import org.apache.camel.RuntimeCamelException;
 import org.apache.camel.spi.Metadata;
-import org.apache.camel.util.ObjectHelper;
 
 /**
  * To use XQuery (XML) in Camel expressions or predicates.
@@ -92,39 +93,4 @@ public class XQueryExpression extends NamespaceAwareExpression {
         this.headerName = headerName;
     }
 
-    @Override
-    public Expression createExpression(CamelContext camelContext) {
-        if (resultType == null && type != null) {
-            try {
-                resultType = camelContext.getClassResolver().resolveMandatoryClass(type);
-            } catch (ClassNotFoundException e) {
-                throw RuntimeCamelException.wrapRuntimeCamelException(e);
-            }
-        }
-
-        return super.createExpression(camelContext);
-    }
-
-    @Override
-    protected void configureExpression(CamelContext camelContext, Expression expression) {
-        if (resultType != null) {
-            setProperty(camelContext, expression, "resultType", resultType);
-        }
-        if (ObjectHelper.isNotEmpty(getHeaderName())) {
-            setProperty(camelContext, expression, "headerName", getHeaderName());
-        }
-        super.configureExpression(camelContext, expression);
-    }
-
-    @Override
-    protected void configurePredicate(CamelContext camelContext, Predicate predicate) {
-        if (resultType != null) {
-            setProperty(camelContext, predicate, "resultType", resultType);
-        }
-        if (ObjectHelper.isNotEmpty(getHeaderName())) {
-            setProperty(camelContext, predicate, "headerName", getHeaderName());
-        }
-        super.configurePredicate(camelContext, predicate);
-    }
-
 }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/AbstractReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/AbstractReifier.java
index cefcfab..17eac69 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/AbstractReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/AbstractReifier.java
@@ -17,6 +17,11 @@
 package org.apache.camel.reifier;
 
 import org.apache.camel.CamelContext;
+import org.apache.camel.Expression;
+import org.apache.camel.Predicate;
+import org.apache.camel.model.ExpressionSubElementDefinition;
+import org.apache.camel.model.language.ExpressionDefinition;
+import org.apache.camel.reifier.language.ExpressionReifier;
 import org.apache.camel.spi.RouteContext;
 import org.apache.camel.support.CamelContextHelper;
 
@@ -56,4 +61,20 @@ public abstract class AbstractReifier {
         return CamelContextHelper.parse(camelContext, clazz, text);
     }
 
+    protected Expression createExpression(ExpressionDefinition expression) {
+        return ExpressionReifier.reifier(camelContext, expression).createExpression();
+    }
+
+    protected Expression createExpression(ExpressionSubElementDefinition expression) {
+        return ExpressionReifier.reifier(camelContext, expression).createExpression();
+    }
+
+    protected Predicate createPredicate(ExpressionDefinition expression) {
+        return ExpressionReifier.reifier(camelContext, expression).createPredicate();
+    }
+
+    protected Predicate createPredicate(ExpressionSubElementDefinition expression) {
+        return ExpressionReifier.reifier(camelContext, expression).createPredicate();
+    }
+
 }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/AggregateReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/AggregateReifier.java
index 81f129f..ce82896 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/AggregateReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/AggregateReifier.java
@@ -54,7 +54,7 @@ public class AggregateReifier extends ProcessorReifier<AggregateDefinition> {
         CamelInternalProcessor internal = new CamelInternalProcessor(camelContext, childProcessor);
         internal.addAdvice(new CamelInternalProcessor.UnitOfWorkProcessorAdvice(routeContext, camelContext));
 
-        Expression correlation = definition.getExpression().createExpression(routeContext);
+        Expression correlation = createExpression(definition.getExpression());
         AggregationStrategy strategy = createAggregationStrategy(routeContext);
 
         boolean parallel = parseBoolean(definition.getParallelProcessing());
@@ -112,7 +112,7 @@ public class AggregateReifier extends ProcessorReifier<AggregateDefinition> {
             answer.setOptimisticLocking(parseBoolean(definition.getOptimisticLocking()));
         }
         if (definition.getCompletionPredicate() != null) {
-            Predicate predicate = definition.getCompletionPredicate().createPredicate(routeContext);
+            Predicate predicate = createPredicate(definition.getCompletionPredicate());
             answer.setCompletionPredicate(predicate);
         } else if (strategy instanceof Predicate) {
             // if aggregation strategy implements predicate and was not
@@ -121,7 +121,7 @@ public class AggregateReifier extends ProcessorReifier<AggregateDefinition> {
             answer.setCompletionPredicate((Predicate)strategy);
         }
         if (definition.getCompletionTimeoutExpression() != null) {
-            Expression expression = definition.getCompletionTimeoutExpression().createExpression(routeContext);
+            Expression expression = createExpression(definition.getCompletionTimeoutExpression());
             answer.setCompletionTimeoutExpression(expression);
         }
         if (definition.getCompletionTimeout() != null) {
@@ -131,7 +131,7 @@ public class AggregateReifier extends ProcessorReifier<AggregateDefinition> {
             answer.setCompletionInterval(parseLong(definition.getCompletionInterval()));
         }
         if (definition.getCompletionSizeExpression() != null) {
-            Expression expression = definition.getCompletionSizeExpression().createExpression(routeContext);
+            Expression expression = createExpression(definition.getCompletionSizeExpression());
             answer.setCompletionSizeExpression(expression);
         }
         if (definition.getCompletionSize() != null) {
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/CatchReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/CatchReifier.java
index f8a9ae5..82fbeb9 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/CatchReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/CatchReifier.java
@@ -56,7 +56,7 @@ public class CatchReifier extends ProcessorReifier<CatchDefinition> {
 
         Predicate when = null;
         if (definition.getOnWhen() != null) {
-            when = definition.getOnWhen().getExpression().createPredicate(routeContext);
+            when = createPredicate(definition.getOnWhen().getExpression());
         }
 
         return new CatchProcessor(definition.getExceptionClasses(), childProcessor, when, null);
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/DelayReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/DelayReifier.java
index 8109f5b..9c8a984 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/DelayReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/DelayReifier.java
@@ -22,7 +22,6 @@ import org.apache.camel.Expression;
 import org.apache.camel.Processor;
 import org.apache.camel.model.DelayDefinition;
 import org.apache.camel.model.ProcessorDefinition;
-import org.apache.camel.model.language.ExpressionDefinition;
 import org.apache.camel.processor.Delayer;
 import org.apache.camel.spi.RouteContext;
 
@@ -49,11 +48,7 @@ public class DelayReifier extends ExpressionReifier<DelayDefinition> {
     }
 
     private Expression createAbsoluteTimeDelayExpression() {
-        ExpressionDefinition expr = definition.getExpression();
-        if (expr != null) {
-            return expr.createExpression(routeContext);
-        }
-        return null;
+        return definition.getExpression() != null ? createExpression(definition.getExpression()) : null;
     }
 
 }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/DynamicRouterReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/DynamicRouterReifier.java
index 0acf744..015d6be 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/DynamicRouterReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/DynamicRouterReifier.java
@@ -34,7 +34,7 @@ public class DynamicRouterReifier extends ExpressionReifier<DynamicRouterDefinit
 
     @Override
     public Processor createProcessor() throws Exception {
-        Expression expression = definition.getExpression().createExpression(routeContext);
+        Expression expression = createExpression(definition.getExpression());
         String delimiter = definition.getUriDelimiter() != null ? definition.getUriDelimiter() : DynamicRouterDefinition.DEFAULT_DELIMITER;
 
         DynamicRouter dynamicRouter = new DynamicRouter(camelContext, expression, delimiter);
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/EnrichReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/EnrichReifier.java
index 2263a8f..09e8dfa 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/EnrichReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/EnrichReifier.java
@@ -34,7 +34,7 @@ public class EnrichReifier extends ExpressionReifier<EnrichDefinition> {
 
     @Override
     public Processor createProcessor() throws Exception {
-        Expression exp = definition.getExpression().createExpression(routeContext);
+        Expression exp = createExpression(definition.getExpression());
         boolean isShareUnitOfWork = definition.getShareUnitOfWork() != null && Boolean.parseBoolean(definition.getShareUnitOfWork());
         boolean isIgnoreInvalidEndpoint = definition.getIgnoreInvalidEndpoint() != null && Boolean.parseBoolean(definition.getIgnoreInvalidEndpoint());
 
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ExpressionReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ExpressionReifier.java
index 30772b6..548c0e8 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ExpressionReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ExpressionReifier.java
@@ -45,7 +45,7 @@ abstract class ExpressionReifier<T extends ExpressionNode> extends ProcessorReif
      * @return the created predicate
      */
     protected Predicate createPredicate() {
-        return definition.getExpression().createPredicate(routeContext);
+        return createPredicate(definition.getExpression());
     }
 
 }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/IdempotentConsumerReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/IdempotentConsumerReifier.java
index 6651036..7c5ae5c 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/IdempotentConsumerReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/IdempotentConsumerReifier.java
@@ -38,7 +38,7 @@ public class IdempotentConsumerReifier extends ExpressionReifier<IdempotentConsu
         IdempotentRepository idempotentRepository = resolveMessageIdRepository(routeContext);
         ObjectHelper.notNull(idempotentRepository, "idempotentRepository", definition);
 
-        Expression expression = definition.getExpression().createExpression(routeContext);
+        Expression expression = createExpression(definition.getExpression());
 
         // these boolean should be true by default
         boolean eager = definition.getEager() == null || Boolean.parseBoolean(definition.getEager());
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/LoopReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/LoopReifier.java
index 477d4be..ec5a8bc 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/LoopReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/LoopReifier.java
@@ -39,9 +39,9 @@ public class LoopReifier extends ExpressionReifier<LoopDefinition> {
         Predicate predicate = null;
         Expression expression = null;
         if (isWhile) {
-            predicate = definition.getExpression().createPredicate(routeContext);
+            predicate = createPredicate(definition.getExpression());
         } else {
-            expression = definition.getExpression().createExpression(routeContext);
+            expression = createExpression(definition.getExpression());
         }
         return new LoopProcessor(camelContext, output, expression, predicate, isCopy);
     }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/OnCompletionReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/OnCompletionReifier.java
index eb47895..19066fe 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/OnCompletionReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/OnCompletionReifier.java
@@ -72,7 +72,7 @@ public class OnCompletionReifier extends ProcessorReifier<OnCompletionDefinition
 
         Predicate when = null;
         if (definition.getOnWhen() != null) {
-            when = definition.getOnWhen().getExpression().createPredicate(routeContext);
+            when = createPredicate(definition.getOnWhen().getExpression());
         }
 
         boolean shutdownThreadPool = willCreateNewThreadPool(definition, isParallelProcessing);
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/OnExceptionReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/OnExceptionReifier.java
index 5f94c72..8f63f08 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/OnExceptionReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/OnExceptionReifier.java
@@ -100,12 +100,12 @@ public class OnExceptionReifier extends ProcessorReifier<OnExceptionDefinition>
 
         Predicate when = null;
         if (definition.getOnWhen() != null) {
-            when = definition.getOnWhen().getExpression().createPredicate(routeContext);
+            when = createPredicate(definition.getOnWhen().getExpression());
         }
 
         Predicate handle = null;
         if (definition.getHandled() != null) {
-            handle = definition.getHandled().createPredicate(routeContext);
+            handle = createPredicate(definition.getHandled());
         }
 
         return new CatchProcessor(classes, childProcessor, when, handle);
@@ -122,20 +122,23 @@ public class OnExceptionReifier extends ProcessorReifier<OnExceptionDefinition>
     }
 
     private void setHandledFromExpressionType() {
-        if (definition.getHandled() != null && definition.getHandledPolicy() == null && routeContext != null) {
-            definition.handled(definition.getHandled().createPredicate(routeContext));
+        // TODO: should not modify
+        if (definition.getHandled() != null && definition.getHandledPolicy() == null && camelContext != null) {
+            definition.handled(createPredicate(definition.getHandled()));
         }
     }
 
     private void setContinuedFromExpressionType() {
-        if (definition.getContinued() != null && definition.getContinuedPolicy() == null && routeContext != null) {
-            definition.continued(definition.getContinued().createPredicate(routeContext));
+        // TODO: should not modify
+        if (definition.getContinued() != null && definition.getContinuedPolicy() == null && camelContext != null) {
+            definition.continued(createPredicate(definition.getContinued()));
         }
     }
 
     private void setRetryWhileFromExpressionType() {
-        if (definition.getRetryWhile() != null && definition.getRetryWhilePolicy() == null && routeContext != null) {
-            definition.retryWhile(definition.getRetryWhile().createPredicate(routeContext));
+        // TODO: should not modify
+        if (definition.getRetryWhile() != null && definition.getRetryWhilePolicy() == null && camelContext != null) {
+            definition.retryWhile(createPredicate(definition.getRetryWhile()));
         }
     }
 
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/PollEnrichReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/PollEnrichReifier.java
index 05d8555..b13d4c3 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/PollEnrichReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/PollEnrichReifier.java
@@ -38,7 +38,7 @@ public class PollEnrichReifier extends ProcessorReifier<PollEnrichDefinition> {
         // if no timeout then we should block, and there use a negative timeout
         long time = definition.getTimeout() != null ? parseLong(definition.getTimeout()) : -1;
         boolean isIgnoreInvalidEndpoint = definition.getIgnoreInvalidEndpoint() != null && parseBoolean(definition.getIgnoreInvalidEndpoint());
-        Expression exp = definition.getExpression().createExpression(routeContext);
+        Expression exp = createExpression(definition.getExpression());
 
         PollEnricher enricher = new PollEnricher(exp, time);
 
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/RecipientListReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/RecipientListReifier.java
index 68cc91c..7ad3b7f 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/RecipientListReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/RecipientListReifier.java
@@ -43,7 +43,7 @@ public class RecipientListReifier extends ProcessorReifier<RecipientListDefiniti
 
     @Override
     public Processor createProcessor() throws Exception {
-        final Expression expression = definition.getExpression().createExpression(routeContext);
+        final Expression expression = createExpression(definition.getExpression());
 
         boolean isParallelProcessing = definition.getParallelProcessing() != null && parseBoolean(definition.getParallelProcessing());
         boolean isStreaming = definition.getStreaming() != null && parseBoolean(definition.getStreaming());
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ResequenceReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ResequenceReifier.java
index ca70fb1..5168421 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ResequenceReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ResequenceReifier.java
@@ -72,7 +72,7 @@ public class ResequenceReifier extends ProcessorReifier<ResequenceDefinition> {
     @SuppressWarnings("deprecation")
     protected Resequencer createBatchResequencer(RouteContext routeContext, BatchResequencerConfig config) throws Exception {
         Processor processor = this.createChildProcessor(true);
-        Expression expression = definition.getExpression().createExpression(routeContext);
+        Expression expression = createExpression(definition.getExpression());
 
         // and wrap in unit of work
         CamelInternalProcessor internal = new CamelInternalProcessor(camelContext, processor);
@@ -106,7 +106,7 @@ public class ResequenceReifier extends ProcessorReifier<ResequenceDefinition> {
      */
     protected StreamResequencer createStreamResequencer(RouteContext routeContext, StreamResequencerConfig config) throws Exception {
         Processor processor = this.createChildProcessor(true);
-        Expression expression = definition.getExpression().createExpression(routeContext);
+        Expression expression = createExpression(definition.getExpression());
 
         CamelInternalProcessor internal = new CamelInternalProcessor(camelContext, processor);
         internal.addAdvice(new CamelInternalProcessor.UnitOfWorkProcessorAdvice(routeContext, camelContext));
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/RoutingSlipReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/RoutingSlipReifier.java
index d1b5659..d5a39e0 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/RoutingSlipReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/RoutingSlipReifier.java
@@ -36,7 +36,7 @@ public class RoutingSlipReifier extends ExpressionReifier<RoutingSlipDefinition<
 
     @Override
     public Processor createProcessor() throws Exception {
-        Expression expression = definition.getExpression().createExpression(routeContext);
+        Expression expression = createExpression(definition.getExpression());
         String delimiter = definition.getUriDelimiter() != null ? definition.getUriDelimiter() : DEFAULT_DELIMITER;
 
         RoutingSlip routingSlip = new RoutingSlip(camelContext, expression, delimiter);
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ScriptReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ScriptReifier.java
index 36ad49f..e7f6568 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ScriptReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ScriptReifier.java
@@ -31,7 +31,7 @@ public class ScriptReifier extends ExpressionReifier<ScriptDefinition> {
 
     @Override
     public Processor createProcessor() throws Exception {
-        Expression expr = definition.getExpression().createExpression(routeContext);
+        Expression expr = createExpression(definition.getExpression());
         return new ScriptProcessor(expr);
     }
 }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/SetBodyReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/SetBodyReifier.java
index 2490e02..840bc37 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/SetBodyReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/SetBodyReifier.java
@@ -31,7 +31,7 @@ public class SetBodyReifier extends ExpressionReifier<SetBodyDefinition> {
 
     @Override
     public Processor createProcessor() throws Exception {
-        Expression expr = definition.getExpression().createExpression(routeContext);
+        Expression expr = createExpression(definition.getExpression());
         return new SetBodyProcessor(expr);
     }
 }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/SetHeaderReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/SetHeaderReifier.java
index bc26948..4214c73 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/SetHeaderReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/SetHeaderReifier.java
@@ -34,7 +34,7 @@ public class SetHeaderReifier extends ExpressionReifier<SetHeaderDefinition> {
     @Override
     public Processor createProcessor() throws Exception {
         ObjectHelper.notNull(definition.getName(), "headerName");
-        Expression expr = definition.getExpression().createExpression(routeContext);
+        Expression expr = createExpression(definition.getExpression());
         Expression nameExpr = ExpressionBuilder.parseSimpleOrFallbackToConstantExpression(definition.getName(), camelContext);
         return new SetHeaderProcessor(nameExpr, expr);
     }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/SetPropertyReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/SetPropertyReifier.java
index dd779bc..42da14b 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/SetPropertyReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/SetPropertyReifier.java
@@ -34,7 +34,7 @@ public class SetPropertyReifier extends ExpressionReifier<SetPropertyDefinition>
     @Override
     public Processor createProcessor() throws Exception {
         ObjectHelper.notNull(definition.getName(), "propertyName", this);
-        Expression expr = definition.getExpression().createExpression(routeContext);
+        Expression expr = createExpression(definition.getExpression());
         Expression nameExpr = ExpressionBuilder.parseSimpleOrFallbackToConstantExpression(definition.getName(), camelContext);
         return new SetPropertyProcessor(nameExpr, expr);
     }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/SortReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/SortReifier.java
index c7e30dd..dfbf103 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/SortReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/SortReifier.java
@@ -57,7 +57,7 @@ public class SortReifier<T, U extends SortDefinition<T>> extends ExpressionReifi
         if (definition.getExpression() == null) {
             exp = bodyExpression();
         } else {
-            exp = definition.getExpression().createExpression(routeContext);
+            exp = createExpression(definition.getExpression());
         }
         return new SortProcessor<T>(exp, definition.getComparator());
     }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/SplitReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/SplitReifier.java
index d678766..d532049 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/SplitReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/SplitReifier.java
@@ -57,7 +57,7 @@ public class SplitReifier extends ExpressionReifier<SplitDefinition> {
             definition.setOnPrepare(CamelContextHelper.mandatoryLookup(camelContext, definition.getOnPrepareRef(), Processor.class));
         }
 
-        Expression exp = definition.getExpression().createExpression(routeContext);
+        Expression exp = createExpression(definition.getExpression());
 
         Splitter answer = new Splitter(camelContext, exp, childProcessor, definition.getAggregationStrategy(), isParallelProcessing, threadPool,
                                        shutdownThreadPool, isStreaming, definition.isStopOnException(), timeout, definition.getOnPrepare(), isShareUnitOfWork, isParallelAggregate,
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ThrottleReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ThrottleReifier.java
index 7c69045..356772a 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ThrottleReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ThrottleReifier.java
@@ -22,7 +22,6 @@ import org.apache.camel.Expression;
 import org.apache.camel.Processor;
 import org.apache.camel.model.ProcessorDefinition;
 import org.apache.camel.model.ThrottleDefinition;
-import org.apache.camel.model.language.ExpressionDefinition;
 import org.apache.camel.processor.Throttler;
 import org.apache.camel.spi.RouteContext;
 
@@ -42,14 +41,14 @@ public class ThrottleReifier extends ExpressionReifier<ThrottleDefinition> {
         long period = definition.getTimePeriodMillis() != null ? definition.getTimePeriodMillis() : 1000L;
 
         // max requests per period is mandatory
-        Expression maxRequestsExpression = createMaxRequestsPerPeriodExpression(routeContext);
+        Expression maxRequestsExpression = createMaxRequestsPerPeriodExpression();
         if (maxRequestsExpression == null) {
             throw new IllegalArgumentException("MaxRequestsPerPeriod expression must be provided on " + this);
         }
 
         Expression correlation = null;
         if (definition.getCorrelationExpression() != null) {
-            correlation = definition.getCorrelationExpression().createExpression(routeContext);
+            correlation = createExpression(definition.getCorrelationExpression());
         }
 
         boolean reject = definition.getRejectExecution() != null && definition.getRejectExecution();
@@ -67,11 +66,7 @@ public class ThrottleReifier extends ExpressionReifier<ThrottleDefinition> {
     }
 
     private Expression createMaxRequestsPerPeriodExpression() {
-        ExpressionDefinition expr = definition.getExpression();
-        if (expr != null) {
-            return expr.createExpression(routeContext);
-        }
-        return null;
+        return definition.getExpression() != null ? createExpression(definition.getExpression()) : null;
     }
 
 }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/TransformReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/TransformReifier.java
index bc0de91..0532fc0 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/TransformReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/TransformReifier.java
@@ -31,7 +31,7 @@ public class TransformReifier extends ExpressionReifier<TransformDefinition> {
 
     @Override
     public Processor createProcessor() throws Exception {
-        Expression expr = definition.getExpression().createExpression(routeContext);
+        Expression expr = createExpression(definition.getExpression());
         return new TransformProcessor(expr);
     }
 }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ValidateReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ValidateReifier.java
index f6ab5fc..30fbeb3 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ValidateReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/ValidateReifier.java
@@ -31,7 +31,7 @@ public class ValidateReifier extends ExpressionReifier<ValidateDefinition> {
 
     @Override
     public Processor createProcessor() throws Exception {
-        Predicate pred = definition.getExpression().createPredicate(routeContext);
+        Predicate pred = createPredicate(definition.getExpression());
         return new PredicateValidatingProcessor(pred);
     }
 
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/WireTapReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/WireTapReifier.java
index b720c1a..e10bb92 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/WireTapReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/WireTapReifier.java
@@ -71,7 +71,7 @@ public class WireTapReifier extends ToDynamicReifier<WireTapDefinition<?>> {
             answer.addNewExchangeProcessor(definition.getNewExchangeProcessor());
         }
         if (definition.getNewExchangeExpression() != null) {
-            answer.setNewExchangeExpression(definition.getNewExchangeExpression().createExpression(routeContext));
+            answer.setNewExchangeExpression(createExpression(definition.getNewExchangeExpression()));
         }
         if (definition.getHeaders() != null && !definition.getHeaders().isEmpty()) {
             for (SetHeaderDefinition header : definition.getHeaders()) {
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/language/ExpressionReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/language/ExpressionReifier.java
new file mode 100644
index 0000000..3c905a2
--- /dev/null
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/language/ExpressionReifier.java
@@ -0,0 +1,200 @@
+/*
+ * 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.reifier.language;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.function.BiFunction;
+
+import org.apache.camel.AfterPropertiesConfigured;
+import org.apache.camel.CamelContext;
+import org.apache.camel.CamelContextAware;
+import org.apache.camel.Expression;
+import org.apache.camel.NoSuchLanguageException;
+import org.apache.camel.Predicate;
+import org.apache.camel.model.ExpressionSubElementDefinition;
+import org.apache.camel.model.language.ConstantExpression;
+import org.apache.camel.model.language.ExchangePropertyExpression;
+import org.apache.camel.model.language.ExpressionDefinition;
+import org.apache.camel.model.language.GroovyExpression;
+import org.apache.camel.model.language.HeaderExpression;
+import org.apache.camel.model.language.Hl7TerserExpression;
+import org.apache.camel.model.language.JsonPathExpression;
+import org.apache.camel.model.language.LanguageExpression;
+import org.apache.camel.model.language.MethodCallExpression;
+import org.apache.camel.model.language.MvelExpression;
+import org.apache.camel.model.language.OgnlExpression;
+import org.apache.camel.model.language.RefExpression;
+import org.apache.camel.model.language.SimpleExpression;
+import org.apache.camel.model.language.SpELExpression;
+import org.apache.camel.model.language.TokenizerExpression;
+import org.apache.camel.model.language.XMLTokenizerExpression;
+import org.apache.camel.model.language.XPathExpression;
+import org.apache.camel.model.language.XQueryExpression;
+import org.apache.camel.reifier.AbstractReifier;
+import org.apache.camel.spi.Language;
+import org.apache.camel.support.CamelContextHelper;
+import org.apache.camel.support.ExpressionToPredicateAdapter;
+import org.apache.camel.support.PropertyBindingSupport;
+import org.apache.camel.support.ScriptHelper;
+import org.apache.camel.util.ObjectHelper;
+
+public class ExpressionReifier<T extends ExpressionDefinition> extends AbstractReifier {
+
+    private static final Map<Class<?>, BiFunction<CamelContext, ExpressionDefinition, ExpressionReifier<? extends ExpressionDefinition>>> EXPRESSIONS;
+
+    static {
+        Map<Class<?>, BiFunction<CamelContext, ExpressionDefinition, ExpressionReifier<? extends ExpressionDefinition>>> map = new LinkedHashMap<>();
+        map.put(ConstantExpression.class, ExpressionReifier::new);
+        map.put(ExchangePropertyExpression.class, ExpressionReifier::new);
+        map.put(ExpressionDefinition.class, ExpressionReifier::new);
+        map.put(GroovyExpression.class, ExpressionReifier::new);
+        map.put(HeaderExpression.class, ExpressionReifier::new);
+        map.put(Hl7TerserExpression.class, ExpressionReifier::new);
+        map.put(JsonPathExpression.class, JsonPathExpressionReifier::new);
+        map.put(LanguageExpression.class, ExpressionReifier::new);
+        map.put(MethodCallExpression.class, MethodCallExpressionReifier::new);
+        map.put(MvelExpression.class, ExpressionReifier::new);
+        map.put(OgnlExpression.class, ExpressionReifier::new);
+        map.put(RefExpression.class, ExpressionReifier::new);
+        map.put(SimpleExpression.class, SimpleExpressionReifier::new);
+        map.put(SpELExpression.class, ExpressionReifier::new);
+        map.put(TokenizerExpression.class, TokenizerExpressionReifier::new);
+        map.put(XMLTokenizerExpression.class, XMLTokenizerExpressionReifier::new);
+        map.put(XPathExpression.class, XPathExpressionReifier::new);
+        map.put(XQueryExpression.class, XQueryExpressionReifier::new);
+        EXPRESSIONS = map;
+    }
+
+    protected final T definition;
+
+    public ExpressionReifier(CamelContext camelContext, T definition) {
+        super(camelContext);
+        this.definition = definition;
+    }
+
+    public static ExpressionReifier<? extends ExpressionDefinition> reifier(CamelContext camelContext, ExpressionSubElementDefinition definition) {
+        return reifier(camelContext, definition.getExpressionType());
+    }
+
+    public static ExpressionReifier<? extends ExpressionDefinition> reifier(CamelContext camelContext, ExpressionDefinition definition) {
+        BiFunction<CamelContext, ExpressionDefinition, ExpressionReifier<? extends ExpressionDefinition>> reifier = EXPRESSIONS.get(definition.getClass());
+        if (reifier != null) {
+            return reifier.apply(camelContext, definition);
+        }
+        throw new IllegalStateException("Unsupported definition: " + definition);
+    }
+
+    public Expression createExpression() {
+        Expression expression = definition.getExpressionValue();
+        if (expression == null) {
+            if (definition.getExpressionType() != null) {
+                expression = reifier(camelContext, definition.getExpressionType()).createExpression();
+            } else if (definition.getExpression() != null) {
+                ObjectHelper.notNull("language", definition.getLanguage());
+                Language language = camelContext.resolveLanguage(definition.getLanguage());
+                if (language == null) {
+                    throw new NoSuchLanguageException(definition.getLanguage());
+                }
+                String exp = CamelContextHelper.parseText(camelContext, definition.getExpression());
+                // should be true by default
+                boolean isTrim = definition.getTrim() == null || CamelContextHelper.parseBoolean(camelContext, definition.getTrim());
+                // trim if configured to trim
+                if (exp != null && isTrim) {
+                    exp = exp.trim();
+                }
+                // resolve the expression as it may be an external script from
+                // the classpath/file etc
+                exp = ScriptHelper.resolveOptionalExternalScript(camelContext, exp);
+                expression = language.createExpression(exp);
+                configureExpression(expression);
+            }
+        }
+        // inject CamelContext if its aware
+        if (expression instanceof CamelContextAware) {
+            ((CamelContextAware) expression).setCamelContext(camelContext);
+        }
+        return expression;
+    }
+
+    public Predicate createPredicate() {
+        Predicate predicate = definition.getPredicate();
+        if (predicate == null) {
+            if (definition.getExpressionType() != null) {
+                predicate = reifier(camelContext, definition.getExpressionType()).createPredicate();
+            } else if (definition.getExpressionValue() != null) {
+                predicate = new ExpressionToPredicateAdapter(definition.getExpressionValue());
+            } else if (definition.getExpression() != null) {
+                ObjectHelper.notNull("language", definition.getLanguage());
+                Language language = camelContext.resolveLanguage(definition.getLanguage());
+                if (language == null) {
+                    throw new NoSuchLanguageException(definition.getLanguage());
+                }
+                String exp = CamelContextHelper.parseText(camelContext, definition.getExpression());
+                // should be true by default
+                boolean isTrim = definition.getTrim() == null || CamelContextHelper.parseBoolean(camelContext, definition.getTrim());
+                // trim if configured to trim
+                if (exp != null && isTrim) {
+                    exp = exp.trim();
+                }
+                // resolve the expression as it may be an external script from
+                // the classpath/file etc
+                exp = ScriptHelper.resolveOptionalExternalScript(camelContext, exp);
+
+                predicate = language.createPredicate(exp);
+                configurePredicate(predicate);
+            }
+        }
+        // inject CamelContext if its aware
+        if (predicate instanceof CamelContextAware) {
+            ((CamelContextAware) predicate).setCamelContext(camelContext);
+        }
+        return predicate;
+    }
+
+    protected void configurePredicate(Predicate predicate) {
+        // allows to perform additional logic after the properties has been
+        // configured which may be needed
+        // in the various camel components outside camel-core
+        if (predicate instanceof AfterPropertiesConfigured) {
+            ((AfterPropertiesConfigured)predicate).afterPropertiesConfigured(camelContext);
+        }
+    }
+
+    protected void configureExpression(Expression expression) {
+        // allows to perform additional logic after the properties has been
+        // configured which may be needed
+        // in the various camel components outside camel-core
+        if (expression instanceof AfterPropertiesConfigured) {
+            ((AfterPropertiesConfigured)expression).afterPropertiesConfigured(camelContext);
+        }
+    }
+
+    protected void setProperties(Object target, Map<String, Object> properties) {
+        properties.entrySet().removeIf(e -> e.getValue() == null);
+        PropertyBindingSupport.build().bind(camelContext, target, properties);
+    }
+
+    protected Object or(Object a, Object b) {
+        return a != null ? a : b;
+    }
+
+    protected Object asRef(String s) {
+        return s != null ? s.startsWith("#") ? s : "#" + s : null;
+    }
+
+}
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/language/JsonPathExpressionReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/language/JsonPathExpressionReifier.java
new file mode 100644
index 0000000..ea59a1c
--- /dev/null
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/language/JsonPathExpressionReifier.java
@@ -0,0 +1,58 @@
+/*
+ * 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.reifier.language;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.Expression;
+import org.apache.camel.Predicate;
+import org.apache.camel.model.language.ExpressionDefinition;
+import org.apache.camel.model.language.JsonPathExpression;
+
+public class JsonPathExpressionReifier extends ExpressionReifier<JsonPathExpression> {
+
+    public JsonPathExpressionReifier(CamelContext camelContext, ExpressionDefinition definition) {
+        super(camelContext, (JsonPathExpression) definition);
+    }
+
+    @Override
+    protected void configureExpression(Expression expression) {
+        bindProperties(expression);
+        super.configureExpression(expression);
+    }
+
+    @Override
+    protected void configurePredicate(Predicate predicate) {
+        bindProperties(predicate);
+        super.configurePredicate(predicate);
+    }
+
+    private void bindProperties(Object target) {
+        Map<String, Object> properties = new HashMap<>();
+        properties.put("resultType", or(definition.getResultType(), definition.getResultTypeName()));
+        properties.put("suppressExceptions", definition.getSuppressExceptions());
+        properties.put("allowSimple", definition.getAllowSimple());
+        properties.put("allowEasyPredicate", definition.getAllowEasyPredicate());
+        properties.put("writeAsString", definition.getWriteAsString());
+        properties.put("headerName", definition.getHeaderName());
+        setProperties(target, properties);
+    }
+
+
+}
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/language/MethodCallExpressionReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/language/MethodCallExpressionReifier.java
new file mode 100644
index 0000000..cdc14a4
--- /dev/null
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/language/MethodCallExpressionReifier.java
@@ -0,0 +1,64 @@
+/*
+ * 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.reifier.language;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.camel.AfterPropertiesConfigured;
+import org.apache.camel.CamelContext;
+import org.apache.camel.Expression;
+import org.apache.camel.Predicate;
+import org.apache.camel.model.language.ExpressionDefinition;
+import org.apache.camel.model.language.MethodCallExpression;
+import org.apache.camel.spi.Language;
+
+public class MethodCallExpressionReifier extends ExpressionReifier<MethodCallExpression> {
+
+    public MethodCallExpressionReifier(CamelContext camelContext, ExpressionDefinition definition) {
+        super(camelContext, (MethodCallExpression) definition);
+    }
+
+    @Override
+    public Expression createExpression() {
+        // special for bean language where we need to configure it first
+        Language lan = camelContext.resolveLanguage("bean");
+        configureLanguage(lan);
+        // .. and create expression with null value as we use the configured
+        // properties instead
+        Expression exp = lan.createExpression(null);
+        if (exp instanceof AfterPropertiesConfigured) {
+            ((AfterPropertiesConfigured)exp).afterPropertiesConfigured(camelContext);
+        }
+        return exp;
+    }
+
+    protected void configureLanguage(Language language) {
+        Map<String, Object> properties = new HashMap<>();
+        properties.put("bean", definition.getInstance());
+        properties.put("beanType", or(definition.getBeanType(), definition.getBeanTypeName()));
+        properties.put("ref", definition.getRef());
+        properties.put("method", definition.getMethod());
+        setProperties(language, properties);
+    }
+
+    @Override
+    public Predicate createPredicate() {
+        return (Predicate) createExpression();
+    }
+
+}
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/language/SimpleExpressionReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/language/SimpleExpressionReifier.java
new file mode 100644
index 0000000..807c807
--- /dev/null
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/language/SimpleExpressionReifier.java
@@ -0,0 +1,54 @@
+/*
+ * 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.reifier.language;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.Expression;
+import org.apache.camel.Predicate;
+import org.apache.camel.builder.SimpleBuilder;
+import org.apache.camel.model.language.ExpressionDefinition;
+import org.apache.camel.model.language.SimpleExpression;
+import org.apache.camel.support.CamelContextHelper;
+
+public class SimpleExpressionReifier extends ExpressionReifier<SimpleExpression> {
+
+    public SimpleExpressionReifier(CamelContext camelContext, ExpressionDefinition definition) {
+        super(camelContext, (SimpleExpression) definition);
+    }
+
+    @Override
+    public Expression createExpression() {
+        String exp = parseString(definition.getExpression());
+        // should be true by default
+        boolean isTrim = definition.getTrim() == null || parseBoolean(definition.getTrim());
+        if (exp != null && isTrim) {
+            exp = exp.trim();
+        }
+
+        SimpleBuilder answer = new SimpleBuilder(exp);
+        answer.setResultType(CamelContextHelper.convertTo(camelContext, Class.class,
+                or(definition.getResultType(), definition.getResultTypeName())));
+        return answer;
+    }
+
+    @Override
+    public Predicate createPredicate() {
+        // SimpleBuilder is also a Predicate
+        return (Predicate) createExpression();
+    }
+
+}
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/language/TokenizerExpressionReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/language/TokenizerExpressionReifier.java
new file mode 100644
index 0000000..ff49e62
--- /dev/null
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/language/TokenizerExpressionReifier.java
@@ -0,0 +1,73 @@
+/*
+ * 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.reifier.language;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.Expression;
+import org.apache.camel.Predicate;
+import org.apache.camel.language.tokenizer.TokenizeLanguage;
+import org.apache.camel.model.language.ExpressionDefinition;
+import org.apache.camel.model.language.TokenizerExpression;
+import org.apache.camel.support.ExpressionToPredicateAdapter;
+
+public class TokenizerExpressionReifier extends ExpressionReifier<TokenizerExpression> {
+
+    public TokenizerExpressionReifier(CamelContext camelContext, ExpressionDefinition definition) {
+        super(camelContext, (TokenizerExpression) definition);
+    }
+
+    @Override
+    public Expression createExpression() {
+        // special for new line tokens, if defined from XML then its 2
+        // characters, so we replace that back to a single char
+        String token = definition.getToken();
+        if (token.startsWith("\\n")) {
+            token = '\n' + token.substring(2);
+        }
+
+        TokenizeLanguage language = new TokenizeLanguage();
+        language.setToken(parseString(token));
+        language.setEndToken(parseString(definition.getEndToken()));
+        language.setInheritNamespaceTagName(parseString(definition.getInheritNamespaceTagName()));
+        language.setHeaderName(parseString(definition.getHeaderName()));
+        language.setGroupDelimiter(parseString(definition.getGroupDelimiter()));
+        if (definition.getRegex() != null) {
+            language.setRegex(parseBoolean(definition.getRegex()));
+        }
+        if (definition.getXml() != null) {
+            language.setXml(parseBoolean(definition.getXml()));
+        }
+        if (definition.getIncludeTokens() != null) {
+            language.setIncludeTokens(parseBoolean(definition.getIncludeTokens()));
+        }
+        if (definition.getGroup() != null && !"0".equals(definition.getGroup())) {
+            language.setGroup(parseString(definition.getGroup()));
+        }
+
+        if (definition.getSkipFirst() != null) {
+            language.setSkipFirst(parseBoolean(definition.getSkipFirst()));
+        }
+        return language.createExpression();
+    }
+
+    @Override
+    public Predicate createPredicate() {
+        Expression exp = createExpression();
+        return ExpressionToPredicateAdapter.toPredicate(exp);
+    }
+
+}
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/language/XMLTokenizerExpressionReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/language/XMLTokenizerExpressionReifier.java
new file mode 100644
index 0000000..7595951
--- /dev/null
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/language/XMLTokenizerExpressionReifier.java
@@ -0,0 +1,66 @@
+/*
+ * 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.reifier.language;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.Expression;
+import org.apache.camel.Predicate;
+import org.apache.camel.model.language.ExpressionDefinition;
+import org.apache.camel.model.language.JsonPathExpression;
+import org.apache.camel.model.language.XMLTokenizerExpression;
+import org.apache.camel.spi.NamespaceAware;
+
+public class XMLTokenizerExpressionReifier extends ExpressionReifier<XMLTokenizerExpression> {
+
+    public XMLTokenizerExpressionReifier(CamelContext camelContext, ExpressionDefinition definition) {
+        super(camelContext, (XMLTokenizerExpression) definition);
+    }
+
+    @Override
+    protected void configureExpression(Expression expression) {
+        bindProperties(expression);
+        configureNamespaceAware(expression);
+        super.configureExpression(expression);
+    }
+
+    @Override
+    protected void configurePredicate(Predicate predicate) {
+        bindProperties(predicate);
+        configureNamespaceAware(predicate);
+        super.configurePredicate(predicate);
+    }
+
+    protected void configureNamespaceAware(Object builder) {
+        if (definition.getNamespaces() != null && builder instanceof NamespaceAware) {
+            NamespaceAware namespaceAware = (NamespaceAware)builder;
+            namespaceAware.setNamespaces(definition.getNamespaces());
+        }
+    }
+
+    protected void bindProperties(Object target) {
+        Map<String, Object> properties = new HashMap<>();
+        properties.put("headerName", definition.getHeaderName());
+        properties.put("mode", definition.getMode());
+        properties.put("group", definition.getGroup());
+        setProperties(target, properties);
+    }
+
+
+}
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/language/XPathExpressionReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/language/XPathExpressionReifier.java
new file mode 100644
index 0000000..8737a07
--- /dev/null
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/language/XPathExpressionReifier.java
@@ -0,0 +1,69 @@
+/*
+ * 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.reifier.language;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.Expression;
+import org.apache.camel.Predicate;
+import org.apache.camel.model.language.ExpressionDefinition;
+import org.apache.camel.model.language.XPathExpression;
+import org.apache.camel.spi.NamespaceAware;
+
+public class XPathExpressionReifier extends ExpressionReifier<XPathExpression> {
+
+    public XPathExpressionReifier(CamelContext camelContext, ExpressionDefinition definition) {
+        super(camelContext, (XPathExpression) definition);
+    }
+
+    @Override
+    protected void configureExpression(Expression expression) {
+        bindProperties(expression);
+        configureNamespaceAware(expression);
+        super.configureExpression(expression);
+    }
+
+    @Override
+    protected void configurePredicate(Predicate predicate) {
+        bindProperties(predicate);
+        configureNamespaceAware(predicate);
+        super.configurePredicate(predicate);
+    }
+
+    protected void configureNamespaceAware(Object builder) {
+        if (definition.getNamespaces() != null && builder instanceof NamespaceAware) {
+            NamespaceAware namespaceAware = (NamespaceAware)builder;
+            namespaceAware.setNamespaces(definition.getNamespaces());
+        }
+    }
+
+    protected void bindProperties(Object target) {
+        Map<String, Object> properties = new HashMap<>();
+        properties.put("documentType", or(definition.getDocumentType(), definition.getDocumentTypeName()));
+        properties.put("resultType", or(definition.getResultType(), definition.getResultTypeName()));
+        properties.put("useSaxon", definition.getSaxon());
+        properties.put("xPathFactory", or(definition.getXPathFactory(), asRef(definition.getFactoryRef())));
+        properties.put("objectModelUri", definition.getObjectModel());
+        properties.put("threadSafety", definition.getThreadSafety());
+        properties.put("logNamespaces", definition.getLogNamespaces());
+        properties.put("headerName", definition.getHeaderName());
+        setProperties(target, properties);
+    }
+
+}
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/language/XQueryExpressionReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/language/XQueryExpressionReifier.java
new file mode 100644
index 0000000..f74d74f
--- /dev/null
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/language/XQueryExpressionReifier.java
@@ -0,0 +1,63 @@
+/*
+ * 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.reifier.language;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.Expression;
+import org.apache.camel.Predicate;
+import org.apache.camel.model.language.ExpressionDefinition;
+import org.apache.camel.model.language.XQueryExpression;
+import org.apache.camel.spi.NamespaceAware;
+
+public class XQueryExpressionReifier extends ExpressionReifier<XQueryExpression> {
+
+    public XQueryExpressionReifier(CamelContext camelContext, ExpressionDefinition definition) {
+        super(camelContext, (XQueryExpression) definition);
+    }
+
+    @Override
+    protected void configureExpression(Expression expression) {
+        bindProperties(expression);
+        configureNamespaceAware(expression);
+        super.configureExpression(expression);
+    }
+
+    @Override
+    protected void configurePredicate(Predicate predicate) {
+        bindProperties(predicate);
+        configureNamespaceAware(predicate);
+        super.configurePredicate(predicate);
+    }
+
+    protected void configureNamespaceAware(Object builder) {
+        if (definition.getNamespaces() != null && builder instanceof NamespaceAware) {
+            NamespaceAware namespaceAware = (NamespaceAware)builder;
+            namespaceAware.setNamespaces(definition.getNamespaces());
+        }
+    }
+
+    protected void bindProperties(Object target) {
+        Map<String, Object> properties = new HashMap<>();
+        properties.put("resultType", or(definition.getResultType(), definition.getType()));
+        properties.put("headerName", definition.getHeaderName());
+        setProperties(target, properties);
+    }
+
+}
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/loadbalancer/StickyLoadBalancerReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/loadbalancer/StickyLoadBalancerReifier.java
index a05102f..f908307 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/loadbalancer/StickyLoadBalancerReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/loadbalancer/StickyLoadBalancerReifier.java
@@ -30,7 +30,7 @@ public class StickyLoadBalancerReifier extends LoadBalancerReifier<StickyLoadBal
 
     @Override
     public LoadBalancer createLoadBalancer() {
-        return new StickyLoadBalancer(definition.getCorrelationExpression().createExpression(routeContext));
+        return new StickyLoadBalancer(createExpression(definition.getCorrelationExpression()));
     }
 
 }

Reply | Threaded
Open this post in threaded view
|

[camel] 06/18: Add hand-written property configurers for languages

Guillaume Nodet-2
In reply to this post by Guillaume Nodet-2
This is an automated email from the ASF dual-hosted git repository.

gnodet pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit ce995a75b31b30f5b81d153814b46c87fc1b5e92
Author: Guillaume Nodet <[hidden email]>
AuthorDate: Mon Feb 10 21:49:20 2020 +0100

    Add hand-written property configurers for languages
---
 .../apache/camel/language/bean/BeanLanguage.java   | 20 ++++++++++++-
 .../apache/camel/jsonpath/JsonPathExpression.java  | 29 ++++++++++++++++++-
 .../camel/component/xquery/XQueryBuilder.java      | 19 +++++++++++--
 .../apache/camel/language/xpath/XPathBuilder.java  | 31 +++++++++++++++++++-
 .../camel/reifier/language/ExpressionReifier.java  | 13 ++++++++-
 .../support/ExpressionToPredicateAdapter.java      | 16 ++++++++++-
 .../xtokenizer/XMLTokenExpressionIterator.java     | 33 +++++++++++++++++++---
 .../language/xtokenizer/XMLTokenizeLanguage.java   |  2 +-
 8 files changed, 151 insertions(+), 12 deletions(-)

diff --git a/components/camel-bean/src/main/java/org/apache/camel/language/bean/BeanLanguage.java b/components/camel-bean/src/main/java/org/apache/camel/language/bean/BeanLanguage.java
index a230806..93192a4 100644
--- a/components/camel-bean/src/main/java/org/apache/camel/language/bean/BeanLanguage.java
+++ b/components/camel-bean/src/main/java/org/apache/camel/language/bean/BeanLanguage.java
@@ -16,10 +16,13 @@
  */
 package org.apache.camel.language.bean;
 
+import org.apache.camel.CamelContext;
 import org.apache.camel.Expression;
 import org.apache.camel.Predicate;
+import org.apache.camel.spi.GeneratedPropertyConfigurer;
 import org.apache.camel.support.ExpressionToPredicateAdapter;
 import org.apache.camel.support.LanguageSupport;
+import org.apache.camel.support.component.PropertyConfigurerSupport;
 import org.apache.camel.util.StringHelper;
 
 /**
@@ -36,7 +39,7 @@ import org.apache.camel.util.StringHelper;
  * its classname or the bean itself.
  */
 @org.apache.camel.spi.annotations.Language("bean")
-public class BeanLanguage extends LanguageSupport {
+public class BeanLanguage extends LanguageSupport implements GeneratedPropertyConfigurer {
 
     private Object bean;
     private Class<?> beanType;
@@ -46,6 +49,21 @@ public class BeanLanguage extends LanguageSupport {
     public BeanLanguage() {
     }
 
+    @Override
+    public boolean configure(CamelContext camelContext, Object target, String name, Object value, boolean ignoreCase) {
+        if (target != this) {
+            throw new IllegalStateException("Can only configure our own instance !");
+        }
+        switch (ignoreCase ? name.toLowerCase() : name) {
+            case "bean": setBean(PropertyConfigurerSupport.property(camelContext, Object.class, value)); return true;
+            case "beantype":
+            case "beanType": setBeanType(PropertyConfigurerSupport.property(camelContext, Class.class, value)); return true;
+            case "ref": setRef(PropertyConfigurerSupport.property(camelContext, String.class, value)); return true;
+            case "method": setMethod(PropertyConfigurerSupport.property(camelContext, String.class, value)); return true;
+            default: return false;
+        }
+    }
+
     public Object getBean() {
         return bean;
     }
diff --git a/components/camel-jsonpath/src/main/java/org/apache/camel/jsonpath/JsonPathExpression.java b/components/camel-jsonpath/src/main/java/org/apache/camel/jsonpath/JsonPathExpression.java
index e6c85a1..49e6fa6 100644
--- a/components/camel-jsonpath/src/main/java/org/apache/camel/jsonpath/JsonPathExpression.java
+++ b/components/camel-jsonpath/src/main/java/org/apache/camel/jsonpath/JsonPathExpression.java
@@ -26,11 +26,16 @@ import org.apache.camel.Exchange;
 import org.apache.camel.ExpressionEvaluationException;
 import org.apache.camel.ExpressionIllegalSyntaxException;
 import org.apache.camel.jsonpath.easypredicate.EasyPredicateParser;
+import org.apache.camel.spi.GeneratedPropertyConfigurer;
+import org.apache.camel.spi.Metadata;
+import org.apache.camel.spi.PropertyConfigurer;
+import org.apache.camel.spi.PropertyConfigurerAware;
 import org.apache.camel.support.ExpressionAdapter;
+import org.apache.camel.support.component.PropertyConfigurerSupport;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class JsonPathExpression extends ExpressionAdapter implements AfterPropertiesConfigured {
+public class JsonPathExpression extends ExpressionAdapter implements AfterPropertiesConfigured, GeneratedPropertyConfigurer {
 
     private static final Logger LOG = LoggerFactory.getLogger(JsonPathExpression.class);
 
@@ -50,6 +55,28 @@ public class JsonPathExpression extends ExpressionAdapter implements AfterProper
         this.expression = expression;
     }
 
+    @Override
+    public boolean configure(CamelContext camelContext, Object target, String name, Object value, boolean ignoreCase) {
+        if (target != this) {
+            throw new IllegalStateException("Can only configure our own instance !");
+        }
+        switch (ignoreCase ? name.toLowerCase() : name) {
+            case "resulttype":
+            case "resultType": setResultType(PropertyConfigurerSupport.property(camelContext, Class.class, value)); return true;
+            case "suppressexceptions":
+            case "suppressExceptions": setSuppressExceptions(PropertyConfigurerSupport.property(camelContext, Boolean.class, value)); return true;
+            case "allowsimple":
+            case "allowSimple": setAllowSimple(PropertyConfigurerSupport.property(camelContext, Boolean.class, value)); return true;
+            case "alloweasypredicate":
+            case "allowEasyPredicate": setAllowEasyPredicate(PropertyConfigurerSupport.property(camelContext, Boolean.class, value)); return true;
+            case "writeasstring":
+            case "writeAsString": setWriteAsString(PropertyConfigurerSupport.property(camelContext, Boolean.class, value)); return true;
+            case "headername":
+            case "headerName": setHeaderName(PropertyConfigurerSupport.property(camelContext, String.class, value)); return true;
+            default: return false;
+        }
+    }
+
     public boolean isPredicate() {
         return predicate;
     }
diff --git a/components/camel-saxon/src/main/java/org/apache/camel/component/xquery/XQueryBuilder.java b/components/camel-saxon/src/main/java/org/apache/camel/component/xquery/XQueryBuilder.java
index 19dc3fe..5e95d06 100644
--- a/components/camel-saxon/src/main/java/org/apache/camel/component/xquery/XQueryBuilder.java
+++ b/components/camel-saxon/src/main/java/org/apache/camel/component/xquery/XQueryBuilder.java
@@ -45,7 +45,6 @@ import org.w3c.dom.Node;
 import net.sf.saxon.Configuration;
 import net.sf.saxon.lib.ModuleURIResolver;
 import net.sf.saxon.om.AllElementsSpaceStrippingRule;
-import net.sf.saxon.om.DocumentInfo;
 import net.sf.saxon.om.IgnorableSpaceStrippingRule;
 import net.sf.saxon.om.Item;
 import net.sf.saxon.om.SequenceIterator;
@@ -62,6 +61,7 @@ import net.sf.saxon.value.Int64Value;
 import net.sf.saxon.value.IntegerValue;
 import net.sf.saxon.value.ObjectValue;
 import net.sf.saxon.value.StringValue;
+import org.apache.camel.CamelContext;
 import org.apache.camel.Exchange;
 import org.apache.camel.Expression;
 import org.apache.camel.Message;
@@ -69,8 +69,10 @@ import org.apache.camel.NoTypeConversionAvailableException;
 import org.apache.camel.Predicate;
 import org.apache.camel.Processor;
 import org.apache.camel.RuntimeExpressionException;
+import org.apache.camel.spi.GeneratedPropertyConfigurer;
 import org.apache.camel.spi.NamespaceAware;
 import org.apache.camel.support.MessageHelper;
+import org.apache.camel.support.component.PropertyConfigurerSupport;
 import org.apache.camel.util.IOHelper;
 import org.apache.camel.util.ObjectHelper;
 import org.apache.camel.util.xml.BytesSource;
@@ -83,7 +85,7 @@ import org.slf4j.LoggerFactory;
  * <p/>
  * The XQueryExpression, as you would expect, can be executed repeatedly, as often as you want, in the same or in different threads.
  */
-public abstract class XQueryBuilder implements Expression, Predicate, NamespaceAware, Processor {
+public abstract class XQueryBuilder implements Expression, Predicate, NamespaceAware, Processor, GeneratedPropertyConfigurer {
     private static final Logger LOG = LoggerFactory.getLogger(XQueryBuilder.class);
     private Configuration configuration;
     private Map<String, Object> configurationProperties = new HashMap<>();
@@ -101,6 +103,19 @@ public abstract class XQueryBuilder implements Expression, Predicate, NamespaceA
     private String headerName;
 
     @Override
+    public boolean configure(CamelContext camelContext, Object target, String name, Object value, boolean ignoreCase) {
+        if (target != this) {
+            throw new IllegalStateException("Can only configure our own instance !");
+        }
+        switch (ignoreCase ? name.toLowerCase() : name) {
+            case "resulttype":
+            case "resultType": setResultType(PropertyConfigurerSupport.property(camelContext, Class.class, value)); return true;
+            case "headername":
+            case "headerName": setHeaderName(PropertyConfigurerSupport.property(camelContext, String.class, value)); return true;
+            default: return false;
+        }
+    }
+    @Override
     public String toString() {
         return "XQuery[" + expression + "]";
     }
diff --git a/components/camel-xpath/src/main/java/org/apache/camel/language/xpath/XPathBuilder.java b/components/camel-xpath/src/main/java/org/apache/camel/language/xpath/XPathBuilder.java
index 080bfaa..2d21048 100644
--- a/components/camel-xpath/src/main/java/org/apache/camel/language/xpath/XPathBuilder.java
+++ b/components/camel-xpath/src/main/java/org/apache/camel/language/xpath/XPathBuilder.java
@@ -57,6 +57,7 @@ import org.apache.camel.RuntimeCamelException;
 import org.apache.camel.RuntimeExpressionException;
 import org.apache.camel.WrappedFile;
 import org.apache.camel.spi.ExpressionResultTypeAware;
+import org.apache.camel.spi.GeneratedPropertyConfigurer;
 import org.apache.camel.spi.Language;
 import org.apache.camel.spi.NamespaceAware;
 import org.apache.camel.support.DefaultExchange;
@@ -64,6 +65,7 @@ import org.apache.camel.support.ExchangeHelper;
 import org.apache.camel.support.MessageHelper;
 import org.apache.camel.support.builder.Namespaces;
 import org.apache.camel.support.builder.xml.XMLConverterHelper;
+import org.apache.camel.support.component.PropertyConfigurerSupport;
 import org.apache.camel.support.service.ServiceSupport;
 import org.apache.camel.util.IOHelper;
 import org.apache.camel.util.ObjectHelper;
@@ -96,7 +98,8 @@ import static org.apache.camel.support.builder.Namespaces.isMatchingNamespaceOrE
  *
  * @see XPathConstants#NODESET
  */
-public class XPathBuilder extends ServiceSupport implements CamelContextAware, Expression, Predicate, NamespaceAware, ExpressionResultTypeAware {
+public class XPathBuilder extends ServiceSupport implements CamelContextAware, Expression, Predicate,
+        NamespaceAware, ExpressionResultTypeAware, GeneratedPropertyConfigurer {
     private static final Logger LOG = LoggerFactory.getLogger(XPathBuilder.class);
     private static final String SAXON_OBJECT_MODEL_URI = "http://saxon.sf.net/jaxp/xpath/om";
     private static final String SAXON_FACTORY_CLASS_NAME = "net.sf.saxon.xpath.XPathFactoryImpl";
@@ -168,6 +171,32 @@ public class XPathBuilder extends ServiceSupport implements CamelContextAware, E
     }
 
     @Override
+    public boolean configure(CamelContext camelContext, Object target, String name, Object value, boolean ignoreCase) {
+        if (target != this) {
+            throw new IllegalStateException("Can only configure our own instance !");
+        }
+        switch (ignoreCase ? name.toLowerCase() : name) {
+            case "documenttype":
+            case "documentType": setDocumentType(PropertyConfigurerSupport.property(camelContext, Class.class, value)); return true;
+            case "resulttype":
+            case "resultType": setResultType(PropertyConfigurerSupport.property(camelContext, Class.class, value)); return true;
+            case "usesaxon":
+            case "useSaxon": setUseSaxon(PropertyConfigurerSupport.property(camelContext, Boolean.class, value)); return true;
+            case "xpathfactory":
+            case "xPathFactory": setXPathFactory(PropertyConfigurerSupport.property(camelContext, XPathFactory.class, value)); return true;
+            case "objectmodeluri":
+            case "objectModelUri": setObjectModelUri(PropertyConfigurerSupport.property(camelContext, String.class, value)); return true;
+            case "threadsafety":
+            case "threadSafety": setThreadSafety(PropertyConfigurerSupport.property(camelContext, Boolean.class, value)); return true;
+            case "lognamespaces":
+            case "logNamespaces": setLogNamespaces(PropertyConfigurerSupport.property(camelContext, Boolean.class, value)); return true;
+            case "headername":
+            case "headerName": setHeaderName(PropertyConfigurerSupport.property(camelContext, String.class, value)); return true;
+            default: return false;
+        }
+    }
+
+    @Override
     public String toString() {
         return "XPath: " + text;
     }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/language/ExpressionReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/language/ExpressionReifier.java
index 3c905a2..3b63184 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/language/ExpressionReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/language/ExpressionReifier.java
@@ -47,6 +47,8 @@ import org.apache.camel.model.language.XPathExpression;
 import org.apache.camel.model.language.XQueryExpression;
 import org.apache.camel.reifier.AbstractReifier;
 import org.apache.camel.spi.Language;
+import org.apache.camel.spi.PropertyConfigurer;
+import org.apache.camel.spi.PropertyConfigurerAware;
 import org.apache.camel.support.CamelContextHelper;
 import org.apache.camel.support.ExpressionToPredicateAdapter;
 import org.apache.camel.support.PropertyBindingSupport;
@@ -186,7 +188,16 @@ public class ExpressionReifier<T extends ExpressionDefinition> extends AbstractR
 
     protected void setProperties(Object target, Map<String, Object> properties) {
         properties.entrySet().removeIf(e -> e.getValue() == null);
-        PropertyBindingSupport.build().bind(camelContext, target, properties);
+
+        PropertyConfigurer configurer = null;
+        if (target instanceof PropertyConfigurerAware) {
+            configurer = ((PropertyConfigurerAware) target).getPropertyConfigurer(target);
+        } else if (target instanceof PropertyConfigurer) {
+            configurer = (PropertyConfigurer) target;
+        }
+        PropertyBindingSupport.build()
+                .withConfigurer(configurer)
+                .bind(camelContext, target, properties);
     }
 
     protected Object or(Object a, Object b) {
diff --git a/core/camel-support/src/main/java/org/apache/camel/support/ExpressionToPredicateAdapter.java b/core/camel-support/src/main/java/org/apache/camel/support/ExpressionToPredicateAdapter.java
index 027a971..7ef3bca 100644
--- a/core/camel-support/src/main/java/org/apache/camel/support/ExpressionToPredicateAdapter.java
+++ b/core/camel-support/src/main/java/org/apache/camel/support/ExpressionToPredicateAdapter.java
@@ -21,12 +21,15 @@ import org.apache.camel.CamelContextAware;
 import org.apache.camel.Exchange;
 import org.apache.camel.Expression;
 import org.apache.camel.Predicate;
+import org.apache.camel.spi.GeneratedPropertyConfigurer;
+import org.apache.camel.spi.PropertyConfigurer;
+import org.apache.camel.spi.PropertyConfigurerAware;
 import org.apache.camel.util.ObjectHelper;
 
 /**
  * To adapt {@link org.apache.camel.Expression} as a {@link Predicate}
  */
-public final class ExpressionToPredicateAdapter implements Predicate, CamelContextAware {
+public final class ExpressionToPredicateAdapter implements Predicate, CamelContextAware, PropertyConfigurerAware {
     private final Expression expression;
 
     public ExpressionToPredicateAdapter(Expression expression) {
@@ -70,4 +73,15 @@ public final class ExpressionToPredicateAdapter implements Predicate, CamelConte
             return null;
         }
     }
+
+    @Override
+    public PropertyConfigurer getPropertyConfigurer(Object instance) {
+        if (expression instanceof PropertyConfigurer) {
+            return (PropertyConfigurer) expression;
+        } else if (expression instanceof PropertyConfigurerAware) {
+            return ((PropertyConfigurerAware) expression).getPropertyConfigurer(expression);
+        } else {
+            return null;
+        }
+    }
 }
\ No newline at end of file
diff --git a/core/camel-xml-jaxp/src/main/java/org/apache/camel/language/xtokenizer/XMLTokenExpressionIterator.java b/core/camel-xml-jaxp/src/main/java/org/apache/camel/language/xtokenizer/XMLTokenExpressionIterator.java
index a33b89c..36c830b 100644
--- a/core/camel-xml-jaxp/src/main/java/org/apache/camel/language/xtokenizer/XMLTokenExpressionIterator.java
+++ b/core/camel-xml-jaxp/src/main/java/org/apache/camel/language/xtokenizer/XMLTokenExpressionIterator.java
@@ -39,12 +39,15 @@ import javax.xml.stream.XMLStreamConstants;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
 
+import org.apache.camel.CamelContext;
 import org.apache.camel.Exchange;
 import org.apache.camel.InvalidPayloadException;
 import org.apache.camel.converter.jaxp.StaxConverter;
+import org.apache.camel.spi.GeneratedPropertyConfigurer;
 import org.apache.camel.spi.NamespaceAware;
 import org.apache.camel.support.ExchangeHelper;
 import org.apache.camel.support.ExpressionAdapter;
+import org.apache.camel.support.component.PropertyConfigurerSupport;
 import org.apache.camel.util.IOHelper;
 import org.apache.camel.util.ObjectHelper;
 import org.apache.camel.util.StringHelper;
@@ -54,18 +57,18 @@ import org.slf4j.LoggerFactory;
 /**
  * An {@link org.apache.camel.language.xtokenizer.XMLTokenizeLanguage} based iterator.
  */
-public class XMLTokenExpressionIterator extends ExpressionAdapter implements NamespaceAware {
-    protected final String headerName;
+public class XMLTokenExpressionIterator extends ExpressionAdapter implements NamespaceAware, GeneratedPropertyConfigurer {
     protected final String path;
     protected char mode;
     protected int group;
+    protected String headerName;
     protected Map<String, String> nsmap;
 
     public XMLTokenExpressionIterator(String path, char mode) {
-        this(null, path, mode, 1);
+        this(path, mode, 1, null);
     }
 
-    public XMLTokenExpressionIterator(String headerName, String path, char mode, int group) {
+    public XMLTokenExpressionIterator(String path, char mode, int group, String headerName) {
         StringHelper.notEmpty(path, "path");
         this.headerName = headerName;
         this.path = path;
@@ -74,6 +77,20 @@ public class XMLTokenExpressionIterator extends ExpressionAdapter implements Nam
     }
 
     @Override
+    public boolean configure(CamelContext camelContext, Object target, String name, Object value, boolean ignoreCase) {
+        if (target != this) {
+            throw new IllegalStateException("Can only configure our own instance !");
+        }
+        switch (ignoreCase ? name.toLowerCase() : name) {
+            case "headername":
+            case "headerName": setHeaderName(PropertyConfigurerSupport.property(camelContext, String.class, value)); return true;
+            case "mode": setMode(PropertyConfigurerSupport.property(camelContext, String.class, value)); return true;
+            case "group": setGroup(PropertyConfigurerSupport.property(camelContext, Integer.class, value)); return true;
+            default: return false;
+        }
+    }
+
+    @Override
     public void setNamespaces(Map<String, String> nsmap) {
         this.nsmap = nsmap;
     }
@@ -99,6 +116,14 @@ public class XMLTokenExpressionIterator extends ExpressionAdapter implements Nam
         this.group = group;
     }
 
+    public String getHeaderName() {
+        return headerName;
+    }
+
+    public void setHeaderName(String headerName) {
+        this.headerName = headerName;
+    }
+
     protected Iterator<?> createIterator(InputStream in, String charset) throws XMLStreamException, UnsupportedEncodingException {
         return createIterator(new InputStreamReader(in, charset));
     }
diff --git a/core/camel-xml-jaxp/src/main/java/org/apache/camel/language/xtokenizer/XMLTokenizeLanguage.java b/core/camel-xml-jaxp/src/main/java/org/apache/camel/language/xtokenizer/XMLTokenizeLanguage.java
index b57c952..e873eb2 100644
--- a/core/camel-xml-jaxp/src/main/java/org/apache/camel/language/xtokenizer/XMLTokenizeLanguage.java
+++ b/core/camel-xml-jaxp/src/main/java/org/apache/camel/language/xtokenizer/XMLTokenizeLanguage.java
@@ -80,7 +80,7 @@ public class XMLTokenizeLanguage extends LanguageSupport {
     public Expression createExpression(String expression) {
         String path = expression != null ? expression : this.path;
         ObjectHelper.notNull(path, "path");
-        XMLTokenExpressionIterator expr = new XMLTokenExpressionIterator(headerName, path, mode, group);
+        XMLTokenExpressionIterator expr = new XMLTokenExpressionIterator(path, mode, group, headerName);
         if (namespaces != null) {
             expr.setNamespaces(namespaces.getNamespaces());
         }

Reply | Threaded
Open this post in threaded view
|

[camel] 07/18: Fix support for extra properties on dataformat

Guillaume Nodet-2
In reply to this post by Guillaume Nodet-2
This is an automated email from the ASF dual-hosted git repository.

gnodet pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit ab60f402cb35f4d0c9ce7c986e7a099857ea54b4
Author: Guillaume Nodet <[hidden email]>
AuthorDate: Tue Feb 11 06:34:21 2020 +0100

    Fix support for extra properties on dataformat
---
 .../org/apache/camel/reifier/AbstractReifier.java  | 34 ++++++++++++++++++++++
 .../reifier/dataformat/DataFormatReifier.java      |  9 +-----
 2 files changed, 35 insertions(+), 8 deletions(-)

diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/AbstractReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/AbstractReifier.java
index 17eac69..b10c685 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/AbstractReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/AbstractReifier.java
@@ -16,17 +16,24 @@
  */
 package org.apache.camel.reifier;
 
+import java.util.Map;
+
 import org.apache.camel.CamelContext;
 import org.apache.camel.Expression;
 import org.apache.camel.Predicate;
+import org.apache.camel.model.Constants;
 import org.apache.camel.model.ExpressionSubElementDefinition;
+import org.apache.camel.model.OtherAttributesAware;
 import org.apache.camel.model.language.ExpressionDefinition;
 import org.apache.camel.reifier.language.ExpressionReifier;
+import org.apache.camel.spi.PropertiesComponent;
 import org.apache.camel.spi.RouteContext;
 import org.apache.camel.support.CamelContextHelper;
 
 public abstract class AbstractReifier {
 
+    private static final String PREFIX = "{" + Constants.PLACEHOLDER_QNAME + "}";
+
     protected final RouteContext routeContext;
     protected final CamelContext camelContext;
 
@@ -77,4 +84,31 @@ public abstract class AbstractReifier {
         return ExpressionReifier.reifier(camelContext, expression).createPredicate();
     }
 
+    @SuppressWarnings("unchecked")
+    protected void addOtherAttributes(Object definition, Map<String, Object> properties) {
+        if (definition instanceof OtherAttributesAware) {
+            Map<Object, Object> others = ((OtherAttributesAware) definition).getOtherAttributes();
+            others.forEach((k, v) -> {
+                String ks = k.toString();
+                if (ks.startsWith(PREFIX) && v instanceof String) {
+                    // value must be enclosed with placeholder tokens
+                    String s = (String) v;
+                    if (!s.startsWith(PropertiesComponent.PREFIX_TOKEN) && !s.endsWith(PropertiesComponent.SUFFIX_TOKEN)) {
+                        s = PropertiesComponent.PREFIX_TOKEN + s + PropertiesComponent.SUFFIX_TOKEN;
+                    }
+                    String kk = ks.substring(PREFIX.length());
+                    properties.put(kk, s);
+                }
+            });
+        }
+    }
+
+    protected Object or(Object a, Object b) {
+        return a != null ? a : b;
+    }
+
+    protected Object asRef(String s) {
+        return s != null ? s.startsWith("#") ? s : "#" + s : null;
+    }
+
 }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/DataFormatReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/DataFormatReifier.java
index 053ac11..f9c8c23 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/DataFormatReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/dataformat/DataFormatReifier.java
@@ -235,6 +235,7 @@ public abstract class DataFormatReifier<T extends DataFormatDefinition> extends
         Map<String, Object> properties = new LinkedHashMap<>();
         prepareDataFormatConfig(properties);
         properties.entrySet().removeIf(e -> e.getValue() == null);
+        addOtherAttributes(definition, properties);
 
         PropertyConfigurer configurer = findPropertyConfigurer(dataFormat, camelContext);
 
@@ -285,12 +286,4 @@ public abstract class DataFormatReifier<T extends DataFormatDefinition> extends
 
     protected abstract void prepareDataFormatConfig(Map<String, Object> properties);
 
-    protected Object or(Object a, Object b) {
-        return a != null ? a : b;
-    }
-
-    protected Object asRef(String s) {
-        return s != null ? s.startsWith("#") ? s : "#" + s : null;
-    }
-
 }

Reply | Threaded
Open this post in threaded view
|

[camel] 08/18: Fix support for other properties on expressions

Guillaume Nodet-2
In reply to this post by Guillaume Nodet-2
This is an automated email from the ASF dual-hosted git repository.

gnodet pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 0ef4475db18a1953da4730fd97d5cf3f590d4160
Author: Guillaume Nodet <[hidden email]>
AuthorDate: Tue Feb 11 07:11:16 2020 +0100

    Fix support for other properties on expressions
---
 .../camel/language/tokenizer/TokenizeLanguage.java | 31 +++++++++++++++-
 .../org/apache/camel/builder/SimpleBuilder.java    | 17 ++++++++-
 .../camel/reifier/language/ExpressionReifier.java  | 33 ++++++++---------
 .../language/MethodCallExpressionReifier.java      | 14 --------
 .../reifier/language/SimpleExpressionReifier.java  |  8 +++--
 .../language/TokenizerExpressionReifier.java       | 42 +++++++++-------------
 .../language/XMLTokenizerExpressionReifier.java    |  1 -
 7 files changed, 86 insertions(+), 60 deletions(-)

diff --git a/core/camel-base/src/main/java/org/apache/camel/language/tokenizer/TokenizeLanguage.java b/core/camel-base/src/main/java/org/apache/camel/language/tokenizer/TokenizeLanguage.java
index 2eafc00..8fafba9 100644
--- a/core/camel-base/src/main/java/org/apache/camel/language/tokenizer/TokenizeLanguage.java
+++ b/core/camel-base/src/main/java/org/apache/camel/language/tokenizer/TokenizeLanguage.java
@@ -16,12 +16,15 @@
  */
 package org.apache.camel.language.tokenizer;
 
+import org.apache.camel.CamelContext;
 import org.apache.camel.Expression;
 import org.apache.camel.IsSingleton;
 import org.apache.camel.Predicate;
+import org.apache.camel.spi.GeneratedPropertyConfigurer;
 import org.apache.camel.spi.Language;
 import org.apache.camel.support.ExpressionToPredicateAdapter;
 import org.apache.camel.support.builder.ExpressionBuilder;
+import org.apache.camel.support.component.PropertyConfigurerSupport;
 import org.apache.camel.util.ObjectHelper;
 
 /**
@@ -38,7 +41,7 @@ import org.apache.camel.util.ObjectHelper;
  * And the <tt>xml</tt> mode supports the <tt>inheritNamespaceTagName</tt> option.
  */
 @org.apache.camel.spi.annotations.Language("tokenize")
-public class TokenizeLanguage implements Language, IsSingleton {
+public class TokenizeLanguage implements Language, IsSingleton, GeneratedPropertyConfigurer {
 
     private String token;
     private String endToken;
@@ -91,6 +94,32 @@ public class TokenizeLanguage implements Language, IsSingleton {
     }
 
     @Override
+    public boolean configure(CamelContext camelContext, Object target, String name, Object value, boolean ignoreCase) {
+        if (target != this) {
+            throw new IllegalStateException("Can only configure our own instance !");
+        }
+        switch (ignoreCase ? name.toLowerCase() : name) {
+            case "token": setToken(PropertyConfigurerSupport.property(camelContext, String.class, value)); return true;
+            case "endtoken":
+            case "endToken": setEndToken(PropertyConfigurerSupport.property(camelContext, String.class, value)); return true;
+            case "inheritnamespacetagname":
+            case "inheritNamespaceTagName": setInheritNamespaceTagName(PropertyConfigurerSupport.property(camelContext, String.class, value)); return true;
+            case "headername":
+            case "headerName": setHeaderName(PropertyConfigurerSupport.property(camelContext, String.class, value)); return true;
+            case "regex": setRegex(PropertyConfigurerSupport.property(camelContext, Boolean.class, value)); return true;
+            case "xml": setXml(PropertyConfigurerSupport.property(camelContext, Boolean.class, value)); return true;
+            case "includetokens":
+            case "includeTokens": setIncludeTokens(PropertyConfigurerSupport.property(camelContext, Boolean.class, value)); return true;
+            case "group": setGroup(PropertyConfigurerSupport.property(camelContext, String.class, value)); return true;
+            case "groupdelimiter":
+            case "groupDelimiter": setGroupDelimiter(PropertyConfigurerSupport.property(camelContext, String.class, value)); return true;
+            case "skipfirst":
+            case "skipFirst": setSkipFirst(PropertyConfigurerSupport.property(camelContext, Boolean.class, value)); return true;
+            default: return false;
+        }
+    }
+
+    @Override
     public Predicate createPredicate(String expression) {
         return ExpressionToPredicateAdapter.toPredicate(createExpression(expression));
     }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/builder/SimpleBuilder.java b/core/camel-core-engine/src/main/java/org/apache/camel/builder/SimpleBuilder.java
index 9927d3d..1d54633 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/builder/SimpleBuilder.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/builder/SimpleBuilder.java
@@ -16,15 +16,18 @@
  */
 package org.apache.camel.builder;
 
+import org.apache.camel.CamelContext;
 import org.apache.camel.CamelExecutionException;
 import org.apache.camel.Exchange;
 import org.apache.camel.Expression;
 import org.apache.camel.Predicate;
 import org.apache.camel.language.simple.Simple;
 import org.apache.camel.spi.ExpressionResultTypeAware;
+import org.apache.camel.spi.GeneratedPropertyConfigurer;
 import org.apache.camel.spi.Language;
 import org.apache.camel.support.PredicateToExpressionAdapter;
 import org.apache.camel.support.ScriptHelper;
+import org.apache.camel.support.component.PropertyConfigurerSupport;
 
 /**
  * Creates an {@link Simple} language builder.
@@ -33,7 +36,7 @@ import org.apache.camel.support.ScriptHelper;
  * means that using simple language for {@link Expression}s or
  * {@link Predicate}s is very easy with the help of this builder.
  */
-public class SimpleBuilder implements Predicate, Expression, ExpressionResultTypeAware {
+public class SimpleBuilder implements Predicate, Expression, ExpressionResultTypeAware, GeneratedPropertyConfigurer {
 
     private final String text;
     private Class<?> resultType;
@@ -63,6 +66,18 @@ public class SimpleBuilder implements Predicate, Expression, ExpressionResultTyp
         return simple(String.format(formatText, values), resultType);
     }
 
+    @Override
+    public boolean configure(CamelContext camelContext, Object target, String name, Object value, boolean ignoreCase) {
+        if (target != this) {
+            throw new IllegalStateException("Can only configure our own instance !");
+        }
+        switch (ignoreCase ? name.toLowerCase() : name) {
+            case "resulttype":
+            case "resultType": setResultType(PropertyConfigurerSupport.property(camelContext, Class.class, value)); return true;
+            default: return false;
+        }
+    }
+
     public String getText() {
         return text;
     }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/language/ExpressionReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/language/ExpressionReifier.java
index 3b63184..6d633a2 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/language/ExpressionReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/language/ExpressionReifier.java
@@ -26,7 +26,10 @@ import org.apache.camel.CamelContextAware;
 import org.apache.camel.Expression;
 import org.apache.camel.NoSuchLanguageException;
 import org.apache.camel.Predicate;
+import org.apache.camel.RuntimeCamelException;
+import org.apache.camel.model.Constants;
 import org.apache.camel.model.ExpressionSubElementDefinition;
+import org.apache.camel.model.OtherAttributesAware;
 import org.apache.camel.model.language.ConstantExpression;
 import org.apache.camel.model.language.ExchangePropertyExpression;
 import org.apache.camel.model.language.ExpressionDefinition;
@@ -47,6 +50,7 @@ import org.apache.camel.model.language.XPathExpression;
 import org.apache.camel.model.language.XQueryExpression;
 import org.apache.camel.reifier.AbstractReifier;
 import org.apache.camel.spi.Language;
+import org.apache.camel.spi.PropertiesComponent;
 import org.apache.camel.spi.PropertyConfigurer;
 import org.apache.camel.spi.PropertyConfigurerAware;
 import org.apache.camel.support.CamelContextHelper;
@@ -106,15 +110,15 @@ public class ExpressionReifier<T extends ExpressionDefinition> extends AbstractR
         if (expression == null) {
             if (definition.getExpressionType() != null) {
                 expression = reifier(camelContext, definition.getExpressionType()).createExpression();
-            } else if (definition.getExpression() != null) {
-                ObjectHelper.notNull("language", definition.getLanguage());
+            } else {
+                ObjectHelper.notNull(definition.getLanguage(), "language");
                 Language language = camelContext.resolveLanguage(definition.getLanguage());
                 if (language == null) {
                     throw new NoSuchLanguageException(definition.getLanguage());
                 }
-                String exp = CamelContextHelper.parseText(camelContext, definition.getExpression());
+                String exp = parseString(definition.getExpression());
                 // should be true by default
-                boolean isTrim = definition.getTrim() == null || CamelContextHelper.parseBoolean(camelContext, definition.getTrim());
+                boolean isTrim = definition.getTrim() == null || parseBoolean(definition.getTrim());
                 // trim if configured to trim
                 if (exp != null && isTrim) {
                     exp = exp.trim();
@@ -122,6 +126,7 @@ public class ExpressionReifier<T extends ExpressionDefinition> extends AbstractR
                 // resolve the expression as it may be an external script from
                 // the classpath/file etc
                 exp = ScriptHelper.resolveOptionalExternalScript(camelContext, exp);
+                configureLanguage(language);
                 expression = language.createExpression(exp);
                 configureExpression(expression);
             }
@@ -141,14 +146,14 @@ public class ExpressionReifier<T extends ExpressionDefinition> extends AbstractR
             } else if (definition.getExpressionValue() != null) {
                 predicate = new ExpressionToPredicateAdapter(definition.getExpressionValue());
             } else if (definition.getExpression() != null) {
-                ObjectHelper.notNull("language", definition.getLanguage());
+                ObjectHelper.notNull(definition.getLanguage(), "language");
                 Language language = camelContext.resolveLanguage(definition.getLanguage());
                 if (language == null) {
                     throw new NoSuchLanguageException(definition.getLanguage());
                 }
-                String exp = CamelContextHelper.parseText(camelContext, definition.getExpression());
+                String exp = parseString(definition.getExpression());
                 // should be true by default
-                boolean isTrim = definition.getTrim() == null || CamelContextHelper.parseBoolean(camelContext, definition.getTrim());
+                boolean isTrim = definition.getTrim() == null || parseBoolean(definition.getTrim());
                 // trim if configured to trim
                 if (exp != null && isTrim) {
                     exp = exp.trim();
@@ -156,7 +161,7 @@ public class ExpressionReifier<T extends ExpressionDefinition> extends AbstractR
                 // resolve the expression as it may be an external script from
                 // the classpath/file etc
                 exp = ScriptHelper.resolveOptionalExternalScript(camelContext, exp);
-
+                configureLanguage(language);
                 predicate = language.createPredicate(exp);
                 configurePredicate(predicate);
             }
@@ -168,6 +173,9 @@ public class ExpressionReifier<T extends ExpressionDefinition> extends AbstractR
         return predicate;
     }
 
+    protected void configureLanguage(Language language) {
+    }
+
     protected void configurePredicate(Predicate predicate) {
         // allows to perform additional logic after the properties has been
         // configured which may be needed
@@ -188,6 +196,7 @@ public class ExpressionReifier<T extends ExpressionDefinition> extends AbstractR
 
     protected void setProperties(Object target, Map<String, Object> properties) {
         properties.entrySet().removeIf(e -> e.getValue() == null);
+        addOtherAttributes(definition, properties);
 
         PropertyConfigurer configurer = null;
         if (target instanceof PropertyConfigurerAware) {
@@ -200,12 +209,4 @@ public class ExpressionReifier<T extends ExpressionDefinition> extends AbstractR
                 .bind(camelContext, target, properties);
     }
 
-    protected Object or(Object a, Object b) {
-        return a != null ? a : b;
-    }
-
-    protected Object asRef(String s) {
-        return s != null ? s.startsWith("#") ? s : "#" + s : null;
-    }
-
 }
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/language/MethodCallExpressionReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/language/MethodCallExpressionReifier.java
index cdc14a4..013d493 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/language/MethodCallExpressionReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/language/MethodCallExpressionReifier.java
@@ -33,20 +33,6 @@ public class MethodCallExpressionReifier extends ExpressionReifier<MethodCallExp
         super(camelContext, (MethodCallExpression) definition);
     }
 
-    @Override
-    public Expression createExpression() {
-        // special for bean language where we need to configure it first
-        Language lan = camelContext.resolveLanguage("bean");
-        configureLanguage(lan);
-        // .. and create expression with null value as we use the configured
-        // properties instead
-        Expression exp = lan.createExpression(null);
-        if (exp instanceof AfterPropertiesConfigured) {
-            ((AfterPropertiesConfigured)exp).afterPropertiesConfigured(camelContext);
-        }
-        return exp;
-    }
-
     protected void configureLanguage(Language language) {
         Map<String, Object> properties = new HashMap<>();
         properties.put("bean", definition.getInstance());
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/language/SimpleExpressionReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/language/SimpleExpressionReifier.java
index 807c807..7806272 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/language/SimpleExpressionReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/language/SimpleExpressionReifier.java
@@ -16,6 +16,9 @@
  */
 package org.apache.camel.reifier.language;
 
+import java.util.HashMap;
+import java.util.Map;
+
 import org.apache.camel.CamelContext;
 import org.apache.camel.Expression;
 import org.apache.camel.Predicate;
@@ -40,8 +43,9 @@ public class SimpleExpressionReifier extends ExpressionReifier<SimpleExpression>
         }
 
         SimpleBuilder answer = new SimpleBuilder(exp);
-        answer.setResultType(CamelContextHelper.convertTo(camelContext, Class.class,
-                or(definition.getResultType(), definition.getResultTypeName())));
+        Map<String, Object> props = new HashMap<>();
+        props.put("resultType", or(definition.getResultType(), definition.getResultTypeName()));
+        setProperties(answer, props);
         return answer;
     }
 
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/language/TokenizerExpressionReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/language/TokenizerExpressionReifier.java
index ff49e62..f56ba1c 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/language/TokenizerExpressionReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/language/TokenizerExpressionReifier.java
@@ -16,12 +16,16 @@
  */
 package org.apache.camel.reifier.language;
 
+import java.util.HashMap;
+import java.util.Map;
+
 import org.apache.camel.CamelContext;
 import org.apache.camel.Expression;
 import org.apache.camel.Predicate;
 import org.apache.camel.language.tokenizer.TokenizeLanguage;
 import org.apache.camel.model.language.ExpressionDefinition;
 import org.apache.camel.model.language.TokenizerExpression;
+import org.apache.camel.spi.Language;
 import org.apache.camel.support.ExpressionToPredicateAdapter;
 
 public class TokenizerExpressionReifier extends ExpressionReifier<TokenizerExpression> {
@@ -31,37 +35,25 @@ public class TokenizerExpressionReifier extends ExpressionReifier<TokenizerExpre
     }
 
     @Override
-    public Expression createExpression() {
+    protected void configureLanguage(Language language) {
+        Map<String, Object> props = new HashMap<>();
         // special for new line tokens, if defined from XML then its 2
         // characters, so we replace that back to a single char
         String token = definition.getToken();
         if (token.startsWith("\\n")) {
             token = '\n' + token.substring(2);
         }
-
-        TokenizeLanguage language = new TokenizeLanguage();
-        language.setToken(parseString(token));
-        language.setEndToken(parseString(definition.getEndToken()));
-        language.setInheritNamespaceTagName(parseString(definition.getInheritNamespaceTagName()));
-        language.setHeaderName(parseString(definition.getHeaderName()));
-        language.setGroupDelimiter(parseString(definition.getGroupDelimiter()));
-        if (definition.getRegex() != null) {
-            language.setRegex(parseBoolean(definition.getRegex()));
-        }
-        if (definition.getXml() != null) {
-            language.setXml(parseBoolean(definition.getXml()));
-        }
-        if (definition.getIncludeTokens() != null) {
-            language.setIncludeTokens(parseBoolean(definition.getIncludeTokens()));
-        }
-        if (definition.getGroup() != null && !"0".equals(definition.getGroup())) {
-            language.setGroup(parseString(definition.getGroup()));
-        }
-
-        if (definition.getSkipFirst() != null) {
-            language.setSkipFirst(parseBoolean(definition.getSkipFirst()));
-        }
-        return language.createExpression();
+        props.put("token", token);
+        props.put("endToken", definition.getEndToken());
+        props.put("inheritNamespaceTagName", definition.getInheritNamespaceTagName());
+        props.put("headerName", definition.getHeaderName());
+        props.put("groupDelimiter", definition.getGroupDelimiter());
+        props.put("regex", definition.getRegex());
+        props.put("xml", definition.getXml());
+        props.put("includeTokens", definition.getIncludeTokens());
+        props.put("group", definition.getGroup());
+        props.put("skipFirst", definition.getSkipFirst());
+        setProperties(language, props);
     }
 
     @Override
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/language/XMLTokenizerExpressionReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/language/XMLTokenizerExpressionReifier.java
index 7595951..8a10253 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/language/XMLTokenizerExpressionReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/language/XMLTokenizerExpressionReifier.java
@@ -23,7 +23,6 @@ import org.apache.camel.CamelContext;
 import org.apache.camel.Expression;
 import org.apache.camel.Predicate;
 import org.apache.camel.model.language.ExpressionDefinition;
-import org.apache.camel.model.language.JsonPathExpression;
 import org.apache.camel.model.language.XMLTokenizerExpression;
 import org.apache.camel.spi.NamespaceAware;
 

Reply | Threaded
Open this post in threaded view
|

[camel] 09/18: Fix support for extra properties on dataformat

Guillaume Nodet-2
In reply to this post by Guillaume Nodet-2
This is an automated email from the ASF dual-hosted git repository.

gnodet pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 764bf19b61b59034eaa0511e102e5259269539ce
Author: Guillaume Nodet <[hidden email]>
AuthorDate: Tue Feb 11 07:11:32 2020 +0100

    Fix support for extra properties on dataformat
---
 .../camel/language/tokenizer/TokenizeLanguage.java |  2 +-
 .../org/apache/camel/reifier/AbstractReifier.java  | 24 ++++++++++++----------
 2 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/core/camel-base/src/main/java/org/apache/camel/language/tokenizer/TokenizeLanguage.java b/core/camel-base/src/main/java/org/apache/camel/language/tokenizer/TokenizeLanguage.java
index 8fafba9..8980751 100644
--- a/core/camel-base/src/main/java/org/apache/camel/language/tokenizer/TokenizeLanguage.java
+++ b/core/camel-base/src/main/java/org/apache/camel/language/tokenizer/TokenizeLanguage.java
@@ -241,7 +241,7 @@ public class TokenizeLanguage implements Language, IsSingleton, GeneratedPropert
     }
 
     public void setGroup(String group) {
-        this.group = group;
+        this.group = "0".equals(group) ? null : group;
     }
 
     public String getGroupDelimiter() {
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/AbstractReifier.java b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/AbstractReifier.java
index b10c685..33efa72 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/AbstractReifier.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/AbstractReifier.java
@@ -88,18 +88,20 @@ public abstract class AbstractReifier {
     protected void addOtherAttributes(Object definition, Map<String, Object> properties) {
         if (definition instanceof OtherAttributesAware) {
             Map<Object, Object> others = ((OtherAttributesAware) definition).getOtherAttributes();
-            others.forEach((k, v) -> {
-                String ks = k.toString();
-                if (ks.startsWith(PREFIX) && v instanceof String) {
-                    // value must be enclosed with placeholder tokens
-                    String s = (String) v;
-                    if (!s.startsWith(PropertiesComponent.PREFIX_TOKEN) && !s.endsWith(PropertiesComponent.SUFFIX_TOKEN)) {
-                        s = PropertiesComponent.PREFIX_TOKEN + s + PropertiesComponent.SUFFIX_TOKEN;
+            if (others != null) {
+                others.forEach((k, v) -> {
+                    String ks = k.toString();
+                    if (ks.startsWith(PREFIX) && v instanceof String) {
+                        // value must be enclosed with placeholder tokens
+                        String s = (String) v;
+                        if (!s.startsWith(PropertiesComponent.PREFIX_TOKEN) && !s.endsWith(PropertiesComponent.SUFFIX_TOKEN)) {
+                            s = PropertiesComponent.PREFIX_TOKEN + s + PropertiesComponent.SUFFIX_TOKEN;
+                        }
+                        String kk = ks.substring(PREFIX.length());
+                        properties.put(kk, s);
                     }
-                    String kk = ks.substring(PREFIX.length());
-                    properties.put(kk, s);
-                }
-            });
+                });
+            }
         }
     }
 

Reply | Threaded
Open this post in threaded view
|

[camel] 10/18: Fix generation process

Guillaume Nodet-2
In reply to this post by Guillaume Nodet-2
This is an automated email from the ASF dual-hosted git repository.

gnodet pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 6894ca032ee151795c5ad057585889e8804c1ce6
Author: Guillaume Nodet <[hidden email]>
AuthorDate: Tue Feb 11 13:11:32 2020 +0100

    Fix generation process
---
 components/camel-spring/pom.xml                       | 19 -------------------
 .../apache/camel/maven/packaging/GenerateMojo.java    |  2 ++
 .../maven/packaging/ModelXmlParserGeneratorMojo.java  | 11 +++++++++++
 3 files changed, 13 insertions(+), 19 deletions(-)

diff --git a/components/camel-spring/pom.xml b/components/camel-spring/pom.xml
index a082025..b2e24e0 100644
--- a/components/camel-spring/pom.xml
+++ b/components/camel-spring/pom.xml
@@ -320,25 +320,6 @@
                 </configuration>
             </plugin>
             <plugin>
-                <groupId>org.apache.camel</groupId>
-                <artifactId>camel-package-maven-plugin</artifactId>
-                <version>${project.version}</version>
-                <executions>
-                    <execution>
-                        <id>generate</id>
-                        <goals>
-                            <goal>jandex</goal>
-                            <goal>generate-schema</goal>
-                            <goal>generate-spi</goal>
-                            <goal>prepare-components</goal>
-                            <goal>generate-components-list</goal>
-                            <goal>generate-jaxb-list</goal>
-                        </goals>
-                        <phase>process-classes</phase>
-                    </execution>
-                </executions>
-            </plugin>
-            <plugin>
                 <artifactId>maven-resources-plugin</artifactId>
                 <executions>
                     <execution>
diff --git a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/GenerateMojo.java b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/GenerateMojo.java
index dba8ac7..ca35ccdb 100644
--- a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/GenerateMojo.java
+++ b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/GenerateMojo.java
@@ -60,6 +60,8 @@ public class GenerateMojo extends AbstractGenerateMojo {
         invoke(ComponentDslMojo.class);
         // update-readme
         invoke(UpdateReadmeMojo.class);
+        // generate-xml-parser
+        invoke(ModelXmlParserGeneratorMojo.class);
     }
 
 }
diff --git a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/ModelXmlParserGeneratorMojo.java b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/ModelXmlParserGeneratorMojo.java
index 9d90ec1..7b543bb 100644
--- a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/ModelXmlParserGeneratorMojo.java
+++ b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/ModelXmlParserGeneratorMojo.java
@@ -64,16 +64,20 @@ import org.apache.camel.tooling.util.srcgen.GenericType;
 import org.apache.camel.tooling.util.srcgen.JavaClass;
 import org.apache.maven.artifact.DependencyResolutionRequiredException;
 import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
 import org.apache.maven.plugins.annotations.LifecyclePhase;
 import org.apache.maven.plugins.annotations.Mojo;
 import org.apache.maven.plugins.annotations.Parameter;
 import org.apache.maven.plugins.annotations.ResolutionScope;
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.project.MavenProjectHelper;
 import org.jboss.jandex.AnnotationInstance;
 import org.jboss.jandex.AnnotationTarget;
 import org.jboss.jandex.ClassInfo;
 import org.jboss.jandex.DotName;
 import org.jboss.jandex.Index;
 import org.jboss.jandex.IndexReader;
+import org.sonatype.plexus.build.incremental.BuildContext;
 
 /**
  * Generate Model lightweight XML Parser source code.
@@ -100,6 +104,13 @@ public class ModelXmlParserGeneratorMojo extends AbstractGeneratorMojo {
     private Class<?> dataFormatDefinitionClass;
 
     @Override
+    public void execute(MavenProject project, MavenProjectHelper projectHelper, BuildContext buildContext) throws MojoFailureException, MojoExecutionException {
+        sourcesOutputDir = new File(project.getBasedir(), "src/generated/java");
+        generateXmlParser = Boolean.parseBoolean(project.getProperties().getProperty("camel-generate-xml-parser", "false"));
+        super.execute(project, projectHelper, buildContext);
+    }
+
+    @Override
     public void execute() throws MojoExecutionException {
         if (!generateXmlParser) {
             return;

Reply | Threaded
Open this post in threaded view
|

[camel] 11/18: Remove placeholder configurers completely

Guillaume Nodet-2
In reply to this post by Guillaume Nodet-2
This is an automated email from the ASF dual-hosted git repository.

gnodet pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 87be48b102cb0ae72fcbbd2524f9f069e75c7cc3
Author: Guillaume Nodet <[hidden email]>
AuthorDate: Tue Feb 11 16:27:07 2020 +0100

    Remove placeholder configurers completely
---
 .../hystrix/processor/HystrixReifier.java          |   4 +-
 .../component/resilience4j/ResilienceReifier.java  |  36 +--
 .../properties/SpringOptionalPropertiesDslTest.xml |   2 +-
 .../SpringOptionalPropertiesDslTokenizeTest.xml    |   2 +-
 ...RecipientListParallelOptionalPropertiesTest.xml |   4 +-
 .../camel/spi/GeneratedPropertyConfigurer.java     |  14 -
 .../org/apache/camel/spi/PropertyConfigurer.java   |  14 +
 .../camel/spi/PropertyPlaceholderConfigurer.java   |  47 ---
 .../camel/impl/engine/AbstractCamelContext.java    |  13 +
 .../camel/language/tokenizer/TokenizeLanguage.java |   4 +-
 .../ASN1DataFormatPropertyPlaceholderProvider.java |  41 ---
 ...egateDefinitionPropertyPlaceholderProvider.java |  51 ----
 ...Any23DataFormatPropertyPlaceholderProvider.java |  41 ---
 .../AvroDataFormatPropertyPlaceholderProvider.java |  41 ---
 ...rcodeDataFormatPropertyPlaceholderProvider.java |  43 ---
 ...ase64DataFormatPropertyPlaceholderProvider.java |  41 ---
 .../BeanDefinitionPropertyPlaceholderProvider.java |  47 ---
 ...eanioDataFormatPropertyPlaceholderProvider.java |  47 ---
 ...BindyDataFormatPropertyPlaceholderProvider.java |  43 ---
 .../CBORDataFormatPropertyPlaceholderProvider.java |  49 ----
 ...CatchDefinitionPropertyPlaceholderProvider.java |  39 ---
 ...hoiceDefinitionPropertyPlaceholderProvider.java |  39 ---
 ...eakerDefinitionPropertyPlaceholderProvider.java |  41 ---
 ...CheckDefinitionPropertyPlaceholderProvider.java |  47 ---
 ...stantExpressionPropertyPlaceholderProvider.java |  41 ---
 ...tBodyDefinitionPropertyPlaceholderProvider.java |  43 ---
 ...ryptoDataFormatPropertyPlaceholderProvider.java |  51 ----
 .../CsvDataFormatPropertyPlaceholderProvider.java  |  63 ----
 ...ustomDataFormatPropertyPlaceholderProvider.java |  41 ---
 ...initionPropertiesPlaceholderProviderHelper.java | 322 ---------------------
 ...DelayDefinitionPropertyPlaceholderProvider.java |  45 ---
 ...eVerbDefinitionPropertyPlaceholderProvider.java |  63 ----
 ...outerDefinitionPropertyPlaceholderProvider.java |  45 ---
 ...nrichDefinitionPropertyPlaceholderProvider.java |  53 ----
 ...pertyExpressionPropertyPlaceholderProvider.java |  41 ---
 ...ssionDefinitionPropertyPlaceholderProvider.java |  41 ---
 ...rJsonDataFormatPropertyPlaceholderProvider.java |  43 ---
 ...irXmlDataFormatPropertyPlaceholderProvider.java |  43 ---
 ...ilterDefinitionPropertyPlaceholderProvider.java |  39 ---
 ...nallyDefinitionPropertyPlaceholderProvider.java |  39 ---
 ...tpackDataFormatPropertyPlaceholderProvider.java |  47 ---
 .../FromDefinitionPropertyPlaceholderProvider.java |  41 ---
 ...tVerbDefinitionPropertyPlaceholderProvider.java |  63 ----
 .../GrokDataFormatPropertyPlaceholderProvider.java |  41 ---
 ...roovyExpressionPropertyPlaceholderProvider.java |  41 ---
 .../GzipDataFormatPropertyPlaceholderProvider.java |  39 ---
 .../HL7DataFormatPropertyPlaceholderProvider.java  |  39 ---
 ...dVerbDefinitionPropertyPlaceholderProvider.java |  63 ----
 ...eaderExpressionPropertyPlaceholderProvider.java |  41 ---
 ...erserExpressionPropertyPlaceholderProvider.java |  41 ---
 .../IcalDataFormatPropertyPlaceholderProvider.java |  39 ---
 ...sumerDefinitionPropertyPlaceholderProvider.java |  49 ----
 ...nOnlyDefinitionPropertyPlaceholderProvider.java |  41 ---
 ...InOutDefinitionPropertyPlaceholderProvider.java |  41 ---
 ...rceptDefinitionPropertyPlaceholderProvider.java |  39 ---
 ...tFromDefinitionPropertyPlaceholderProvider.java |  41 ---
 ...pointDefinitionPropertyPlaceholderProvider.java |  45 ---
 ...onXMLDataFormatPropertyPlaceholderProvider.java |  55 ----
 .../JaxbDataFormatPropertyPlaceholderProvider.java |  59 ----
 ...onApiDataFormatPropertyPlaceholderProvider.java |  39 ---
 .../JsonDataFormatPropertyPlaceholderProvider.java |  59 ----
 ...nPathExpressionPropertyPlaceholderProvider.java |  45 ---
 .../LZFDataFormatPropertyPlaceholderProvider.java  |  39 ---
 ...guageExpressionPropertyPlaceholderProvider.java |  43 ---
 ...lanceDefinitionPropertyPlaceholderProvider.java |  39 ---
 .../LogDefinitionPropertyPlaceholderProvider.java  |  49 ----
 .../LoopDefinitionPropertyPlaceholderProvider.java |  43 ---
 ...rshalDefinitionPropertyPlaceholderProvider.java |  39 ---
 ...dCallExpressionPropertyPlaceholderProvider.java |  45 ---
 ...ipartDataFormatPropertyPlaceholderProvider.java |  43 ---
 ...icastDefinitionPropertyPlaceholderProvider.java |  63 ----
 .../MvelExpressionPropertyPlaceholderProvider.java |  41 ---
 .../OgnlExpressionPropertyPlaceholderProvider.java |  41 ---
 ...etionDefinitionPropertyPlaceholderProvider.java |  49 ----
 ...ptionDefinitionPropertyPlaceholderProvider.java |  49 ----
 ...lbackDefinitionPropertyPlaceholderProvider.java |  41 ---
 ...rwiseDefinitionPropertyPlaceholderProvider.java |  39 ---
 .../PGPDataFormatPropertyPlaceholderProvider.java  |  57 ----
 ...hVerbDefinitionPropertyPlaceholderProvider.java |  63 ----
 ...elineDefinitionPropertyPlaceholderProvider.java |  39 ---
 ...olicyDefinitionPropertyPlaceholderProvider.java |  41 ---
 ...nrichDefinitionPropertyPlaceholderProvider.java |  53 ----
 ...tVerbDefinitionPropertyPlaceholderProvider.java |  63 ----
 ...ocessDefinitionPropertyPlaceholderProvider.java |  41 ---
 ...tobufDataFormatPropertyPlaceholderProvider.java |  43 ---
 ...tVerbDefinitionPropertyPlaceholderProvider.java |  63 ----
 ...tListDefinitionPropertyPlaceholderProvider.java |  69 -----
 .../RefExpressionPropertyPlaceholderProvider.java  |  41 ---
 ...eaderDefinitionPropertyPlaceholderProvider.java |  41 ---
 ...adersDefinitionPropertyPlaceholderProvider.java |  43 ---
 ...rtiesDefinitionPropertyPlaceholderProvider.java |  43 ---
 ...pertyDefinitionPropertyPlaceholderProvider.java |  41 ---
 ...uenceDefinitionPropertyPlaceholderProvider.java |  39 ---
 ...ndingDefinitionPropertyPlaceholderProvider.java |  57 ----
 ...ationDefinitionPropertyPlaceholderProvider.java |  65 -----
 .../RestDefinitionPropertyPlaceholderProvider.java |  57 ----
 ...ParamDefinitionPropertyPlaceholderProvider.java |  49 ----
 ...eaderDefinitionPropertyPlaceholderProvider.java |  49 ----
 ...seMsgDefinitionPropertyPlaceholderProvider.java |  43 ---
 ...pertyDefinitionPropertyPlaceholderProvider.java |  41 ---
 ...itiesDefinitionPropertyPlaceholderProvider.java |  38 ---
 ...tSecurityApiKeyPropertyPlaceholderProvider.java |  43 ---
 ...curityBasicAuthPropertyPlaceholderProvider.java |  41 ---
 ...tSecurityOAuth2PropertyPlaceholderProvider.java |  47 ---
 ...RestsDefinitionPropertyPlaceholderProvider.java |  39 ---
 ...lbackDefinitionPropertyPlaceholderProvider.java |  45 ---
 ...RouteDefinitionPropertyPlaceholderProvider.java |  57 ----
 ...gSlipDefinitionPropertyPlaceholderProvider.java |  45 ---
 .../RssDataFormatPropertyPlaceholderProvider.java  |  39 ---
 .../SagaDefinitionPropertyPlaceholderProvider.java |  41 ---
 ...plingDefinitionPropertyPlaceholderProvider.java |  39 ---
 ...criptDefinitionPropertyPlaceholderProvider.java |  39 ---
 ...urityDefinitionPropertyPlaceholderProvider.java |  41 ---
 ...eCallDefinitionPropertyPlaceholderProvider.java |  57 ----
 ...tBodyDefinitionPropertyPlaceholderProvider.java |  39 ---
 ...tternDefinitionPropertyPlaceholderProvider.java |  39 ---
 ...eaderDefinitionPropertyPlaceholderProvider.java |  41 ---
 ...pertyDefinitionPropertyPlaceholderProvider.java |  41 ---
 ...impleExpressionPropertyPlaceholderProvider.java |  43 ---
 ...pJaxbDataFormatPropertyPlaceholderProvider.java |  51 ----
 .../SortDefinitionPropertyPlaceholderProvider.java |  41 ---
 .../SpELExpressionPropertyPlaceholderProvider.java |  41 ---
 ...SplitDefinitionPropertyPlaceholderProvider.java |  47 ---
 .../StepDefinitionPropertyPlaceholderProvider.java |  39 ---
 .../StopDefinitionPropertyPlaceholderProvider.java |  39 ---
 ...yslogDataFormatPropertyPlaceholderProvider.java |  39 ---
 ...rFileDataFormatPropertyPlaceholderProvider.java |  39 ---
 ...readsDefinitionPropertyPlaceholderProvider.java |  57 ----
 ...hriftDataFormatPropertyPlaceholderProvider.java |  43 ---
 ...ottleDefinitionPropertyPlaceholderProvider.java |  41 ---
 ...ptionDefinitionPropertyPlaceholderProvider.java |  45 ---
 ...arkupDataFormatPropertyPlaceholderProvider.java |  41 ---
 .../ToDefinitionPropertyPlaceholderProvider.java   |  43 ---
 ...namicDefinitionPropertyPlaceholderProvider.java |  49 ----
 ...nizerExpressionPropertyPlaceholderProvider.java |  51 ----
 ...actedDefinitionPropertyPlaceholderProvider.java |  41 ---
 ...sformDefinitionPropertyPlaceholderProvider.java |  39 ---
 .../TryDefinitionPropertyPlaceholderProvider.java  |  39 ---
 ...tyCsvDataFormatPropertyPlaceholderProvider.java |  55 ----
 ...WidthDataFormatPropertyPlaceholderProvider.java |  51 ----
 ...tyTsvDataFormatPropertyPlaceholderProvider.java |  51 ----
 ...rshalDefinitionPropertyPlaceholderProvider.java |  39 ---
 ...idateDefinitionPropertyPlaceholderProvider.java |  39 ---
 .../VerbDefinitionPropertyPlaceholderProvider.java |  63 ----
 .../WhenDefinitionPropertyPlaceholderProvider.java |  39 ---
 ...pointDefinitionPropertyPlaceholderProvider.java |  39 ---
 ...reTapDefinitionPropertyPlaceholderProvider.java |  59 ----
 ...urityDataFormatPropertyPlaceholderProvider.java |  57 ----
 ...nizerExpressionPropertyPlaceholderProvider.java |  43 ---
 ...XPathExpressionPropertyPlaceholderProvider.java |  51 ----
 ...QueryExpressionPropertyPlaceholderProvider.java |  45 ---
 ...treamDataFormatPropertyPlaceholderProvider.java |  49 ----
 ...mlRpcDataFormatPropertyPlaceholderProvider.java |  39 ---
 .../YAMLDataFormatPropertyPlaceholderProvider.java |  49 ----
 ...laterDataFormatPropertyPlaceholderProvider.java |  39 ---
 ...pFileDataFormatPropertyPlaceholderProvider.java |  39 ---
 .../resources/org/apache/camel/model/saga.json     |   4 +-
 .../org/apache/camel/builder/RouteBuilder.java     |   2 +-
 .../org/apache/camel/builder/SimpleBuilder.java    |   4 +-
 .../apache/camel/model/DataFormatDefinition.java   |  22 +-
 .../DefinitionPropertyPlaceholderConfigurer.java   |  53 ----
 .../model/InterceptSendToEndpointDefinition.java   |   1 -
 .../apache/camel/model/LoadBalancerDefinition.java |  19 +-
 .../apache/camel/model/MulticastDefinition.java    |  42 ++-
 .../apache/camel/model/OnExceptionDefinition.java  |   6 +-
 .../camel/model/OptionalIdentifiedDefinition.java  |   2 +-
 .../apache/camel/model/OtherAttributesAware.java   |  42 ---
 .../apache/camel/model/ProcessorDefinition.java    |  45 +--
 .../camel/model/ProcessorDefinitionHelper.java     | 226 ---------------
 .../model/Resilience4jConfigurationCommon.java     | 120 ++++----
 .../model/Resilience4jConfigurationDefinition.java |  30 +-
 .../apache/camel/model/RouteDefinitionHelper.java  |  27 +-
 .../org/apache/camel/model/SagaDefinition.java     |  29 +-
 .../org/apache/camel/model/SamplingDefinition.java |  45 +--
 .../org/apache/camel/model/SplitDefinition.java    |  79 ++---
 .../org/apache/camel/model/ThrottleDefinition.java |  38 +--
 .../camel/model/config/ResequencerConfig.java      |  22 +-
 .../camel/model/language/ExpressionDefinition.java |  19 +-
 .../apache/camel/model/rest/RestDefinition.java    |  18 +-
 .../org/apache/camel/reifier/AbstractReifier.java  |  64 ++--
 .../org/apache/camel/reifier/AggregateReifier.java |  84 +++---
 .../java/org/apache/camel/reifier/BeanReifier.java |   8 +-
 .../org/apache/camel/reifier/ChoiceReifier.java    |  12 +-
 .../apache/camel/reifier/ClaimCheckReifier.java    |  13 +-
 .../apache/camel/reifier/ConvertBodyReifier.java   |  22 +-
 .../org/apache/camel/reifier/DelayReifier.java     |   5 +-
 .../apache/camel/reifier/DynamicRouterReifier.java |   4 +-
 .../org/apache/camel/reifier/EnrichReifier.java    |  10 +-
 .../camel/reifier/IdempotentConsumerReifier.java   |  10 +-
 .../reifier/InterceptSendToEndpointReifier.java    |   2 +-
 .../java/org/apache/camel/reifier/LogReifier.java  |   2 +-
 .../java/org/apache/camel/reifier/LoopReifier.java |   4 +-
 .../org/apache/camel/reifier/MulticastReifier.java |  22 +-
 .../apache/camel/reifier/OnCompletionReifier.java  |   8 +-
 .../apache/camel/reifier/OnExceptionReifier.java   |  51 +---
 .../apache/camel/reifier/PollEnrichReifier.java    |  12 +-
 .../org/apache/camel/reifier/ProcessorReifier.java |  78 ++---
 .../apache/camel/reifier/RecipientListReifier.java |  26 +-
 .../apache/camel/reifier/RemoveHeaderReifier.java  |   2 +-
 .../apache/camel/reifier/RemoveHeadersReifier.java |  12 +-
 .../camel/reifier/RemovePropertiesReifier.java     |  12 +-
 .../camel/reifier/RemovePropertyReifier.java       |   2 +-
 .../apache/camel/reifier/ResequenceReifier.java    |  39 +--
 .../org/apache/camel/reifier/RollbackReifier.java  |   4 +-
 .../org/apache/camel/reifier/RouteReifier.java     |   6 +-
 .../apache/camel/reifier/RoutingSlipReifier.java   |   7 +-
 .../java/org/apache/camel/reifier/SagaReifier.java |  26 +-
 .../org/apache/camel/reifier/SamplingReifier.java  |   6 +-
 .../org/apache/camel/reifier/SetHeaderReifier.java |   2 +-
 .../apache/camel/reifier/SetPropertyReifier.java   |   2 +-
 .../java/org/apache/camel/reifier/SortReifier.java |   2 +-
 .../org/apache/camel/reifier/SplitReifier.java     |  23 +-
 .../org/apache/camel/reifier/ThreadsReifier.java   |  10 +-
 .../org/apache/camel/reifier/ThrottleReifier.java  |  14 +-
 .../camel/reifier/ThrowExceptionReifier.java       |  20 +-
 .../org/apache/camel/reifier/ToDynamicReifier.java |   2 +-
 .../org/apache/camel/reifier/WireTapReifier.java   |  20 +-
 .../reifier/dataformat/DataFormatReifier.java      |   9 +-
 .../reifier/errorhandler/ErrorHandlerReifier.java  |  30 +-
 .../camel/reifier/language/ExpressionReifier.java  |  10 +-
 .../reifier/language/SimpleExpressionReifier.java  |   3 +-
 .../loadbalancer/FailoverLoadBalancerReifier.java  |   4 +-
 .../loadbalancer/WeightedLoadBalancerReifier.java  |   2 +-
 .../camel/reifier/rest/RestBindingReifier.java     |  20 +-
 .../transformer/CustomTransformeReifier.java       |  14 +-
 .../transformer/DataFormatTransformeReifier.java   |  10 +-
 .../transformer/EndpointTransformeReifier.java     |  14 +-
 .../reifier/transformer/TransformerReifier.java    |  24 +-
 .../core/xml/AbstractCamelContextFactoryBean.java  |   2 +-
 .../OptionalPropertiesDslInvalidSyntaxTest.java    |  21 +-
 .../properties/OptionalPropertiesDslTest.java      |   3 +-
 .../properties/PropertiesRouteIdTest.java          |   2 +-
 ...RouteWithConstantFieldFromExchangeFailTest.java |   1 +
 .../apache/camel/support/CamelContextHelper.java   |  12 +
 .../org/apache/camel/support/DefaultComponent.java |  15 +-
 .../support/ExpressionToPredicateAdapter.java      |   1 -
 .../camel/support/PropertyBindingSupport.java      |   9 +-
 .../java/org/apache/camel/xml/in/ModelParser.java  |  66 ++---
 .../java/org/apache/camel/xml/in/BaseParser.java   |  14 +-
 .../packaging/EndpointSchemaGeneratorMojo.java     |  80 -----
 .../maven/packaging/PackageDataFormatMojo.java     |   3 -
 .../packaging/PropertyPlaceholderGenerator.java    | 176 -----------
 .../camel/maven/packaging/SchemaGeneratorMojo.java |  73 +----
 243 files changed, 741 insertions(+), 8480 deletions(-)

diff --git a/components/camel-hystrix/src/main/java/org/apache/camel/component/hystrix/processor/HystrixReifier.java b/components/camel-hystrix/src/main/java/org/apache/camel/component/hystrix/processor/HystrixReifier.java
index ce3b6f6..c03b2ad 100644
--- a/components/camel-hystrix/src/main/java/org/apache/camel/component/hystrix/processor/HystrixReifier.java
+++ b/components/camel-hystrix/src/main/java/org/apache/camel/component/hystrix/processor/HystrixReifier.java
@@ -94,7 +94,7 @@ public class HystrixReifier extends ProcessorReifier<CircuitBreakerDefinition> {
 
         // create setter for fallback via network
         HystrixCommand.Setter fallbackSetter = null;
-        boolean fallbackViaNetwork = definition.getOnFallback() != null && parseBoolean(definition.getOnFallback().getFallbackViaNetwork());
+        boolean fallbackViaNetwork = definition.getOnFallback() != null && parseBoolean(definition.getOnFallback().getFallbackViaNetwork(), false);
         if (fallbackViaNetwork) {
             // use a different thread pool that is for fallback (should never use the same thread pool as the regular command)
             HystrixThreadPoolKey tpFallbackKey = HystrixThreadPoolKey.Factory.asKey(threadPoolKey + "-fallback");
@@ -224,7 +224,7 @@ public class HystrixReifier extends ProcessorReifier<CircuitBreakerDefinition> {
         // Extract properties from referenced configuration, the one configured
         // on camel context takes the precedence over those in the registry
         if (definition.getConfigurationRef() != null) {
-            final String ref = definition.getConfigurationRef();
+            final String ref = parseString(definition.getConfigurationRef());
 
             loadProperties(camelContext, properties, Suppliers.firstNotNull(
                 () -> camelContext.getExtension(Model.class).getHystrixConfiguration(ref),
diff --git a/components/camel-resilience4j/src/main/java/org/apache/camel/component/resilience4j/ResilienceReifier.java b/components/camel-resilience4j/src/main/java/org/apache/camel/component/resilience4j/ResilienceReifier.java
index 6eb6c27..ffbc8ae 100644
--- a/components/camel-resilience4j/src/main/java/org/apache/camel/component/resilience4j/ResilienceReifier.java
+++ b/components/camel-resilience4j/src/main/java/org/apache/camel/component/resilience4j/ResilienceReifier.java
@@ -57,7 +57,7 @@ public class ResilienceReifier extends ProcessorReifier<CircuitBreakerDefinition
         if (definition.getOnFallback() != null) {
             fallback = ProcessorReifier.reifier(routeContext, definition.getOnFallback()).createProcessor();
         }
-        boolean fallbackViaNetwork = definition.getOnFallback() != null && parseBoolean(definition.getOnFallback().getFallbackViaNetwork());
+        boolean fallbackViaNetwork = definition.getOnFallback() != null && parseBoolean(definition.getOnFallback().getFallbackViaNetwork(), false);
         if (fallbackViaNetwork) {
             throw new UnsupportedOperationException("camel-resilience4j does not support onFallbackViaNetwork");
         }
@@ -70,7 +70,7 @@ public class ResilienceReifier extends ProcessorReifier<CircuitBreakerDefinition
         configureTimeoutExecutorService(answer, routeContext, config);
         // using any existing circuit breakers?
         if (config.getCircuitBreakerRef() != null) {
-            CircuitBreaker cb = CamelContextHelper.mandatoryLookup(routeContext.getCamelContext(), config.getCircuitBreakerRef(), CircuitBreaker.class);
+            CircuitBreaker cb = CamelContextHelper.mandatoryLookup(routeContext.getCamelContext(), parseString(config.getCircuitBreakerRef()), CircuitBreaker.class);
             answer.setCircuitBreaker(cb);
         }
         return answer;
@@ -79,70 +79,70 @@ public class ResilienceReifier extends ProcessorReifier<CircuitBreakerDefinition
     private CircuitBreakerConfig configureCircuitBreaker(Resilience4jConfigurationCommon config) {
         CircuitBreakerConfig.Builder builder = CircuitBreakerConfig.custom();
         if (config.getAutomaticTransitionFromOpenToHalfOpenEnabled() != null) {
-            builder.automaticTransitionFromOpenToHalfOpenEnabled(config.getAutomaticTransitionFromOpenToHalfOpenEnabled());
+            builder.automaticTransitionFromOpenToHalfOpenEnabled(parseBoolean(config.getAutomaticTransitionFromOpenToHalfOpenEnabled()));
         }
         if (config.getFailureRateThreshold() != null) {
-            builder.failureRateThreshold(config.getFailureRateThreshold());
+            builder.failureRateThreshold(parseFloat(config.getFailureRateThreshold()));
         }
         if (config.getMinimumNumberOfCalls() != null) {
-            builder.minimumNumberOfCalls(config.getMinimumNumberOfCalls());
+            builder.minimumNumberOfCalls(parseInt(config.getMinimumNumberOfCalls()));
         }
         if (config.getPermittedNumberOfCallsInHalfOpenState() != null) {
-            builder.permittedNumberOfCallsInHalfOpenState(config.getPermittedNumberOfCallsInHalfOpenState());
+            builder.permittedNumberOfCallsInHalfOpenState(parseInt(config.getPermittedNumberOfCallsInHalfOpenState()));
         }
         if (config.getSlidingWindowSize() != null) {
-            builder.slidingWindowSize(config.getSlidingWindowSize());
+            builder.slidingWindowSize(parseInt(config.getSlidingWindowSize()));
         }
         if (config.getSlidingWindowType() != null) {
             builder.slidingWindowType(CircuitBreakerConfig.SlidingWindowType.valueOf(config.getSlidingWindowType()));
         }
         if (config.getSlowCallDurationThreshold() != null) {
-            builder.slowCallDurationThreshold(Duration.ofSeconds(config.getSlowCallDurationThreshold()));
+            builder.slowCallDurationThreshold(Duration.ofSeconds(parseLong(config.getSlowCallDurationThreshold())));
         }
         if (config.getSlowCallRateThreshold() != null) {
-            builder.slowCallRateThreshold(config.getSlowCallRateThreshold());
+            builder.slowCallRateThreshold(parseFloat(config.getSlowCallRateThreshold()));
         }
         if (config.getWaitDurationInOpenState() != null) {
-            builder.waitDurationInOpenState(Duration.ofSeconds(config.getWaitDurationInOpenState()));
+            builder.waitDurationInOpenState(Duration.ofSeconds(parseLong(config.getWaitDurationInOpenState())));
         }
         if (config.getWritableStackTraceEnabled() != null) {
-            builder.writableStackTraceEnabled(config.getWritableStackTraceEnabled());
+            builder.writableStackTraceEnabled(parseBoolean(config.getWritableStackTraceEnabled()));
         }
         return builder.build();
     }
 
     private BulkheadConfig configureBulkHead(Resilience4jConfigurationCommon config) {
-        if (config.getBulkheadEnabled() == null || !config.getBulkheadEnabled()) {
+        if (parseBoolean(config.getBulkheadEnabled(), true)) {
             return null;
         }
 
         BulkheadConfig.Builder builder = BulkheadConfig.custom();
         if (config.getBulkheadMaxConcurrentCalls() != null) {
-            builder.maxConcurrentCalls(config.getBulkheadMaxConcurrentCalls());
+            builder.maxConcurrentCalls(parseInt(config.getBulkheadMaxConcurrentCalls()));
         }
         if (config.getBulkheadMaxWaitDuration() != null) {
-            builder.maxWaitDuration(Duration.ofMillis(config.getBulkheadMaxWaitDuration()));
+            builder.maxWaitDuration(Duration.ofMillis(parseLong(config.getBulkheadMaxWaitDuration())));
         }
         return builder.build();
     }
 
     private TimeLimiterConfig configureTimeLimiter(Resilience4jConfigurationCommon config) {
-        if (config.getTimeoutEnabled() == null || !config.getTimeoutEnabled()) {
+        if (parseBoolean(config.getTimeoutEnabled(), true)) {
             return null;
         }
 
         TimeLimiterConfig.Builder builder = TimeLimiterConfig.custom();
         if (config.getTimeoutDuration() != null) {
-            builder.timeoutDuration(Duration.ofMillis(config.getTimeoutDuration()));
+            builder.timeoutDuration(Duration.ofMillis(parseLong(config.getTimeoutDuration())));
         }
         if (config.getTimeoutCancelRunningFuture() != null) {
-            builder.cancelRunningFuture(config.getTimeoutCancelRunningFuture());
+            builder.cancelRunningFuture(parseBoolean(config.getTimeoutCancelRunningFuture()));
         }
         return builder.build();
     }
 
     private void configureTimeoutExecutorService(ResilienceProcessor processor, RouteContext routeContext, Resilience4jConfigurationCommon config) {
-        if (config.getTimeoutEnabled() == null || !config.getTimeoutEnabled()) {
+        if (parseBoolean(config.getTimeoutEnabled(), true)) {
             return;
         }
 
diff --git a/components/camel-spring/src/test/resources/org/apache/camel/component/properties/SpringOptionalPropertiesDslTest.xml b/components/camel-spring/src/test/resources/org/apache/camel/component/properties/SpringOptionalPropertiesDslTest.xml
index 9cd6b5b..c0d6f21 100644
--- a/components/camel-spring/src/test/resources/org/apache/camel/component/properties/SpringOptionalPropertiesDslTest.xml
+++ b/components/camel-spring/src/test/resources/org/apache/camel/component/properties/SpringOptionalPropertiesDslTest.xml
@@ -42,7 +42,7 @@
             <from uri="direct:start"/>
             <!-- use prop namespace, to define a property placeholder, which maps to
                  option stopOnException={{stop}} -->
-            <multicast prop:stopOnException="stop">
+            <multicast stopOnException="{{stop}}">
                 <to uri="mock:a"/>
                 <throwException ref="damn"/>
                 <to uri="mock:b"/>
diff --git a/components/camel-spring/src/test/resources/org/apache/camel/component/properties/SpringOptionalPropertiesDslTokenizeTest.xml b/components/camel-spring/src/test/resources/org/apache/camel/component/properties/SpringOptionalPropertiesDslTokenizeTest.xml
index ec20873..f57d6b8 100644
--- a/components/camel-spring/src/test/resources/org/apache/camel/component/properties/SpringOptionalPropertiesDslTokenizeTest.xml
+++ b/components/camel-spring/src/test/resources/org/apache/camel/component/properties/SpringOptionalPropertiesDslTokenizeTest.xml
@@ -34,7 +34,7 @@
     <route>
       <from uri="direct:start"/>
       <split>
-        <tokenize token="," prop:group="onlytwo"/>
+        <tokenize token="," group="{{onlytwo}}"/>
         <to uri="mock:a"/>
       </split>
     </route>
diff --git a/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringRecipientListParallelOptionalPropertiesTest.xml b/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringRecipientListParallelOptionalPropertiesTest.xml
index f16e2ac..4d0e995 100644
--- a/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringRecipientListParallelOptionalPropertiesTest.xml
+++ b/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringRecipientListParallelOptionalPropertiesTest.xml
@@ -33,14 +33,14 @@
 
     <route>
       <from uri="direct:start"/>
-      <recipientList prop:parallelProcessing="concurrent">
+      <recipientList parallelProcessing="{{concurrent}}">
         <header>foo</header>
       </recipientList>
     </route>
 
     <route>
       <from uri="direct:a"/>
-      <setHeader name="foo" prop:name="theRealHeader">
+      <setHeader name="{{theRealHeader}}">
         <constant>1000</constant>
       </setHeader>
       <delay>
diff --git a/core/camel-api/src/main/java/org/apache/camel/spi/GeneratedPropertyConfigurer.java b/core/camel-api/src/main/java/org/apache/camel/spi/GeneratedPropertyConfigurer.java
index 338a2a8..d0dfc95 100644
--- a/core/camel-api/src/main/java/org/apache/camel/spi/GeneratedPropertyConfigurer.java
+++ b/core/camel-api/src/main/java/org/apache/camel/spi/GeneratedPropertyConfigurer.java
@@ -16,23 +16,9 @@
  */
 package org.apache.camel.spi;
 
-import org.apache.camel.CamelContext;
-
 /**
  * A auto generated {@link PropertyConfigurer} for fast configuration of Camel components & endpoints.
  */
 public interface GeneratedPropertyConfigurer extends PropertyConfigurer {
 
-    /**
-     * Configures the property
-     *
-     * @param camelContext  the Camel context
-     * @param target        the target instance such as {@link org.apache.camel.Endpoint} or {@link org.apache.camel.Component}.
-     * @param name          the property name
-     * @param value         the property value
-     * @param ignoreCase    whether to ignore case for matching the property name
-     * @return <tt>true</tt> if the configurer configured the property, <tt>false</tt> if the property does not exists
-     */
-    boolean configure(CamelContext camelContext, Object target, String name, Object value, boolean ignoreCase);
-
 }
diff --git a/core/camel-api/src/main/java/org/apache/camel/spi/PropertyConfigurer.java b/core/camel-api/src/main/java/org/apache/camel/spi/PropertyConfigurer.java
index eab6ef6..8e2c674 100644
--- a/core/camel-api/src/main/java/org/apache/camel/spi/PropertyConfigurer.java
+++ b/core/camel-api/src/main/java/org/apache/camel/spi/PropertyConfigurer.java
@@ -16,6 +16,8 @@
  */
 package org.apache.camel.spi;
 
+import org.apache.camel.CamelContext;
+
 /**
  * A marker interface to identify the object as being configurable via a configurer class.
  * <p/>
@@ -24,4 +26,16 @@ package org.apache.camel.spi;
  */
 public interface PropertyConfigurer {
 
+    /**
+     * Configures the property
+     *
+     * @param camelContext  the Camel context
+     * @param target        the target instance such as {@link org.apache.camel.Endpoint} or {@link org.apache.camel.Component}.
+     * @param name          the property name
+     * @param value         the property value
+     * @param ignoreCase    whether to ignore case for matching the property name
+     * @return <tt>true</tt> if the configurer configured the property, <tt>false</tt> if the property does not exists
+     */
+    boolean configure(CamelContext camelContext, Object target, String name, Object value, boolean ignoreCase);
+
 }
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
deleted file mode 100644
index 80b4c3d..0000000
--- a/core/camel-api/src/main/java/org/apache/camel/spi/PropertyPlaceholderConfigurer.java
+++ /dev/null
@@ -1,47 +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.spi;
-
-import java.util.Map;
-import java.util.function.Consumer;
-import java.util.function.Supplier;
-
-import org.apache.camel.CamelContext;
-
-/**
- * A configurer for properties on a given object.
- * <p/>
- * This is used in Camel to have fast property configuration of Camel EIP patterns, which
- * are using property placeholders (eg {{foo}} style).
- */
-public interface PropertyPlaceholderConfigurer extends PropertyConfigurer {
-
-    /**
-     * 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);
-
-}
diff --git a/core/camel-base/src/main/java/org/apache/camel/impl/engine/AbstractCamelContext.java b/core/camel-base/src/main/java/org/apache/camel/impl/engine/AbstractCamelContext.java
index 16af875..c8c7929 100644
--- a/core/camel-base/src/main/java/org/apache/camel/impl/engine/AbstractCamelContext.java
+++ b/core/camel-base/src/main/java/org/apache/camel/impl/engine/AbstractCamelContext.java
@@ -50,6 +50,7 @@ import org.apache.camel.Consumer;
 import org.apache.camel.ConsumerTemplate;
 import org.apache.camel.Endpoint;
 import org.apache.camel.ErrorHandlerFactory;
+import org.apache.camel.ExchangeConstantProvider;
 import org.apache.camel.ExtendedCamelContext;
 import org.apache.camel.ExtendedStartupListener;
 import org.apache.camel.FailedToStartRouteException;
@@ -1674,6 +1675,18 @@ public abstract class AbstractCamelContext extends ServiceSupport implements Ext
             LOG.debug("Resolved text: {} -> {}", text, answer);
             return answer;
         }
+        // is the value a known field (currently we only support
+        // constants from Exchange.class)
+        if (text != null && text.startsWith("Exchange.")) {
+            String field = StringHelper.after(text, "Exchange.");
+            String constant = ExchangeConstantProvider.lookup(field);
+            if (constant != null) {
+                LOG.debug("Resolved constant: {} -> {}", text, constant);
+                return constant;
+            } else {
+                throw new IllegalArgumentException("Constant field with name: " + field + " not found on Exchange.class");
+            }
+        }
 
         // return original text as is
         return text;
diff --git a/core/camel-base/src/main/java/org/apache/camel/language/tokenizer/TokenizeLanguage.java b/core/camel-base/src/main/java/org/apache/camel/language/tokenizer/TokenizeLanguage.java
index 8980751..ed10be5 100644
--- a/core/camel-base/src/main/java/org/apache/camel/language/tokenizer/TokenizeLanguage.java
+++ b/core/camel-base/src/main/java/org/apache/camel/language/tokenizer/TokenizeLanguage.java
@@ -20,8 +20,8 @@ import org.apache.camel.CamelContext;
 import org.apache.camel.Expression;
 import org.apache.camel.IsSingleton;
 import org.apache.camel.Predicate;
-import org.apache.camel.spi.GeneratedPropertyConfigurer;
 import org.apache.camel.spi.Language;
+import org.apache.camel.spi.PropertyConfigurer;
 import org.apache.camel.support.ExpressionToPredicateAdapter;
 import org.apache.camel.support.builder.ExpressionBuilder;
 import org.apache.camel.support.component.PropertyConfigurerSupport;
@@ -41,7 +41,7 @@ import org.apache.camel.util.ObjectHelper;
  * And the <tt>xml</tt> mode supports the <tt>inheritNamespaceTagName</tt> option.
  */
 @org.apache.camel.spi.annotations.Language("tokenize")
-public class TokenizeLanguage implements Language, IsSingleton, GeneratedPropertyConfigurer {
+public class TokenizeLanguage implements Language, IsSingleton, PropertyConfigurer {
 
     private String token;
     private String endToken;
diff --git a/core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/ASN1DataFormatPropertyPlaceholderProvider.java b/core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/ASN1DataFormatPropertyPlaceholderProvider.java
deleted file mode 100644
index 0085c15..0000000
--- a/core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/ASN1DataFormatPropertyPlaceholderProvider.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/* Generated by camel build tools - do NOT edit this file! */
-package org.apache.camel.model.placeholder;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.function.Consumer;
-import java.util.function.Supplier;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.model.dataformat.ASN1DataFormat;
-import org.apache.camel.spi.PropertyPlaceholderConfigurer;
-
-/**
- * Generated by camel build tools - do NOT edit this file!
- */
-public class ASN1DataFormatPropertyPlaceholderProvider implements PropertyPlaceholderConfigurer {
-
-    private final Map<String, Supplier<String>> readPlaceholders = new HashMap<>();
-    private final Map<String, Consumer<String>> writePlaceholders = new HashMap<>();
-
-    public ASN1DataFormatPropertyPlaceholderProvider(Object obj) {
-        ASN1DataFormat definition = (ASN1DataFormat) obj;
-
-        readPlaceholders.put("clazzName", definition::getClazzName);
-        writePlaceholders.put("clazzName", definition::setClazzName);
-        readPlaceholders.put("id", definition::getId);
-        writePlaceholders.put("id", definition::setId);
-    }
-
-    @Override
-    public Map<String, Supplier<String>> getReadPropertyPlaceholderOptions(CamelContext camelContext) {
-        return readPlaceholders;
-    }
-
-    @Override
-    public Map<String, Consumer<String>> getWritePropertyPlaceholderOptions(CamelContext camelContext) {
-        return writePlaceholders;
-    }
-
-}
-
diff --git a/core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/AggregateDefinitionPropertyPlaceholderProvider.java b/core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/AggregateDefinitionPropertyPlaceholderProvider.java
deleted file mode 100644
index 03ad0fa..0000000
--- a/core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/AggregateDefinitionPropertyPlaceholderProvider.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/* Generated by camel build tools - do NOT edit this file! */
-package org.apache.camel.model.placeholder;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.function.Consumer;
-import java.util.function.Supplier;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.model.AggregateDefinition;
-import org.apache.camel.spi.PropertyPlaceholderConfigurer;
-
-/**
- * Generated by camel build tools - do NOT edit this file!
- */
-public class AggregateDefinitionPropertyPlaceholderProvider implements PropertyPlaceholderConfigurer {
-
-    private final Map<String, Supplier<String>> readPlaceholders = new HashMap<>();
-    private final Map<String, Consumer<String>> writePlaceholders = new HashMap<>();
-
-    public AggregateDefinitionPropertyPlaceholderProvider(Object obj) {
-        AggregateDefinition definition = (AggregateDefinition) obj;
-
-        readPlaceholders.put("executorServiceRef", definition::getExecutorServiceRef);
-        writePlaceholders.put("executorServiceRef", definition::setExecutorServiceRef);
-        readPlaceholders.put("timeoutCheckerExecutorServiceRef", definition::getTimeoutCheckerExecutorServiceRef);
-        writePlaceholders.put("timeoutCheckerExecutorServiceRef", definition::setTimeoutCheckerExecutorServiceRef);
-        readPlaceholders.put("aggregationRepositoryRef", definition::getAggregationRepositoryRef);
-        writePlaceholders.put("aggregationRepositoryRef", definition::setAggregationRepositoryRef);
-        readPlaceholders.put("strategyRef", definition::getStrategyRef);
-        writePlaceholders.put("strategyRef", definition::setStrategyRef);
-        readPlaceholders.put("strategyMethodName", definition::getStrategyMethodName);
-        writePlaceholders.put("strategyMethodName", definition::setStrategyMethodName);
-        readPlaceholders.put("aggregateControllerRef", definition::getAggregateControllerRef);
-        writePlaceholders.put("aggregateControllerRef", definition::setAggregateControllerRef);
-        readPlaceholders.put("id", definition::getId);
-        writePlaceholders.put("id", definition::setId);
-    }
-
-    @Override
-    public Map<String, Supplier<String>> getReadPropertyPlaceholderOptions(CamelContext camelContext) {
-        return readPlaceholders;
-    }
-
-    @Override
-    public Map<String, Consumer<String>> getWritePropertyPlaceholderOptions(CamelContext camelContext) {
-        return writePlaceholders;
-    }
-
-}
-
diff --git a/core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/Any23DataFormatPropertyPlaceholderProvider.java b/core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/Any23DataFormatPropertyPlaceholderProvider.java
deleted file mode 100644
index 1f955c9..0000000
--- a/core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/Any23DataFormatPropertyPlaceholderProvider.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/* Generated by camel build tools - do NOT edit this file! */
-package org.apache.camel.model.placeholder;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.function.Consumer;
-import java.util.function.Supplier;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.model.dataformat.Any23DataFormat;
-import org.apache.camel.spi.PropertyPlaceholderConfigurer;
-
-/**
- * Generated by camel build tools - do NOT edit this file!
- */
-public class Any23DataFormatPropertyPlaceholderProvider implements PropertyPlaceholderConfigurer {
-
-    private final Map<String, Supplier<String>> readPlaceholders = new HashMap<>();
-    private final Map<String, Consumer<String>> writePlaceholders = new HashMap<>();
-
-    public Any23DataFormatPropertyPlaceholderProvider(Object obj) {
-        Any23DataFormat definition = (Any23DataFormat) obj;
-
-        readPlaceholders.put("baseURI", definition::getBaseURI);
-        writePlaceholders.put("baseURI", definition::setBaseURI);
-        readPlaceholders.put("id", definition::getId);
-        writePlaceholders.put("id", definition::setId);
-    }
-
-    @Override
-    public Map<String, Supplier<String>> getReadPropertyPlaceholderOptions(CamelContext camelContext) {
-        return readPlaceholders;
-    }
-
-    @Override
-    public Map<String, Consumer<String>> getWritePropertyPlaceholderOptions(CamelContext camelContext) {
-        return writePlaceholders;
-    }
-
-}
-
diff --git a/core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/AvroDataFormatPropertyPlaceholderProvider.java b/core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/AvroDataFormatPropertyPlaceholderProvider.java
deleted file mode 100644
index 5974c4f..0000000
--- a/core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/AvroDataFormatPropertyPlaceholderProvider.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/* Generated by camel build tools - do NOT edit this file! */
-package org.apache.camel.model.placeholder;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.function.Consumer;
-import java.util.function.Supplier;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.model.dataformat.AvroDataFormat;
-import org.apache.camel.spi.PropertyPlaceholderConfigurer;
-
-/**
- * Generated by camel build tools - do NOT edit this file!
- */
-public class AvroDataFormatPropertyPlaceholderProvider implements PropertyPlaceholderConfigurer {
-
-    private final Map<String, Supplier<String>> readPlaceholders = new HashMap<>();
-    private final Map<String, Consumer<String>> writePlaceholders = new HashMap<>();
-
-    public AvroDataFormatPropertyPlaceholderProvider(Object obj) {
-        AvroDataFormat definition = (AvroDataFormat) obj;
-
-        readPlaceholders.put("instanceClassName", definition::getInstanceClassName);
-        writePlaceholders.put("instanceClassName", definition::setInstanceClassName);
-        readPlaceholders.put("id", definition::getId);
-        writePlaceholders.put("id", definition::setId);
-    }
-
-    @Override
-    public Map<String, Supplier<String>> getReadPropertyPlaceholderOptions(CamelContext camelContext) {
-        return readPlaceholders;
-    }
-
-    @Override
-    public Map<String, Consumer<String>> getWritePropertyPlaceholderOptions(CamelContext camelContext) {
-        return writePlaceholders;
-    }
-
-}
-
diff --git a/core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/BarcodeDataFormatPropertyPlaceholderProvider.java b/core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/BarcodeDataFormatPropertyPlaceholderProvider.java
deleted file mode 100644
index e67ebce..0000000
--- a/core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/BarcodeDataFormatPropertyPlaceholderProvider.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/* Generated by camel build tools - do NOT edit this file! */
-package org.apache.camel.model.placeholder;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.function.Consumer;
-import java.util.function.Supplier;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.model.dataformat.BarcodeDataFormat;
-import org.apache.camel.spi.PropertyPlaceholderConfigurer;
-
-/**
- * Generated by camel build tools - do NOT edit this file!
- */
-public class BarcodeDataFormatPropertyPlaceholderProvider implements PropertyPlaceholderConfigurer {
-
-    private final Map<String, Supplier<String>> readPlaceholders = new HashMap<>();
-    private final Map<String, Consumer<String>> writePlaceholders = new HashMap<>();
-
-    public BarcodeDataFormatPropertyPlaceholderProvider(Object obj) {
-        BarcodeDataFormat definition = (BarcodeDataFormat) obj;
-
-        readPlaceholders.put("imageType", definition::getImageType);
-        writePlaceholders.put("imageType", definition::setImageType);
-        readPlaceholders.put("barcodeFormat", definition::getBarcodeFormat);
-        writePlaceholders.put("barcodeFormat", definition::setBarcodeFormat);
-        readPlaceholders.put("id", definition::getId);
-        writePlaceholders.put("id", definition::setId);
-    }
-
-    @Override
-    public Map<String, Supplier<String>> getReadPropertyPlaceholderOptions(CamelContext camelContext) {
-        return readPlaceholders;
-    }
-
-    @Override
-    public Map<String, Consumer<String>> getWritePropertyPlaceholderOptions(CamelContext camelContext) {
-        return writePlaceholders;
-    }
-
-}
-
diff --git a/core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/Base64DataFormatPropertyPlaceholderProvider.java b/core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/Base64DataFormatPropertyPlaceholderProvider.java
deleted file mode 100644
index 012913d..0000000
--- a/core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/Base64DataFormatPropertyPlaceholderProvider.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/* Generated by camel build tools - do NOT edit this file! */
-package org.apache.camel.model.placeholder;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.function.Consumer;
-import java.util.function.Supplier;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.model.dataformat.Base64DataFormat;
-import org.apache.camel.spi.PropertyPlaceholderConfigurer;
-
-/**
- * Generated by camel build tools - do NOT edit this file!
- */
-public class Base64DataFormatPropertyPlaceholderProvider implements PropertyPlaceholderConfigurer {
-
-    private final Map<String, Supplier<String>> readPlaceholders = new HashMap<>();
-    private final Map<String, Consumer<String>> writePlaceholders = new HashMap<>();
-
-    public Base64DataFormatPropertyPlaceholderProvider(Object obj) {
-        Base64DataFormat definition = (Base64DataFormat) obj;
-
-        readPlaceholders.put("lineSeparator", definition::getLineSeparator);
-        writePlaceholders.put("lineSeparator", definition::setLineSeparator);
-        readPlaceholders.put("id", definition::getId);
-        writePlaceholders.put("id", definition::setId);
-    }
-
-    @Override
-    public Map<String, Supplier<String>> getReadPropertyPlaceholderOptions(CamelContext camelContext) {
-        return readPlaceholders;
-    }
-
-    @Override
-    public Map<String, Consumer<String>> getWritePropertyPlaceholderOptions(CamelContext camelContext) {
-        return writePlaceholders;
-    }
-
-}
-
diff --git a/core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/BeanDefinitionPropertyPlaceholderProvider.java b/core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/BeanDefinitionPropertyPlaceholderProvider.java
deleted file mode 100644
index 475ebc9..0000000
--- a/core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/BeanDefinitionPropertyPlaceholderProvider.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/* Generated by camel build tools - do NOT edit this file! */
-package org.apache.camel.model.placeholder;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.function.Consumer;
-import java.util.function.Supplier;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.model.BeanDefinition;
-import org.apache.camel.spi.PropertyPlaceholderConfigurer;
-
-/**
- * Generated by camel build tools - do NOT edit this file!
- */
-public class BeanDefinitionPropertyPlaceholderProvider implements PropertyPlaceholderConfigurer {
-
-    private final Map<String, Supplier<String>> readPlaceholders = new HashMap<>();
-    private final Map<String, Consumer<String>> writePlaceholders = new HashMap<>();
-
-    public BeanDefinitionPropertyPlaceholderProvider(Object obj) {
-        BeanDefinition definition = (BeanDefinition) obj;
-
-        readPlaceholders.put("ref", definition::getRef);
-        writePlaceholders.put("ref", definition::setRef);
-        readPlaceholders.put("method", definition::getMethod);
-        writePlaceholders.put("method", definition::setMethod);
-        readPlaceholders.put("beanType", definition::getBeanType);
-        writePlaceholders.put("beanType", definition::setBeanType);
-        readPlaceholders.put("scope", definition::getScope);
-        writePlaceholders.put("scope", definition::setScope);
-        readPlaceholders.put("id", definition::getId);
-        writePlaceholders.put("id", definition::setId);
-    }
-
-    @Override
-    public Map<String, Supplier<String>> getReadPropertyPlaceholderOptions(CamelContext camelContext) {
-        return readPlaceholders;
-    }
-
-    @Override
-    public Map<String, Consumer<String>> getWritePropertyPlaceholderOptions(CamelContext camelContext) {
-        return writePlaceholders;
-    }
-
-}
-
diff --git a/core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/BeanioDataFormatPropertyPlaceholderProvider.java b/core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/BeanioDataFormatPropertyPlaceholderProvider.java
deleted file mode 100644
index 6cfc63d..0000000
--- a/core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/BeanioDataFormatPropertyPlaceholderProvider.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/* Generated by camel build tools - do NOT edit this file! */
-package org.apache.camel.model.placeholder;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.function.Consumer;
-import java.util.function.Supplier;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.model.dataformat.BeanioDataFormat;
-import org.apache.camel.spi.PropertyPlaceholderConfigurer;
-
-/**
- * Generated by camel build tools - do NOT edit this file!
- */
-public class BeanioDataFormatPropertyPlaceholderProvider implements PropertyPlaceholderConfigurer {
-
-    private final Map<String, Supplier<String>> readPlaceholders = new HashMap<>();
-    private final Map<String, Consumer<String>> writePlaceholders = new HashMap<>();
-
-    public BeanioDataFormatPropertyPlaceholderProvider(Object obj) {
-        BeanioDataFormat definition = (BeanioDataFormat) obj;
-
-        readPlaceholders.put("mapping", definition::getMapping);
-        writePlaceholders.put("mapping", definition::setMapping);
-        readPlaceholders.put("streamName", definition::getStreamName);
-        writePlaceholders.put("streamName", definition::setStreamName);
-        readPlaceholders.put("encoding", definition::getEncoding);
-        writePlaceholders.put("encoding", definition::setEncoding);
-        readPlaceholders.put("beanReaderErrorHandlerType", definition::getBeanReaderErrorHandlerType);
-        writePlaceholders.put("beanReaderErrorHandlerType", definition::setBeanReaderErrorHandlerType);
-        readPlaceholders.put("id", definition::getId);
-        writePlaceholders.put("id", definition::setId);
-    }
-
-    @Override
-    public Map<String, Supplier<String>> getReadPropertyPlaceholderOptions(CamelContext camelContext) {
-        return readPlaceholders;
-    }
-
-    @Override
-    public Map<String, Consumer<String>> getWritePropertyPlaceholderOptions(CamelContext camelContext) {
-        return writePlaceholders;
-    }
-
-}
-
diff --git a/core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/BindyDataFormatPropertyPlaceholderProvider.java b/core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/BindyDataFormatPropertyPlaceholderProvider.java
deleted file mode 100644
index 19dc357..0000000
--- a/core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/BindyDataFormatPropertyPlaceholderProvider.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/* Generated by camel build tools - do NOT edit this file! */
-package org.apache.camel.model.placeholder;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.function.Consumer;
-import java.util.function.Supplier;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.model.dataformat.BindyDataFormat;
-import org.apache.camel.spi.PropertyPlaceholderConfigurer;
-
-/**
- * Generated by camel build tools - do NOT edit this file!
- */
-public class BindyDataFormatPropertyPlaceholderProvider implements PropertyPlaceholderConfigurer {
-
-    private final Map<String, Supplier<String>> readPlaceholders = new HashMap<>();
-    private final Map<String, Consumer<String>> writePlaceholders = new HashMap<>();
-
-    public BindyDataFormatPropertyPlaceholderProvider(Object obj) {
-        BindyDataFormat definition = (BindyDataFormat) obj;
-
-        readPlaceholders.put("classType", definition::getClassTypeAsString);
-        writePlaceholders.put("classType", definition::setClassTypeAsString);
-        readPlaceholders.put("locale", definition::getLocale);
-        writePlaceholders.put("locale", definition::setLocale);
-        readPlaceholders.put("id", definition::getId);
-        writePlaceholders.put("id", definition::setId);
-    }
-
-    @Override
-    public Map<String, Supplier<String>> getReadPropertyPlaceholderOptions(CamelContext camelContext) {
-        return readPlaceholders;
-    }
-
-    @Override
-    public Map<String, Consumer<String>> getWritePropertyPlaceholderOptions(CamelContext camelContext) {
-        return writePlaceholders;
-    }
-
-}
-
diff --git a/core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/CBORDataFormatPropertyPlaceholderProvider.java b/core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/CBORDataFormatPropertyPlaceholderProvider.java
deleted file mode 100644
index 8ad634b..0000000
--- a/core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/CBORDataFormatPropertyPlaceholderProvider.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/* Generated by camel build tools - do NOT edit this file! */
-package org.apache.camel.model.placeholder;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.function.Consumer;
-import java.util.function.Supplier;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.model.dataformat.CBORDataFormat;
-import org.apache.camel.spi.PropertyPlaceholderConfigurer;
-
-/**
- * Generated by camel build tools - do NOT edit this file!
- */
-public class CBORDataFormatPropertyPlaceholderProvider implements PropertyPlaceholderConfigurer {
-
-    private final Map<String, Supplier<String>> readPlaceholders = new HashMap<>();
-    private final Map<String, Consumer<String>> writePlaceholders = new HashMap<>();
-
-    public CBORDataFormatPropertyPlaceholderProvider(Object obj) {
-        CBORDataFormat definition = (CBORDataFormat) obj;
-
-        readPlaceholders.put("objectMapper", definition::getObjectMapper);
-        writePlaceholders.put("objectMapper", definition::setObjectMapper);
-        readPlaceholders.put("unmarshalTypeName", definition::getUnmarshalTypeName);
-        writePlaceholders.put("unmarshalTypeName", definition::setUnmarshalTypeName);
-        readPlaceholders.put("collectionTypeName", definition::getCollectionTypeName);
-        writePlaceholders.put("collectionTypeName", definition::setCollectionTypeName);
-        readPlaceholders.put("enableFeatures", definition::getEnableFeatures);
-        writePlaceholders.put("enableFeatures", definition::setEnableFeatures);
-        readPlaceholders.put("disableFeatures", definition::getDisableFeatures);
-        writePlaceholders.put("disableFeatures", definition::setDisableFeatures);
-        readPlaceholders.put("id", definition::getId);
-        writePlaceholders.put("id", definition::setId);
-    }
-
-    @Override
-    public Map<String, Supplier<String>> getReadPropertyPlaceholderOptions(CamelContext camelContext) {
-        return readPlaceholders;
-    }
-
-    @Override
-    public Map<String, Consumer<String>> getWritePropertyPlaceholderOptions(CamelContext camelContext) {
-        return writePlaceholders;
-    }
-
-}
-
diff --git a/core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/CatchDefinitionPropertyPlaceholderProvider.java b/core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/CatchDefinitionPropertyPlaceholderProvider.java
deleted file mode 100644
index 1906e72..0000000
--- a/core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/CatchDefinitionPropertyPlaceholderProvider.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Generated by camel build tools - do NOT edit this file! */
-package org.apache.camel.model.placeholder;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.function.Consumer;
-import java.util.function.Supplier;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.model.CatchDefinition;
-import org.apache.camel.spi.PropertyPlaceholderConfigurer;
-
-/**
- * Generated by camel build tools - do NOT edit this file!
- */
-public class CatchDefinitionPropertyPlaceholderProvider implements PropertyPlaceholderConfigurer {
-
-    private final Map<String, Supplier<String>> readPlaceholders = new HashMap<>();
-    private final Map<String, Consumer<String>> writePlaceholders = new HashMap<>();
-
-    public CatchDefinitionPropertyPlaceholderProvider(Object obj) {
-        CatchDefinition definition = (CatchDefinition) obj;
-
-        readPlaceholders.put("id", definition::getId);
-        writePlaceholders.put("id", definition::setId);
-    }
-
-    @Override
-    public Map<String, Supplier<String>> getReadPropertyPlaceholderOptions(CamelContext camelContext) {
-        return readPlaceholders;
-    }
-
-    @Override
-    public Map<String, Consumer<String>> getWritePropertyPlaceholderOptions(CamelContext camelContext) {
-        return writePlaceholders;
-    }
-
-}
-
diff --git a/core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/ChoiceDefinitionPropertyPlaceholderProvider.java b/core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/ChoiceDefinitionPropertyPlaceholderProvider.java
deleted file mode 100644
index 54b0a77..0000000
--- a/core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/ChoiceDefinitionPropertyPlaceholderProvider.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Generated by camel build tools - do NOT edit this file! */
-package org.apache.camel.model.placeholder;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.function.Consumer;
-import java.util.function.Supplier;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.model.ChoiceDefinition;
-import org.apache.camel.spi.PropertyPlaceholderConfigurer;
-
-/**
- * Generated by camel build tools - do NOT edit this file!
- */
-public class ChoiceDefinitionPropertyPlaceholderProvider implements PropertyPlaceholderConfigurer {
-
-    private final Map<String, Supplier<String>> readPlaceholders = new HashMap<>();
-    private final Map<String, Consumer<String>> writePlaceholders = new HashMap<>();
-
-    public ChoiceDefinitionPropertyPlaceholderProvider(Object obj) {
-        ChoiceDefinition definition = (ChoiceDefinition) obj;
-
-        readPlaceholders.put("id", definition::getId);
-        writePlaceholders.put("id", definition::setId);
-    }
-
-    @Override
-    public Map<String, Supplier<String>> getReadPropertyPlaceholderOptions(CamelContext camelContext) {
-        return readPlaceholders;
-    }
-
-    @Override
-    public Map<String, Consumer<String>> getWritePropertyPlaceholderOptions(CamelContext camelContext) {
-        return writePlaceholders;
-    }
-
-}
-
diff --git a/core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/CircuitBreakerDefinitionPropertyPlaceholderProvider.java b/core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/CircuitBreakerDefinitionPropertyPlaceholderProvider.java
deleted file mode 100644
index 4391045..0000000
--- a/core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/CircuitBreakerDefinitionPropertyPlaceholderProvider.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/* Generated by camel build tools - do NOT edit this file! */
-package org.apache.camel.model.placeholder;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.function.Consumer;
-import java.util.function.Supplier;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.model.CircuitBreakerDefinition;
-import org.apache.camel.spi.PropertyPlaceholderConfigurer;
-
-/**
- * Generated by camel build tools - do NOT edit this file!
- */
-public class CircuitBreakerDefinitionPropertyPlaceholderProvider implements PropertyPlaceholderConfigurer {
-
-    private final Map<String, Supplier<String>> readPlaceholders = new HashMap<>();
-    private final Map<String, Consumer<String>> writePlaceholders = new HashMap<>();
-
-    public CircuitBreakerDefinitionPropertyPlaceholderProvider(Object obj) {
-        CircuitBreakerDefinition definition = (CircuitBreakerDefinition) obj;
-
-        readPlaceholders.put("configurationRef", definition::getConfigurationRef);
-        writePlaceholders.put("configurationRef", definition::setConfigurationRef);
-        readPlaceholders.put("id", definition::getId);
-        writePlaceholders.put("id", definition::setId);
-    }
-
-    @Override
-    public Map<String, Supplier<String>> getReadPropertyPlaceholderOptions(CamelContext camelContext) {
-        return readPlaceholders;
-    }
-
-    @Override
-    public Map<String, Consumer<String>> getWritePropertyPlaceholderOptions(CamelContext camelContext) {
-        return writePlaceholders;
-    }
-
-}
-
diff --git a/core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/ClaimCheckDefinitionPropertyPlaceholderProvider.java b/core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/ClaimCheckDefinitionPropertyPlaceholderProvider.java
deleted file mode 100644
index 46776cf..0000000
--- a/core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/ClaimCheckDefinitionPropertyPlaceholderProvider.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/* Generated by camel build tools - do NOT edit this file! */
-package org.apache.camel.model.placeholder;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.function.Consumer;
-import java.util.function.Supplier;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.model.ClaimCheckDefinition;
-import org.apache.camel.spi.PropertyPlaceholderConfigurer;
-
-/**
- * Generated by camel build tools - do NOT edit this file!
- */
-public class ClaimCheckDefinitionPropertyPlaceholderProvider implements PropertyPlaceholderConfigurer {
-
-    private final Map<String, Supplier<String>> readPlaceholders = new HashMap<>();
-    private final Map<String, Consumer<String>> writePlaceholders = new HashMap<>();
-
-    public ClaimCheckDefinitionPropertyPlaceholderProvider(Object obj) {
-        ClaimCheckDefinition definition = (ClaimCheckDefinition) obj;
-
-        readPlaceholders.put("key", definition::getKey);
-        writePlaceholders.put("key", definition::setKey);
-        readPlaceholders.put("filter", definition::getFilter);
-        writePlaceholders.put("filter", definition::setFilter);
-        readPlaceholders.put("strategyRef", definition::getAggregationStrategyRef);
-        writePlaceholders.put("strategyRef", definition::setAggregationStrategyRef);
-        readPlaceholders.put("strategyMethodName", definition::getAggregationStrategyMethodName);
-        writePlaceholders.put("strategyMethodName", definition::setAggregationStrategyMethodName);
-        readPlaceholders.put("id", definition::getId);
-        writePlaceholders.put("id", definition::setId);
-    }
-
-    @Override
-    public Map<String, Supplier<String>> getReadPropertyPlaceholderOptions(CamelContext camelContext) {
-        return readPlaceholders;
-    }
-
-    @Override
-    public Map<String, Consumer<String>> getWritePropertyPlaceholderOptions(CamelContext camelContext) {
-        return writePlaceholders;
-    }
-
-}
-
diff --git a/core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/ConstantExpressionPropertyPlaceholderProvider.java b/core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/ConstantExpressionPropertyPlaceholderProvider.java
deleted file mode 100644
index 91d7bde..0000000
--- a/core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/ConstantExpressionPropertyPlaceholderProvider.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/* Generated by camel build tools - do NOT edit this file! */
-package org.apache.camel.model.placeholder;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.function.Consumer;
-import java.util.function.Supplier;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.model.language.ConstantExpression;
-import org.apache.camel.spi.PropertyPlaceholderConfigurer;
-
-/**
- * Generated by camel build tools - do NOT edit this file!
- */
-public class ConstantExpressionPropertyPlaceholderProvider implements PropertyPlaceholderConfigurer {
-
-    private final Map<String, Supplier<String>> readPlaceholders = new HashMap<>();
-    private final Map<String, Consumer<String>> writePlaceholders = new HashMap<>();
-
-    public ConstantExpressionPropertyPlaceholderProvider(Object obj) {
-        ConstantExpression definition = (ConstantExpression) obj;
-
-        readPlaceholders.put("expression", definition::getExpression);
-        writePlaceholders.put("expression", definition::setExpression);
-        readPlaceholders.put("id", definition::getId);
-        writePlaceholders.put("id", definition::setId);
-    }
-
-    @Override
-    public Map<String, Supplier<String>> getReadPropertyPlaceholderOptions(CamelContext camelContext) {
-        return readPlaceholders;
-    }
-
-    @Override
-    public Map<String, Consumer<String>> getWritePropertyPlaceholderOptions(CamelContext camelContext) {
-        return writePlaceholders;
-    }
-
-}
-
diff --git a/core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/ConvertBodyDefinitionPropertyPlaceholderProvider.java b/core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/ConvertBodyDefinitionPropertyPlaceholderProvider.java
deleted file mode 100644
index 1c91168..0000000
--- a/core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/ConvertBodyDefinitionPropertyPlaceholderProvider.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/* Generated by camel build tools - do NOT edit this file! */
-package org.apache.camel.model.placeholder;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.function.Consumer;
-import java.util.function.Supplier;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.model.ConvertBodyDefinition;
-import org.apache.camel.spi.PropertyPlaceholderConfigurer;
-
-/**
- * Generated by camel build tools - do NOT edit this file!
- */
-public class ConvertBodyDefinitionPropertyPlaceholderProvider implements PropertyPlaceholderConfigurer {
-
-    private final Map<String, Supplier<String>> readPlaceholders = new HashMap<>();
-    private final Map<String, Consumer<String>> writePlaceholders = new HashMap<>();
-
-    public ConvertBodyDefinitionPropertyPlaceholderProvider(Object obj) {
-        ConvertBodyDefinition definition = (ConvertBodyDefinition) obj;
-
-        readPlaceholders.put("type", definition::getType);
-        writePlaceholders.put("type", definition::setType);
-        readPlaceholders.put("charset", definition::getCharset);
-        writePlaceholders.put("charset", definition::setCharset);
-        readPlaceholders.put("id", definition::getId);
-        writePlaceholders.put("id", definition::setId);
-    }
-
-    @Override
-    public Map<String, Supplier<String>> getReadPropertyPlaceholderOptions(CamelContext camelContext) {
-        return readPlaceholders;
-    }
-
-    @Override
-    public Map<String, Consumer<String>> getWritePropertyPlaceholderOptions(CamelContext camelContext) {
-        return writePlaceholders;
-    }
-
-}
-
diff --git a/core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/CryptoDataFormatPropertyPlaceholderProvider.java b/core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/CryptoDataFormatPropertyPlaceholderProvider.java
deleted file mode 100644
index 2ac0b35..0000000
--- a/core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/CryptoDataFormatPropertyPlaceholderProvider.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/* Generated by camel build tools - do NOT edit this file! */
-package org.apache.camel.model.placeholder;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.function.Consumer;
-import java.util.function.Supplier;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.model.dataformat.CryptoDataFormat;
-import org.apache.camel.spi.PropertyPlaceholderConfigurer;
-
-/**
- * Generated by camel build tools - do NOT edit this file!
- */
-public class CryptoDataFormatPropertyPlaceholderProvider implements PropertyPlaceholderConfigurer {
-
-    private final Map<String, Supplier<String>> readPlaceholders = new HashMap<>();
-    private final Map<String, Consumer<String>> writePlaceholders = new HashMap<>();
-
-    public CryptoDataFormatPropertyPlaceholderProvider(Object obj) {
-        CryptoDataFormat definition = (CryptoDataFormat) obj;
-
-        readPlaceholders.put("algorithm", definition::getAlgorithm);
-        writePlaceholders.put("algorithm", definition::setAlgorithm);
-        readPlaceholders.put("cryptoProvider", definition::getCryptoProvider);
-        writePlaceholders.put("cryptoProvider", definition::setCryptoProvider);
-        readPlaceholders.put("keyRef", definition::getKeyRef);
-        writePlaceholders.put("keyRef", definition::setKeyRef);
-        readPlaceholders.put("initVectorRef", definition::getInitVectorRef);
-        writePlaceholders.put("initVectorRef", definition::setInitVectorRef);
-        readPlaceholders.put("algorithmParameterRef", definition::getAlgorithmParameterRef);
-        writePlaceholders.put("algorithmParameterRef", definition::setAlgorithmParameterRef);
-        readPlaceholders.put("macAlgorithm", definition::getMacAlgorithm);
-        writePlaceholders.put("macAlgorithm", definition::setMacAlgorithm);
-        readPlaceholders.put("id", definition::getId);
-        writePlaceholders.put("id", definition::setId);
-    }
-
-    @Override
-    public Map<String, Supplier<String>> getReadPropertyPlaceholderOptions(CamelContext camelContext) {
-        return readPlaceholders;
-    }
-
-    @Override
-    public Map<String, Consumer<String>> getWritePropertyPlaceholderOptions(CamelContext camelContext) {
-        return writePlaceholders;
-    }
-
-}
-
diff --git a/core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/CsvDataFormatPropertyPlaceholderProvider.java b/core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/CsvDataFormatPropertyPlaceholderProvider.java
deleted file mode 100644
index 023f6ad..0000000
--- a/core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/CsvDataFormatPropertyPlaceholderProvider.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/* Generated by camel build tools - do NOT edit this file! */
-package org.apache.camel.model.placeholder;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.function.Consumer;
-import java.util.function.Supplier;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.model.dataformat.CsvDataFormat;
-import org.apache.camel.spi.PropertyPlaceholderConfigurer;
-
-/**
- * Generated by camel build tools - do NOT edit this file!
- */
-public class CsvDataFormatPropertyPlaceholderProvider implements PropertyPlaceholderConfigurer {
-
-    private final Map<String, Supplier<String>> readPlaceholders = new HashMap<>();
-    private final Map<String, Consumer<String>> writePlaceholders = new HashMap<>();
-
-    public CsvDataFormatPropertyPlaceholderProvider(Object obj) {
-        CsvDataFormat definition = (CsvDataFormat) obj;
-
-        readPlaceholders.put("formatRef", definition::getFormatRef);
-        writePlaceholders.put("formatRef", definition::setFormatRef);
-        readPlaceholders.put("formatName", definition::getFormatName);
-        writePlaceholders.put("formatName", definition::setFormatName);
-        readPlaceholders.put("commentMarker", definition::getCommentMarker);
-        writePlaceholders.put("commentMarker", definition::setCommentMarker);
-        readPlaceholders.put("delimiter", definition::getDelimiter);
-        writePlaceholders.put("delimiter", definition::setDelimiter);
-        readPlaceholders.put("escape", definition::getEscape);
-        writePlaceholders.put("escape", definition::setEscape);
-        readPlaceholders.put("nullString", definition::getNullString);
-        writePlaceholders.put("nullString", definition::setNullString);
-        readPlaceholders.put("quote", definition::getQuote);
-        writePlaceholders.put("quote", definition::setQuote);
-        readPlaceholders.put("recordSeparatorDisabled", definition::getRecordSeparatorDisabled);
-        writePlaceholders.put("recordSeparatorDisabled", definition::setRecordSeparatorDisabled);
-        readPlaceholders.put("recordSeparator", definition::getRecordSeparator);
-        writePlaceholders.put("recordSeparator", definition::setRecordSeparator);
-        readPlaceholders.put("quoteMode", definition::getQuoteMode);
-        writePlaceholders.put("quoteMode", definition::setQuoteMode);
-        readPlaceholders.put("marshallerFactoryRef", definition::getMarshallerFactoryRef);
-        writePlaceholders.put("marshallerFactoryRef", definition::setMarshallerFactoryRef);
-        readPlaceholders.put("recordConverterRef", definition::getRecordConverterRef);
-        writePlaceholders.put("recordConverterRef", definition::setRecordConverterRef);
-        readPlaceholders.put("id", definition::getId);
-        writePlaceholders.put("id", definition::setId);
-    }
-
-    @Override
-    public Map<String, Supplier<String>> getReadPropertyPlaceholderOptions(CamelContext camelContext) {
-        return readPlaceholders;
-    }
-
-    @Override
-    public Map<String, Consumer<String>> getWritePropertyPlaceholderOptions(CamelContext camelContext) {
-        return writePlaceholders;
-    }
-
-}
-
diff --git a/core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/CustomDataFormatPropertyPlaceholderProvider.java b/core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/CustomDataFormatPropertyPlaceholderProvider.java
deleted file mode 100644
index b755d64..0000000
--- a/core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/CustomDataFormatPropertyPlaceholderProvider.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/* Generated by camel build tools - do NOT edit this file! */
-package org.apache.camel.model.placeholder;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.function.Consumer;
-import java.util.function.Supplier;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.model.dataformat.CustomDataFormat;
-import org.apache.camel.spi.PropertyPlaceholderConfigurer;
-
-/**
- * Generated by camel build tools - do NOT edit this file!
- */
-public class CustomDataFormatPropertyPlaceholderProvider implements PropertyPlaceholderConfigurer {
-
-    private final Map<String, Supplier<String>> readPlaceholders = new HashMap<>();
-    private final Map<String, Consumer<String>> writePlaceholders = new HashMap<>();
-
-    public CustomDataFormatPropertyPlaceholderProvider(Object obj) {
-        CustomDataFormat definition = (CustomDataFormat) obj;
-
-        readPlaceholders.put("ref", definition::getRef);
-        writePlaceholders.put("ref", definition::setRef);
-        readPlaceholders.put("id", definition::getId);
-        writePlaceholders.put("id", definition::setId);
-    }
-
-    @Override
-    public Map<String, Supplier<String>> getReadPropertyPlaceholderOptions(CamelContext camelContext) {
-        return readPlaceholders;
-    }
-
-    @Override
-    public Map<String, Consumer<String>> getWritePropertyPlaceholderOptions(CamelContext camelContext) {
-        return writePlaceholders;
-    }
-
-}
-
diff --git a/core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/DefinitionPropertiesPlaceholderProviderHelper.java b/core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/DefinitionPropertiesPlaceholderProviderHelper.java
deleted file mode 100644
index 03f3486..0000000
--- a/core/camel-core-engine/src/generated/java/org/apache/camel/model/placeholder/DefinitionPropertiesPlaceholderProviderHelper.java
+++ /dev/n