camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Luca Burgazzoli (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CAMEL-10352) Optionally delegate to Aries PropertyEvaluator services in BlueprintPropertiesParser
Date Thu, 13 Oct 2016 12:10:20 GMT

    [ https://issues.apache.org/jira/browse/CAMEL-10352?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15571731#comment-15571731
] 

Luca Burgazzoli commented on CAMEL-10352:
-----------------------------------------

[~davsclaus] [~gzres]

I had a second look at the code and I think we can implement this thing in a better and less
intrusive way, some background:

- BlueprintPropertiesParser invokes AbstractPropertyPlaceholder::getProperty via reflection
(as it is protected) and this method does not take into account PropertyEvaluator
- DefaultPropertiesParser tries to resolve a placeholder using registered functions then it
check if the placeholder has a default value before to call doGetPropertyValue so if you have
a placeholder named prefix:something, you'll get doGetPropertyValue invoked with prefix

To let PropertyEvaluators be taken into account, we could:

- Invoke AbstractPropertyPlaceholder::retrieveValue which eventually invokes a PropertyEvaluator
- Invoke doGetPropertyValue in DefaultPropertiesParser::getPropertyValue also before searching
for the default so that you can give a change to the specific subclass ((in our case BlueprintPropertiesParser)
to resolve the placeholder as it is , if no result are returned we then go ahead as today
searching for a default and so on.


By doing so we relies on Aries for property resolution so we do not need to care about PropertyEvaluators
or any other stuff that may land in aries in the future and we do not need to add a new prefix
resolution in BlueprintPropertiesParser.


[Here|https://github.com/apache/camel/compare/master...lburgazzoli:CAMEL-10352] you can wee
the required changes

Let me know what you think.


Links:
1) https://github.com/apache/camel/blob/master/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/BlueprintPropertiesParser.java#L99
2) https://github.com/apache/camel/blob/master/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/BlueprintPropertiesParser.java#L138
3) https://github.com/apache/camel/blob/master/camel-core/src/main/java/org/apache/camel/component/properties/DefaultPropertiesParser.java#L213-L234รน
4) https://github.com/apache/camel/blob/master/camel-core/src/main/java/org/apache/camel/component/properties/DefaultPropertiesParser.java#L237-L241


> 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)

Mime
View raw message