Announcement Announcement Module
Collapse

Spring Dynamic Modules forum decommissioned in favor of Eclipse Gemini Blueprint

With the official first release of Eclipse Gemini Blueprint shipped, the migration of the Spring Dynamic Modules code base to the Eclipse Foundation, as part of the Gemini project, has been completed.

As such, this forum has been decommissioned in favour of the Eclipse Gemini forums.
See more
See less
Mandatory service reference and OSGi service dynamics Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Mandatory service reference and OSGi service dynamics

    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

  • #2
    Lev, I think we've discussed this issue already in a different thread. If that's not the case, then let me know and we can open up the discussion again.

    Cheers,

    Comment


    • #3
      Yes, Costin, this is just an old post.

      Thanks,
      -- Lev

      Comment

      Working...
      X