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