David,
Thanks for the feedback.
DS doesn't really provide what I'm after here. It still requires a PID and
an application specific bundle. I suppose if one only used one instance of
Netty it might work but that would work for Blueprint as well. DS has
cleaner mechanics but doesn't have any wire up mechanisms.
Have you ever worked with PAX JDBC? It's almost magical. You don't actually
create a bundle to set up the java.sql.Datasource. You simply create a cfg
file with org.ops4j.datasource- at the start of its name and the factory
picks up the configuration, instantiates the driver, wraps it and exports it
to the registry by the name you specify as a java.sql.Datasource interface.
Obviously you might have to have multiple java.sql.Datasources in an
enterprise application so it also specifies the dataSourceName as a JNDI
filter. Obviously the consumer could set it up with DS or Blueprint.
The sample cfg file which automatically sets up the connection and exports
the DataSource to the OSGi service registry with the filtered name of
testds-h2. The Netty shared server configuration(s) and security'
configuration(s) could be set up in a similar way. Then when you install or
uninstall your webservice bundles they simply grab the reference whether it
is via Blueprint, DS or an Activator wouldn't matter.'
osgi.jdbc.driver.name=3DH2
databaseName=3Dtest
user=3Dsa
password=3D
dataSourceName=3Dtestds-h2
<reference filter=3D"(osgi.jndi.service.name=3Dtestds-h2)"
id=3D"dataSource" interface=3D"javax.sql.DataSource"/>
<bean class=3D"my.foo.dao.IDDAOService" id=3D"impl">
<property name=3D"dataSource" ref=3D"dataSource"/>
</bean>
https://ops4j1.jira.com/wiki/spaces/PAXJDBC/pages/61767710/Create+DataSource+from+config
--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html