Hello all,

We have a system where we use Felix Configurator in order to
initiate/activate a set of DeclarativeService bootstrap components (with
configurationPolicy = ConfigurationPolicy.REQUIRE,) as soon as the
container get started. Those components are triggering the activation of
other immediate components that referring them with a
ReferenceCardinality.MANDATORY.

Now I need to integrate with a tool that provides me an async startup
method and returns a CompletionStage: CompletionStage<InitMeta>
startup(Config config).

I'm in doubt how would be the best way to deal with this kind of async
startup process inside the component's activate() method. I must ensure
that DS will not activate others components before this async tool is
started and also do not prevent that not related components do activate
properly.

I have not sure yet, but I think that calling
startup().toCompletableFuture().get(), a blocking method, will block the
DS thread and prevent others components from being activated. Also, I
think that if I don't block then DS will consider this bootstrap
component activated and will trigger the activation of other components,
even if the tool's startup do fail later. Am I right?

could someone please give me some tip?

thanks and best regards,

Cristiano


Reply via email to