From: John Wells <john.wells_at_oracle.com>
Date: Wed, 28 May 2014 14:46:31 -0400
When you are using a binder none of the annotations are honored, instead
all information comes from the binding itself. This allows people to
have ghost annotations and ghost scopes and even different scopes from
what is annotated on the class.
On 5/28/2014 1:29 PM, Zack Manning wrote:
> When binding a singleton scoped class within an AbstractBinder, I notice that I always have to chain .in(Singleton.class) to every binding, regardless of if my class has @Singleton at the class level. Does HK2 actually pay attention to the singleton binding on the class? Or is this a bug?
>
> ….
>
> bindAsContract(SingleUseTokenCache.class).in(Singleton.class); //i wish this didnt need the latter
>
> ….
>
> @Singleton
> public class SingleUseTokenCache {
> ….
>
> Just some clarification would be much appreciated as it makes the configuration look muddier than it needs to be.
>
> Zack