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(a)redhat.com>
To: Gurkan Erdogdu <gurkanerdogdu(a)yahoo.com>
Cc: webbeans-dev(a)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(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/webbeans-dev