You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by sfoster <sf...@adnovate.com> on 2010/07/12 17:43:41 UTC
OSGi Blueprints and resource loading.
Hi,
I'm trying to migrate a spring bean to an OSGi blueprint and am running into
the following problem. In the original bean I used DI to pass a list of
resources, mainly from the classpath. However, the same code will not work
as an OSGi blueprint, which cannot cast to a list of resources. So I added
the ResourceLoaderAware interface to the bean and injected the resource
loader in the following manner:
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
<reference id="loader"
interface="org.springframework.core.io.ResourceLoader" />
<service id="xacml" interface="com.adnovate.xacml.service.XACMLService">
<bean class="com.adnovate.xacml.service.impl.SimpleXACMLService"
init-method="initialize">
<property name="policies">
<list>
<value>classpath:policies/service.xml</value>
</list>
</property>
<property name="resourceLoader" ref="loader"/>
</bean>
</service>
</blueprint>
This however can't find the resources. I also tried using properties in the
blueprint so that I could put these files in the servicemix's etc, but they
are not expanded. What would be the correct way to solve this?
--
View this message in context: http://servicemix.396122.n5.nabble.com/OSGi-Blueprints-and-resource-loading-tp1046423p1046423.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.