You are welcome to use this code that I wrote to do exactly that. It
is effecttively an extension of the existing ServiceTracker that
provides added functionality like getting the service after it is in
the listing.

http://azsandbox.googlecode.com/svn/tags/osgi-utils-1.2/src/main/java/org/azeckoski/osgi/utils/ServiceTracker2.java

-AZ


On Sun, Aug 30, 2009 at 12:24 AM, Will Horn<[email protected]> wrote:
> ServiceTracker#getService() is essentially the functionality I'm looking
> for.  The only extra bit I need is to receive a callback when the result
> changes.  Is there a good way to do this?  I have tried subclassing
> ServiceTracker but addingService, for example, is called before the service
> is added to the tracker (rightly so, given its intention) so getService()
> does not reflect the new value.
> Thanks,
> Will
> _______________________________________________
> OSGi Developer Mail List
> [email protected]
> https://mail.osgi.org/mailman/listinfo/osgi-dev
>



-- 
Aaron Zeckoski (azeckoski (at) vt.edu)
Senior Research Engineer - CARET - University of Cambridge
https://twitter.com/azeckoski - http://www.linkedin.com/in/azeckoski
http://aaronz-sakai.blogspot.com/ - http://tinyurl.com/azprofile

_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to