[cdi-dev] ProcessAnnotatedType question related to Seam-Config

Mark Struberg struberg at yahoo.de
Fri Oct 14 10:10:35 EDT 2011


Txs Jozef!

I've commented the issue in CDI-18.

LieGrue,
strub



----- Original Message -----
> From: Jozef Hartinger <jharting at redhat.com>
> To: Mark Struberg <struberg at yahoo.de>
> Cc: cdi-dev <cdi-dev at lists.jboss.org>
> Sent: Friday, October 14, 2011 1:57 PM
> Subject: Re: [cdi-dev] ProcessAnnotatedType question related to Seam-Config
> 
>T he fact that you can have multiple AnnotatedTypes per Java type is 
> clarified in CDI-58.
> 
> 
> On 10/14/2011 12:52 PM, Mark Struberg wrote:
>>  Hi!
>> 
>>  Currently tracking down why seam-config sometimes does not work work OWB.
>> 
>>  Seems that the issue is that OWB and Weld does tread AnnotatedTypes 
> registered with BeforeBeanDiscovery in a different way.
>> 
>>  Assume we have the following class in a BDA:
>> 
>>  @RequestScoped
>> 
>>  public class Doodings {
>>  ...
>>  }
>> 
>>  and you have a seam-beans.xml config  for it too
>> 
>>  Then seam-xml will add an AnnotatedType for it in @Observes 
> BeforeBeanDiscovery. So far so good.
>> 
>>  Later in the class scanning, when scanning Coodings.class, we (Apache 
> OpenWebBeans) recognizes that the class already has a prepared AnnotatedType and 
> use that for the system event. Apparently Weld does things different and creates 
> a fresh AnnotatedType purely based on the native class!
>>  That's the reason why seam-config in weld has to veto the freshly 
> scanned type to prevent double existence of Bean<Doodings>, and in OWB 
> this hack causes a problem...
>> 
>>  I think there is room for improvement in the specification of 
> AnnotatedTypes in the CDI spec ...
>> 
>>  The behaviour must get clarified imo, wdyt?
>> 
>>  LieGrue,
>>  strub
>> 
>> 
>>  _______________________________________________
>>  cdi-dev mailing list
>>  cdi-dev at lists.jboss.org
>>  https://lists.jboss.org/mailman/listinfo/cdi-dev
>



More information about the cdi-dev mailing list