Hi, Are you refering to Section 112.5.10, Bound Service Replacement ?
This just applies to unary (cardinality of 0..1 or 1..1) services. Your case involves multiple cardinality (1..n) and so this replacement does not apply. Here the services are bound and unbound as they come and go. Regards Felix On Wed, Oct 26, 2011 at 3:58 PM, Giuseppe Sarno <giuseppe.sa...@genband.com> wrote: > Hello, > > I was playing with JBOSS 7.0 and trying to implement a prototype of a DS > service which automatically (dynamically) binds other DS services. > > I had done similar prototype some time ago but using the equinox container. > With the original prototype I believe the container did call the “bind” > method before the “unbind” upon update. I think this is what I read through > the line of the OSGI spec and the OSGI in practise book from Neil B.. This > way I had the chance to automatically and transparently replace a service > without affecting the run time processing. I did not have similar behaviour > using the JBOSS container (code is slightly different so the change might > have triggered the different behaviour). The post is at > http://community.jboss.org/thread/174057. My goal is to replace a service > while the system is running and there are calls to the service. Can anybody > please help to understand correct behaviour and anything I should do to > achieve the goal ? > > > > Thanks for your help. > > > > Attached below is the xml descriptor of the DS service. Should the > setDictionary method on DictionaryService implementation be called before > unsetDictionary upon update? > > > > <?xml version="1.0" encoding="UTF-8"?> > > <scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" > name="osgi.example.service.broker"> > > <implementation > class="osgi.example.service.broker.DictionaryServiceImpl"/> > > <service> > > <provide > interface="osgi.example.service.broker.interf.DictionaryService"/> > > </service> > > <reference bind="setDictionary" cardinality="1..n" > interface="osgi.example.service.Dictionary" name="Dictionary" > policy="dynamic" unbind="unsetDictionary"/> > > </scr:component> > > > > > > _______________________________________________ > OSGi Developer Mail List > osgi-dev@mail.osgi.org > https://mail.osgi.org/mailman/listinfo/osgi-dev > _______________________________________________ OSGi Developer Mail List osgi-dev@mail.osgi.org https://mail.osgi.org/mailman/listinfo/osgi-dev