Also note that the "reload" update strategy name is misleading. It consists in 
restarting the bundle when the property file changes (no matter injection 
type), which may not be what you expect.

JP

-----Message d'origine-----
De : Vinu Raj [mailto:[email protected]] 
Envoyé : mardi 28 janvier 2014 12:57
À : [email protected]
Objet : RE: Import Map via blueprint container

You can use property-placeholder for this purpose. Say for example you have a 
properties file called app.properties, you need place it in ${karaf.home}/etc 
and then have the following configuration in blueprint.xml

        <cm:property-placeholder persistent-id="app" update-strategy="reload">
                <cm:default-properties>
                        <cm:property name="prop1key" value="prop1Value" /> 
                        <cm:property name="prop2key" value="prop2Value" /> 
                </cm:default-properties>
        </cm:property-placeholder>

        <bean id="bean1" class="com.foo.Bean" >
                <property name="props">
                        <map>
                                <entry key="prop1key" value="${prop1key}" />
                                <entry key="prop2key" value="${prop2key}" />
                        </map>
                </property>
        </bean>

When the app.properties file is changed, karaf will reload the file.
Detailed tutorial available at here
<http://www.liquid-reality.de/display/liquid/2011/09/23/Karaf+Tutorial+Part+2+-+Using+the+Configuration+Admin+Service>
  



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Import-Map-via-blueprint-container-tp4031365p4031375.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Reply via email to