[
https://issues.apache.org/jira/browse/CAMEL-10352?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15529157#comment-15529157
]
Grzegorz Grzybek commented on CAMEL-10352:
------------------------------------------
Currently, in Blueprint Camel contexts we can do
({{useBlueprintPropertyResolver="true"}} is default):
{code:xml}
<cm:property-placeholder persistent-id="my-placeholders"
useBlueprintPropertyResolver="true">
<cm:default-properties>
<cm:property name="greeting" value="Hello"/>
<cm:property name="destination" value="mock:result"/>
</cm:default-properties>
</cm:property-placeholder>
<camelContext xmlns="http://camel.apache.org/schema/blueprint">
<route>
<from uri="direct:start"/>
<transform>
<simple>{{greeting}} ${body}</simple>
</transform>
<to uri="{{destination}}"/>
</route>
</camelContext>
{code}
useBlueprintPropertyResolver="true" makes PropertiesComponent aware of Aries
{{org.apache.aries.blueprint.ext.AbstractPropertyPlaceholder}} instances, like
{{<cm:property-placeholder>}} or {{<ext:property-placeholder>}}.
There's however another feature of Blueprint property placeholder resolvers:
{{org.apache.aries.blueprint.ext.evaluator.PropertyEvaluator}}.
This evaluator is used ONLY when postprocessing blueprint CDR (component
definition registry) - similar to Spring's BeanFactoryPostprocessors.
So if we have something like this in Blueprint XML:
{code:xml}
<bean id="myBean" class="my.Bean">
<argument value="${x.y.z}"/>
</bean>
{code}
evaluator will be used, because {{${x.y.z}}} is resolved at
_component registry postprocessing time_. But it won't be used here:
{code:xml}
<camelContext xmlns="http://camel.apache.org/schema/blueprint">
<route>
<from uri="direct:start"/>
<transform>
<simple>{{x.y.z}}</simple>
</transform>
<to uri="{{destination}}"/>
</route>
</camelContext>
{code}
because even if Camel's PropertiesComponent will delegate to Blueprint (from
{{org.apache.camel.blueprint.BlueprintPropertiesParser#parseProperty()}} call
to e.g., {{org.apache.aries.blueprint.ext.PropertyPlaceholder#getProperty()}}),
Blueprint won't use PropertyEvaluator any more.
h2. Possible solution
> Optionally delegate to Aries PropertyEvaluator services in
> BlueprintPropertiesParser
> ------------------------------------------------------------------------------------
>
> Key: CAMEL-10352
> URL: https://issues.apache.org/jira/browse/CAMEL-10352
> Project: Camel
> Issue Type: Improvement
> Components: camel-blueprint, osgi
> Reporter: Grzegorz Grzybek
> Assignee: Luca Burgazzoli
>
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)