Is there a way to prevent a Bundle from being marked as 'ACTIVE' should one of its DS components fails to initialise?
For example if I were to implement BundleActivator
I could throw a BundleException
in the start()
method and no services offered by that bundle I can prevent from being registered.
Using Declarative Services in my @Activate
method I may want to throw an exception if it cannot initialise for whatever reason. I have found though that doing so does not prevent the bundle from being marked as 'ACTIVE'. I also assume that failure of one component does not prevent other components in the bundle from becoming active?
If, for example, I have several components and one fails to initialise I would then like ALL other components to be deactivated and the bundle as a whole to be NOT active i.e. fail-fast.
Is there a way to do this with Declarative Services?