I am having trouble utilizing the service tracker events. There are 3
of them (add, modify, remove) and I am calling my own methods which
try to start my service if the services I require are available (or
shut it down when they are no longer available).

The issue is that the adding event happens before the service is added
into the tracker so when I call my start method it cannot find the
service yet.

Here is the code if anyone is insterested:
http://code.google.com/p/azsandbox/source/browse/trunk/osgi-sample/sample-servlet/src/main/java/org/azeckoski/sample/internal/SampleServletActivator.java

I ended up creating something a lot more complicated which uses both
the servicetracker and also the servicelistener and only uses the
listener events but it seems like maybe I am doing something wrong
here. Is it possible to utilize the servicetracker events and also use
it to get the service out while the event method is triggering or is
that not really what the events are for?

I would prefer to not to have to use DS or big libraries for such a
simple bundle in this case but maybe that is just not practical.
-AZ


-- 
Aaron Zeckoski ([email protected])
Senior Research Engineer - CARET - Cambridge University
https://twitter.com/azeckoski - http://www.linkedin.com/in/azeckoski
http://aaronz-sakai.blogspot.com/ -
http://confluence.sakaiproject.org/confluence/display/~aaronz/
_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to