So, this is really more of a general OSGi question so I apologize
up-front for not asking a Felix specific question.

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
I thought I would:

A) Put them up here to see what people think
Mutliple services tracker:
https://source.sakaiproject.org/contrib/caret/osgi-eb/trunk/eb-webapp/src/main/java/org/sakaiproject/eb/rest/osgi/util/ServicesTracker.java
Single services tracker:
https://source.sakaiproject.org/contrib/caret/osgi-eb/trunk/eb-webapp/src/main/java/org/sakaiproject/eb/rest/osgi/util/ServiceListenerTracker.java
An activator which is using these:
https://source.sakaiproject.org/contrib/caret/osgi-eb/trunk/eb-webapp/src/main/java/org/sakaiproject/eb/rest/osgi/EBRestActivator.java

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.

I appreciate any comments or pointers (and promise to try to stop
posting so much to this list).
Thanks!
-AZ

-- 
Aaron Zeckoski (aar...@vt.edu)
Senior Research Engineer - CARET - Cambridge University
[http://bugs.sakaiproject.org/confluence/display/~aaronz/]
Sakai Fellow - [http://aaronz-sakai.blogspot.com/]

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org

Reply via email to