camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dan Checkoway (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CAMEL-3547) Custom "absorbing" PropertyPlaceholderConfigurer
Date Sun, 03 Jun 2012 11:23:22 GMT

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

Dan Checkoway commented on CAMEL-3547:
--------------------------------------

Thanks, Claus!
                
> Custom "absorbing" PropertyPlaceholderConfigurer
> ------------------------------------------------
>
>                 Key: CAMEL-3547
>                 URL: https://issues.apache.org/jira/browse/CAMEL-3547
>             Project: Camel
>          Issue Type: New Feature
>          Components: camel-spring
>    Affects Versions: 2.5.0
>            Reporter: Dan Checkoway
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.10.0
>
>
> I find Camel's property placeholder support clumsy.  I already use Spring's PropertyPlaceholderConfigurer,
and I feel like Camel should be able to harness that.  I realize Spring doesn't make it easy
to access those properties, but I have come up with a way to enable Camel to use them...
> By simply extending PropertyPlaceholderConfigurer, we will be able to intercept and absorb
the properties that Spring has access to:
> {{
> import java.util.Properties;
> import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
> import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;
> public class CamelPropertyPlaceholderConfigurer extends PropertyPlaceholderConfigurer
{
>     private final Properties properties = new Properties();
>     
>     @Override
>     protected void processProperties(ConfigurableListableBeanFactory beanFactory, Properties
props) {
>         super.processProperties(beanFactory, props);
>         // "Absorb" all properties that pass through so we can expose them later
>         properties.putAll(props);
>     }
>     /** Expose all absorbed properties */
>     public final Properties getProperties() {
>         return properties;
>     }
> }
> }}
> It means users who want to take advantage of this would need to instantiate this instead
of the stock PropertyPlaceholderConfigurer, but that's no problem:
>   <bean class="org.apache.camel.impl.CamelPropertyPlaceholderConfigurer">
>     <p:location="..."/>
>   </bean>
> That way, you wouldn't need to declare a "duplicating" <propertyPlaceholer> in
the CamelContext.  What do you think, is this feasible?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message