I am currently looking into implementing the Database migration hook. I first considered stacking another service tracker on top of the existing ones. We already track StringEncryptor, DataSourceFactory and PooledDataSourceFactory. So I am trying to provide a different approach to make the code simpler.

I described the concept I use below but for the impatient my limitation is that I only track one service of each class. So I have a problem with the possibility of using more than one StringEncryptor in a single config.

So my question is can I add the limitation that each config may contain only one alias for the encryptor? Possibly also externalizing the alias into a separate attribute like decryptor=mydecryptor.

Christian

----

Concept of the MultiServiceTracker

My idea is to have a MultiServiceTracker. You use it like:
tracker.track(StringEncryptor.class, "(alias=my)");
tracker.track(DataSourceFactory.class, "(name=test)");
tracker.open();

It will call an abstract method activate() when all tracked services are present and deactivate() when any is lost. Then you can get each service using:
tracker.getService(StringEncryptor.class)

So this allows to flexibly describe which services we need for a config without managing your own tracker for each.

Currently I can only manage one service of each class.


--
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com

--
--
------------------
OPS4J - http://www.ops4j.org - [email protected]

--- You received this message because you are subscribed to the Google Groups "OPS4J" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to