Results 1 to 5 of 5

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

  1. #1
    Join Date
    Nov 2008
    Location
    London,UK
    Posts
    299

    Default 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. #2
    Join Date
    Oct 2008
    Posts
    493

    Default

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

  3. #3
    Join Date
    Nov 2008
    Location
    London,UK
    Posts
    299

    Default

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

  4. #4
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    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 (http://static.springsource.org/osgi/...mandatory-deps), 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.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  5. #5
    Join Date
    Nov 2008
    Location
    London,UK
    Posts
    299

    Default

    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 .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •