Dear Karaf users,

I'm aware that this post is more about OSGi, but you were so helpful so far,
that I hope it will be the same this time :)

I have a case with three requirements explained below:

1) I must implement "something" (Bundle or Component) that will receive
configuration (placed in $KARAF_HOME/etc/myPID.cfg), therefore I can use

a) BundleActivator with ManagedService approach:

b) DeclarativeService approach:

2) But the second requirement is, that config MUST be available before
Bundle/Component starts (because my Bundle/Component must authenticate
itself using credentials from the config). Therefore:

a) I have no idea how to achieve it using BundleActivator

b) Using DeclarativeService approach it is easy:

3) And the third requirement is: if authentication fails - bundle must stop

a) it is easy using BundleActivator, because if start method throws
exception - Bundle stops itself

b) I have no idea how to achieve it using DeclarativeService (let's say that
there is just one service per bundle)

Could you help me please with figuring out how I can achieve all three
requirements at the same time?

Kind regards,

Sent from:

Reply via email to