Hi Achim
what do you mean by "Now you just need to replace your property code
by the following."?
does this mean i need to remove my spring
<bean id="propertyConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="systemPropertiesModeName"
value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />
<property name="location" value="classpath:com/.../resources.properties" />
</bean>
as well?
I am hoping to leave my spring config untouched until we fully
OSGIzing it, so that my current test still functional as standlone
spring test
Thank you
-Dan
On Sun, Mar 13, 2011 at 12:09 PM, Achim Nierbeck
<[email protected]> wrote:
> Hi Dan,
>
> yes it is.
>
> first of all you need to make sure you got a cfg file in your etc folder
> with a name that matches a "PID" - PersistentID
> e.g. my.very.special.resources.cfg
> where my.very.special.resources is the pid.
> This way the FileInstaller takes this cfg file and tells the config
> admin service to provide a configuration for that pid.
>
> Now you just need to replace your property code by the following.
>
> <osgix:cm-properties id="cfg.with.defaults"
> persistent-id="my.very.special.resources">
> <beans:prop key="host">localhost</beans:prop>
> <beans:prop key="port">3306</beans:prop>
> </osgix:cm-properties>
>
>
>
> It can also be found at [1]
>
>
> Regards, Achim
>
>
> [1] -
> http://static.springsource.org/osgi/docs/1.2.1/reference/html/compendium.html#compendium:cm
>
>
>> Hello,
>>
>> My jar ( spring bundle ) has a default set of configurations via
>>
>> <bean id="propertyConfigurer"
>> class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
>> <property name="systemPropertiesModeName"
>> value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />
>> <property name="location" value="classpath:com/.../resources.properties"
>> />
>> </bean>
>>
>> This way I can override the default properties using system
>> properties ( ie pass in -Dxuy=value to JVM )
>>
>> Now I'd like to deploy my bundle to Karaf, is there a way for me to
>> setup Karaf/osgi's configAdmin to to use a config file under karaf's
>> etc directory to override my default properties?
>>
>> Big thanks ahead.
>>
>> -Dan
>
>