Announcement Announcement Module
No announcement yet.
Cardinality - 2.0 M5 - Is it valid only at initialization time or at runtime ? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Cardinality - 2.0 M5 - Is it valid only at initialization time or at runtime ?

    I have a doubt on the functionality of the cardinality attribute . How does it work ?

    Is it valid at init time only or should be applicable at runtime also , what i mean is if a mandatory service goes down at runtime , will the dependent service give a service unavailable exception at runtime or will teh service fail saying its mandatory.

    For me it just said service unavailable and my dependent bundle did not fail.

    i tried it in both the 1.0.2 version as well as 2.0 M5. Is it the expected behavior ? o is it a BUG ?

  • #2
    This is really a Spring DM question. I've asked Costin Leau, the author of Spring DM, to take a look at this post.


    • #3
      Thanks a lot Andy. I am looking forward for a reply from Costin.


      • #4
        The difference between the values of cardinality: mandatory and optional really boils down to what behaviour is expected at startup. As explained in the docs (, once an application started, the behaviour is the same - if a service is missing and it times out, an exception is thrown.
        The context is not automatically destroyed since an exception doesn't mean an application needs to be destroyed. Of course, you can catch that exception and close the context yourself but in general, especially due to the dynamics in OSGi, the context can keep on living.


        • #5
          As i was referring the documentation of the previous version , where this was not very clear i just had a doubt.

          Thanks a lot for the clarification .