I would like to not require DS for pax jdbc as it should be usable in a
wide range of environments with minimal dependencies.
I followed the advice from Timothy and created a ServiceTracker when the
config is created. The servicetracker then reacts on DataSourceFactory
services.
This seems to work quite well.
This is my current code:
https://github.com/ops4j/org.ops4j.pax.jdbc/tree/master/pax-jdbc-config/src/main/java/org/ops4j/pax/jdbc/config/impl
DataSourceManager watches the config and creates / removes the tracker.
DataSourcePublisher is called by the tracker to publish / unpublish the
DataSource.
I even observed that my code is more testable now that I split the
DataSourcePublisher off.
Thanks to both of you for the help.
Christian
On 18.07.2014 16:58, Jean-Baptiste Onofré wrote:
Hi Christian,
I think that DS can be useful here as it provides more fine grained
lifecycle control on the services.
Regards
JB
--
Christian Schneider
http://www.liquid-reality.de
Open Source Architect
http://www.talend.com
_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev