felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcel Offermans <marcel.offerm...@luminis.eu>
Subject Re: How to use a service immediately after its activation?
Date Tue, 18 Mar 2014 22:09:51 GMT
Hello Bertrand,

On 18 Mar 2014, at 22:09 pm, Bertrand Delacretaz <bdelacretaz@apache.org> wrote
> On Tue, Mar 18, 2014 at 7:24 PM, David Jencks <david_jencks@yahoo.com> wrote:
>> ...If you have a DS component with a reference to your desired service, with a bind
method,
>> the bind method will be called at some point when the desired service is available,
>> whether the service or your component starts first...
> 
> Ah yes, of course...this makes me realize that what I'm actually
> looking for is a way for my code to interact with the service before
> DS components even see it, if that's possible.

From your description it almost sounds like you want some mechanism that is similar to how
a component that *needs* configuration before it can do its thing first publishes its ManagedService
interface and waits for updated to be invoked (with a valid configuration). After that has
happened will it publish its own, primary service interface.

On the other hand, you might actually need the desired service itself to talk to it before
other do with your current design. As others have pointed out, that's pretty much impossible.
So redesigning it in the direction mentioned above is something I would consider.

> So it looks like my core question is whether the framework or DS
> provide a "service is about to be made available" hook - is there such
> a thing? Barring that I guess my best option is to use a specific
> start level to run my piece of code in the appropriate startup phase.

Can you explain *why* you first need to talk to this service before other do? Perhaps that
explanation will trigger other design solutions.

Greetings, Marcel


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Mime
View raw message