Hi Matthew,
The "problem" with Blueprint is that your WAR can be deployed only in a
Blueprint container (like Karaf).
If you use Spring, and Spring osgix, you can leverage a
PropertyPlaceholder with ConfigAdmin:
<beans xmlns:context="http://www.springframework.org/schema/context"
xmlns:osgi="http://www.springframework.org/schema/osgi"
xmlns:osgix="http://www.springframework.org/schema/osgi-compendium"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.springframework.org/schema/beans"
xsi:schemalocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/osgi
http://www.springframework.org/schema/osgi/spring-osgi.xsd
http://www.springframework.org/schema/osgi-compendium
http://www.springframework.org/schema/osgi-compendium/spring-osgi-compendium.xsd">
<osgix:cm-properties id="props" persistent-id="my.props">
<prop key="property.name">default value</prop>
</osgix:cm-properties>
<context:property-placeholder properties-ref="props">
</context:property-placeholder>
<bean id="myBean" lass="com.company.MyClass">
<property name="property" value="${property.name}"></property>
</bean>
</beans>
It can in a Spring webapp application context.
Regards
JB
On 09/23/2013 09:54 PM, Matthew Bishop wrote:
The short answer is yes, but via gemini blueprint. You can create a bean
that refers to the service you are trying to configure and add in a
managed-properties directive to fire a PID change to a method like this:
<bean id="yourManagedService" class="com.company.YourManagedService.class">
<compendium:managed-properties persistent-id="yourPID"
update-method="updateProperties"/>
</bean>
Compendium's
schemaLocation="http://www.eclipse.org/gemini/blueprint/schema/blueprint-co
mpendium
http://www.eclipse.org/gemini/blueprint/schema/blueprint-compendium/gemi
ni-blueprint-compendium.xsd">
On 2013-09-23 12:49 PM, "Jean-Baptiste Onofré" <[email protected]> wrote:
Hi Oli,
not sure to follow you. You can always use Spring in your WAR, with a
property placeholder which relay to ConfigAdmin.
Is it what you are looking for ? I can send you an example if you need.
Regards
JB
On 09/23/2013 09:29 PM, Oliver Wulff wrote:
Hi there
Is it possible to use the Config Admin service to configure properties a
web application which uses spring and has been deployed using the WAR
deployer?
Thanks
Oli
--
Jean-Baptiste Onofré
[email protected]
http://blog.nanthrax.net
Talend - http://www.talend.com
Matthew Bishop, Senior Architect
Mobile: +1-604-218-8102
Email: [email protected]
Elastic Path Software Inc.
Web: www.elasticpath.com
Blog: www.getelastic.com
Community: grep.elasticpath.com
Careers: www.elasticpath.com/jobs
Confidentiality Notice: This message is intended only for the use of the
designated addressee(s), and may contain information that is privileged,
confidential and exempt from disclosure. Any unauthorized viewing, disclosure,
copying, distribution or use of information contained in this e-mail is
prohibited and may be unlawful. If you received this e-mail in error, please
reply to the sender immediately to inform us you are not the intended recipient
and delete the email from your computer system. Thank you.
--
Jean-Baptiste Onofré
[email protected]
http://blog.nanthrax.net
Talend - http://www.talend.com