[webbeans-dev] TypeVariabe Event Type

Gurkan Erdogdu gurkanerdogdu at yahoo.com
Wed Aug 26 15:33:36 EDT 2009


I also implemented ProcessAnnotatedType like 

public class ProcessAnnotatedTypeImpl<X> impements ProcessAnnotatedType<X>{}

then firing event like this
ProcessAnnotatedType<X> event = new ProcessAnnotatedTypeImpl<X>();
or
ProcessAnnotatedType<?> event = new ProcessAnnotatedType();

Then in BeanManagerImpl.fireEvent(Object event, ....)
event.getClass.getTypeParameters always returns TypeVariables.

>>>You must create a sub class, this then allows Java to resolve the type variables
What do you mean by saying "allows Java to resolve the type variables"?

--Gurkan




________________________________
From: Pete Muir <pmuir at redhat.com>
To: Gurkan Erdogdu <gurkanerdogdu at yahoo.com>
Cc: webbeans-dev at lists.jboss.org
Sent: Wednesday, August 26, 2009 10:21:54 PM
Subject: Re: [webbeans-dev] TypeVariabe Event Type

Yes, you can't fire an event of type Foo<T>. You must create a sub class, this then allows Java to resolve the type variables. In the RI we do

new ProcessAnnotatedTypeImpm<T>() {};

to achieve this.

On 26 Aug 2009, at 20:15, Gurkan Erdogdu wrote:

> Hi;
> 
> In method, public void fireEvent(Object event, Annotation... qualifiers) in BeanManager; spec specifies that runtime event type can not be TypeVariable. But when I look at portable events, all of them contain type variable.
> 
> For Example;
> 
> ProcessAnnotatedType<X>
> 
> When fires this event, event.getClass.getTypeVariables always contain TypeVariable.
> 
> Is this true?
> 
> Thanks;
> 
> --Gurkan
> 
> 
> _______________________________________________
> webbeans-dev mailing list
> webbeans-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/webbeans-dev


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/weld-dev/attachments/20090826/b1ffff42/attachment.html 


More information about the weld-dev mailing list