Hi

Besides bean inheritance, sometimes people use property placeholders
and externalize values into .properties files or the likes.
Spring support property placeholders in the <bean>'s. Then the copy
and paste is tolerable, as all you do is referring to the same
property key.

There is plenty of web pages and documentation on the web about using
spring property placeholders

But mind that Spring does not fully support placeholders in non-spring
namespaces, such as <camelContext>
http://camel.apache.org/how-do-i-use-spring-property-placeholder-with-camel-xml.html

And Camel also have property placeholder support which extended
abilities from Camel point of view
http://camel.apache.org/using-propertyplaceholder.html


On Thu, Dec 15, 2011 at 8:21 PM, MichaelAtSAG <[email protected]> wrote:
> I want two Spring beans defined:
>
> <1> jmsEDA
> <2> jmsEDAPE
>
> The second bean jmsEDAPE has all the properties of the first bean, except
> with a different bean id and an additional property.
>
> How do I do this so that the second bean does not contain redundant
> information with first bean?
>
> Example showing the beans with undesired redundancy:
>
>
>        <bean id="jmsEDA" class="org.apache.camel.component.jms.JmsComponent">
>                <property name="connectionFactory">
>                        <bean 
> class="org.apache.activemq.ActiveMQConnectionFactory">
>                                <property name="brokerURL"
> value="vm://localhost?broker.persistent=false&amp;broker.useJmx=false" />
>                        </bean>
>                </property>
>        </bean>
>
>
>        <bean id="jmsEDAPE" 
> class="org.apache.camel.component.jms.JmsComponent">
>                <property name="connectionFactory">
>                        <bean 
> class="org.apache.activemq.ActiveMQConnectionFactory">
>                                <property name="brokerURL"
> value="vm://localhost?broker.persistent=false&amp;broker.useJmx=false" />
>                                <property name="clientID" 
> value="ProcessEngine" />
>                        </bean>
>                </property>
>        </bean>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Spring-XML-Context-two-similar-beans-tp5078474p5078474.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
FuseSource
Email: [email protected]
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Reply via email to