There is a pathological case. But it does not result in modifedService being called.
The ServiceEvent for REGISTERED is delivered synchronously before the BundleContext.registerService method returns. In order for the service properties to be modified before the addingService call completes, the following would all have to occur: 1) Service was registered as a ServiceFactory 2) Tracker's addingService method gets the service by calling BundleContext.getService 3) The service's ServiceFactory.getService method would be called and provided the ServiceRegistration object for the service which it uses to modify the service properties. This would result in a ServiceEvent MODIFIED event being synchronously delivered. So the tracker will receive the event, but since the addingService method has not returned, the service will not have been added to tracker yet but the tracker (if the properties still match the tracker's filter) will see that it is already in the process of adding the service to the tracker and just return. No customizer method will be called. So the situation you describe can't occur. -- BJ Hargrave Senior Technical Staff Member, IBM OSGi Fellow and CTO of the OSGi Alliance [email protected] office: +1 386 848 1781 mobile: +1 386 848 3788 From: Ikuo Yamasaki <[email protected]> To: OSGi Developer Mail List <[email protected]> Date: 2009/09/15 07:37 Subject: [osgi-dev] service modification during addingService callback Sent by: [email protected] Hi all, I have a question on ServiceTracker. 1: tracker.open(); 2: The tracked Service is registered. ==>customizer#addingService() is called back synchronously. Question: If the tracked service's service props gets modified before addingService() returns, customizer#modifiedService() will be called back ? Best regards, ======= Ikuo YAMASAKI _______________________________________________ OSGi Developer Mail List [email protected] https://mail.osgi.org/mailman/listinfo/osgi-dev
_______________________________________________ OSGi Developer Mail List [email protected] https://mail.osgi.org/mailman/listinfo/osgi-dev
