openwebbeans-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gurkan Erdogdu <cgurkanerdo...@gmail.com>
Subject Re: Decorators with generic type-arguments
Date Wed, 20 Apr 2011 15:58:55 GMT
In your example, spec says that


   - the delegate type parameter is a type variable, the bean type parameter
   is an actual type, and the actual type is assignable
   to the upper bound, if any, of the type variable.

Actual Type of Bean Class --> Scope
Upper bound of type variable --> Annotation

Scope.isAssignableFrom(Annotation) --> False

Gurkan

2011/4/20 Arne Limburg <arne.limburg@openknowledge.de>

> Hi,
>
>
>
> Currently I try to get a Decorator working, that decorates an interface
> with a generic type argument. Although the Spec is quite clear about how to
> handle this (in 8.3.1) I am afraid, OpenWebBeans cannot handle it:
>
>
>
> This is the scenario
>
>
>
> @Decorator
>
> public class TestDecorator<A extends Annotation> implements
> GenericInterface<A> {
>
>   @Inject @Any @Delegate
>
>   private GenericInterface<A> delegate;
>
> }
>
>
>
> public class TestBean implements GenericInterface<Scope> {
>
>   …
>
> }
>
>
>
> I have tried various combinations of actual type arguments in the Decorator
> (like Wildcard, raw type, …). The above leads to a definition error. Some
> other combinations lead to a behavior where the Decorator is not applied.
> Even declaring the Decorator with the same actual type variable (Scope in
> the example) does not work?
>
> Would you consider this a bug or do I read the spec wrong and this is not
> supported.
>
>
>
> Shall I fill a Jira Issue?
>
>
>
> Regards,
>
> Arne
>
>
>
> --
>
>
>
> Arne Limburg - Enterprise Architect
>
> open knowledge GmbH, Oldenburg
>
> Bismarckstraße 13, 26122 Oldenburg
>
> Mobil: +49 (0) 151 108 22 942
>
> Tel: +49 (0) 441 - 4082-0
>
> Fax: +49 (0) 441 - 4082-111
>
> arne.limburg@openknowledge.de
>
> http://www.openknowledge.de
>
>
>
> Registergericht: Amtsgericht Oldenburg, HRB 4670
>
> Geschäftsführer: Lars Röwekamp, Jens Schumann
>
>
>



-- 
Gurkan Erdogdu
http://gurkanerdogdu.blogspot.com

Mime
View raw message