| DS service bind/unbind invoke sequence. [message #506917] |
Mon, 11 January 2010 05:48  |
gsarno Messages: 3 Registered: January 2010 |
Junior Member |
|
|
Hello,
I experimented some code using DS services. I created 4 bundles:
1- containing the Interface of the service producers (Interface I)
2- containing implementation of Service A (implementing I)
3- Implementation of service B (Implementing same interface I)
4- Consumer
Consumer declares:
- a cardinality of 1..n
- two methods for "bind-ing", "unbind-ing".
Performing "update" on the bundle containing Service A, I noticed that unbind is actually invoked before. Should the Container invoke "bind" first so that the software has a chance to prepare for Service A replacement ?
Thanks.
|
|
|
|
| Re: DS service bind/unbind invoke sequence. [message #507082 is a reply to message #507027] |
Mon, 11 January 2010 20:23  |
gsarno Messages: 3 Registered: January 2010 |
Junior Member |
|
|
Hello, thanks, yes assumptions correct.
Reading standard couple of times I get the same feeling but this is what I don't understand (may be too young on OSGi and Services) and I hope you(or anybody) can help me grasp.
If the Interface (Interface I) were describing a Dictionary Service and Service A was the English implementation and Service B The French implementation, if I had a bug or wanted to update the English version of the dictionary I would like to be able to bind the new Service A first and unbind the old. Little count that Service B is still there untouched (as it serves a different service).
In my example I want the Consume (Service C for instance) to decide and invoke either Service A or Service B based on Properties for example and if Service A (or B) goes away I would like to have a chance to detect the update and replace the Service before the old goes away.
Does this make sense ? Is it possible with the framework ?
[Updated on: Mon, 11 January 2010 20:23] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.01996 seconds