Aaron Zeckoski wrote:
I am trying to ensure my bundles play nice in OSGi and follow the
whiteboard pattern as much as possible so I was using the
ServiceTracker and ServiceListeners but I found I was writing a lot of
code so I put it into a couple of classes to make things easier for
myself. I realize that maybe there are already some standard/popular
utilities out there for doing this stuff but I had fun making these so
[...]
B) Ask if there are some standard (or just popular) utils somewhere
already which do this already (are there?)
I basically want to simply avoid starting my services until the ones I
require are availabe, shut mine down when the ones I require go away,
react to changes in the required services (S1 is replaced by S2), and
track services which are optional but used by me (like extensions for
example). I also want it to be easy to get services and take advantage
of generics where possible to avoid constant casting.
Have a look at declarative services (services compendium pp. 281). Be
aware that a bundle can have as many components as you want and that
each component can offer zero or one service and use as many services as
you want to.
Arthur
_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev