yes, you are right... I have to inject services of *any* type, only properties 
should be considered. I am working on a generic FailoverProxy that can be 
injected by the framework administrator for specific components that have high 
availability constraints. The implementor should be unaware of these 
constraints. The FailoverProxy acts as an intermediator between user an the 
actual service provider. It gets instantiated at runtime and by using a 
"reference.target" filter expression, the framework administrator can influence 
"from the outside" that a specific service proxy refgistered within the 
framework should replace the actual service.

The spec says for the "interface" in DS's reference descriptor: "... A service 
must be registered under this name to be considered for the set of target 
services." This is the explaination why "Object.class" is not working.

Thanks a lot.

Regards,
Jens
 

Gesendet: Freitag, 08. April 2016 um 11:32 Uhr
Von: "Neil Bartlett" <[email protected]>
An: [email protected]
Betreff: Re: [SCR] Selecting services without giving a service interface
Hi Jens,

Can you clarify please… are you saying that you want to inject services of 
*any* type, using some kind of filter that looks at the other properties of the 
service reference?

This is an unusual requirement, and I don’t think you can do it with DS’s event 
strategy. You should use a ServiceTracker instead.

Regards,
Neil


> On 8 Apr 2016, at 10:23, Jens Offenbach <[email protected]> wrote:
>
> Sorry, but I am confronted with a new problem.
>
> I am declaring a Reference annotation on a method, but I cannot declare a 
> service interface. If I declare nothing than Object gets used and nothing is 
> happening. When I remove the interface definition from my XML descriptor, SCR 
> validation fails with "An interface must be declared for the reference". I 
> have a filter expression that selects my services, but they do not have an 
> interface in common.
>
> I have to select some service based on a filter expression without indicating 
> a service interface. How is this achievable?
>
> Again... Thanks a lot for your help!
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
 

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to