I have 2 bundles:
- bundle Server exports service 'S';
- bundle Client has mandatory (cardinality="1..1") reference to service 'S'.
What should happen with importer bundle Client if exporter bundle Server gets updated/stopped/started?
I start both Server and Client; the Client prints expected results; then I run 2 scenarios:
1) - stop Server
- stop Client
- start Client
- start Server;
2) - update Server
- update Client
Console output looks like this
(console commands start with 'osgi> ', my comments start with '//'):
// expected initial output
[Order Service]: started
[Order Client]: setting Order Service
[Order Client]: started
[Order Client]: Processing order
[Order Service]: Order id = ORD123
// starting scenario 1
osgi> stop (Server bundle ID)
[Order Service]: stopped
osgi> stop (Client bundle ID)
[Order Client]: stopped
osgi> start (Client bundle ID)
// nothing is printed, because service 'S' is unavailable
// "invocation blocks until the reference becomes satisfied"
osgi> start (Server bundle ID)
// expected output - Client is started
[Order Service]: started
[Order Client]: setting Order Service
[Order Client]: started
[Order Client]: Processing order
[Order Service]: Order id = ORD123
// starting scenario 2
osgi> update (Server bundle ID)
[Order Service]: stopped
[Order Service]: started
osgi> update (Client bundle ID)
[Order Client]: stopped
// nothing else is printed; I expected that Client will be restarted,
// because service 'S' is already available
Is something wrong with scenario 2 or my configuration?
Client and Server bundles attached.
Thanks in advance,
-- Lev


