Actually, you can use a filter when you lookup an OSGi service.

So it means that you can do:

<osgix:reference id="myDataSource" interface="javax.sql.DataSource" filter="(name=my-name)"/>

You have the documentation there:
http://docs.spring.io/osgi/docs/1.1.2/reference/html/service-registry.html#service-registry:refs

On the other hand, using Karaf 3.0.1, you should be able to use the JNDI InitialFactory (you have the jndi:* commands).

Regards
JB

On 09/01/2014 10:35 AM, jimmy wrote:
What do you thing about working with a jndi name and declare a
org.springframework.jndi.JndiObjectFactoryBean  rather the osgix:reference
to an interface (javax.sql.DataSource) .

In fact i've more than one service with the interface javax.sql.DataSource (
2 databases ).





--
View this message in context: 
http://karaf.922171.n3.nabble.com/Spring-Blueprint-bean-reference-sharing-tp4035006p4035011.html
Sent from the Karaf - User mailing list archive at Nabble.com.


--
Jean-Baptiste Onofré
[email protected]
http://blog.nanthrax.net
Talend - http://www.talend.com

Reply via email to