Hi Rupert

You can have a servicereference as argument to the bind method and
dereference them when the prerequisites are met.

Cheers,
Reto
On Nov 18, 2011 11:48 AM, "Rupert Westenthaler" <
[email protected]> wrote:

> Hi
>
> The situation (in pseudo code)
>
> @Component(configurationFactory = true)
> MyServiceImpl {
>
> ServiceTracker requiredServiceTracker;
>
>  void activate(ComponentContext context) {
>        //create Filter based on properties of the context
>        Filter filter;
>       requiredServiceTracker = new ServiceTracker(filter);
>  }
>
> }
>
> What I want to do is to switch Component instances to "unsatisfied" as
> soon as the required service becomes unavailable and back to the "activate"
> state as soon as it becomes available again.
>
> If I would use @Reference than the Declarative Services would take care of
> activating the service as soon as all dependencies are available. However I
> con not use @Reference here, because the parameter for the Filter are only
> available at runtime an filters in @Reference annotations need to be static.
>
> So basically I am searching for a way (interface, extension point) that
> allows me to use the same System with "runtime" dependencies.
>
> any Ideas?
>
> best
> Rupert

Reply via email to