Hi Andreas,
I already had read that springDM docs before... and I really read tons
of threads in web trying to looking for a way to get collections from a
properties file. But I couldn't make it work... So, I give up to try to
convert automatically to my List property.
To supply my needs I just create another String field and injected a
comma separated string on it and inside the service class I use the
String.split() to get the right item values and insert them in the
List... that did the job..
cheers
Cristiano
On 02/05/11 23:47, Andreas Pieber wrote:
Hey Cristiano,
TBH I've never tried this with blueprint but since blueprint and
springdm are almost equal the following should work if you simply
correct the namespace of the elements. To achive what you want I would
suggest to read chapter "10.1.2.1. Configuration Admin Runtime
Updates" in the Spring DM Manual
(http://static.springsource.org/osgi/docs/1.2.x/reference/html/compendium.html)
Hope this helps,
Kind regards,
Andreas
On Tue, May 3, 2011 at 12:56 AM, Cristiano Gavião<cvgav...@gmail.com> wrote:
Hi Johan,
Thanks, but I don't think your way could help me in my case because I don't
think that I could dynamically increase my list of strings that comes from a
config file on ${karaf}/etc.
cheers
Cristiano
On 02/05/11 19:04, Johan Edstrom wrote:
<property name="baseUrls">
<list>
<value>${wcs.soap.httpEndpoint}</value>
<value>${wcs.subscribe.httpEndpoint}</value>
<value>${wcs.mngSubscription.httpEndpoint}</value>
<value>${wcs.kvp.httpEndpoint}</value>
</list>
On May 2, 2011, at 3:46 PM, Cristiano Gavião wrote:
Hi,
I'm setting up my service using blueprint and CM. I could make it work
properly for single properties.
But now I can't figure out how to configure CM for a property that is a
List<String>.
<cm:property-placeholder persistent-id="myservice.osgi"
update-strategy="reload">
<cm:default-properties>
<cm:property name="annotatedEmbedderRunnerClass"
value="core.AnnotatedEmbedderRunner" />
</cm:default-properties>
</cm:property-placeholder>
* without CM, includeList is created properly by blueprint using
ArrayList class:
<bean id="embedderServiceImpl" class="test.EmbedderServiceImpl"
init-method="startUp" destroy-method="stop">
<property name="includeList">
<list>
<value>teste</value>
</list>
</property>
<property name="annotatedEmbedderRunnerClass"
value="${annotatedEmbedderRunnerClass}" />
</bean>
I've tried to do this, but didn't work:
<cm:property name="includeList">
<list>
<value>test</value>
</list>
</cm:property>
...
<property name="includeList" value= ${includeList}>
This is the error reported on karaf log:
Caused by: java.lang.Exception: Unable to convert value [test] to type
interface java.util.List. Type interface java.util.List is an interface or
an abstract class
Could someone point me the way to setup this List using CM?
thanks and regards
Cristiano