Yes. It means it is legal for a framework impl to return multiple distinct ServiceReference objects for a given service. So a bundle must not rely on == and must instead use equals() when trying to determine if 2 ServiceReferences refer to the same service. This is standard behavior for Maps.
BTW The thunking layer of the framework 2.0 prototype Peter and I presented at JavaOne relies on this. 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 ----- Original Message ----- From: Ikuo Yamasaki [[email protected]] Sent: 06/05/2009 08:08 PM ZE9 To: [email protected] Subject: [osgi-dev] Multiple ServiceReference for one ServiceRegistration ? Hi OSGi Experts, I have a question in the core spec. ------------------ 6.1.23 public interface ServiceReference extends Comparable page 186 in R4.1 Core Spec Every service registered in the Framework has a unique ServiceRegistration object and may have multiple, distinct ServiceReference objects referring to it. ------------------ What kind of cases are multiple ServiceReference objects are needed for a unique ServiceRegistration? (only one object is needed, IMO). # Does it mean "there might be a framework impl, which returns distinct # ServiceReference objects for every time when # BundleContext#getServiceReference(s) is called, # although it is not required in theory" ? Best regards, --------------------- NTT Cyber Solutions Laboratories Ikuo YAMASAKI E-mail: [email protected] TEL +81-46-859-8537 FAX +81-46-855-1282 _______________________________________________ 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
