users@hk2.java.net

Re: ContractsProvided and Qualifiers

From: John Wells <john.wells_at_oracle.com>
Date: Tue, 13 May 2014 08:00:36 -0400

The bind family of calls do not honor any of the annotations on the
class (including @Contract, @ContractsProvided or any annotation with
@Qualifier). Instead you must always explicitly add all the contracts
and qualifiers in your bind chain.

If you want automatic analysis of your classes instead of using bind use
ServiceLocatorUtilities.addClasses.

On 5/13/2014 7:11 AM, buko wrote:
> Spoke to soon. Looks like another bug with ContractsProvided: if you
> have qualifier annotations on a service with ContractsProvided it
> seems those qualifier annotations are simply ignored and cannot be
> used to find the service later.