[cdi-dev] AfterBeanDiscovery in the light of CDI-392
antoine at sabot-durand.net
Wed Apr 16 16:30:25 EDT 2014
You’re right, we should clarify this point.
Do we agree that all the ProcessBean event should be queued for beans added during ABD ?
Le 16 avr. 2014 à 15:17, Jozef Hartinger <jharting at redhat.com> a écrit :
> Queuing ABD operations and applying them once all ABD observers are
> finished was part of the solution for CDI-392 however it seems that this
> part is not reflected within the specification :-/
> On 04/16/2014 01:08 PM, Martin Kouba wrote:
>> Hi all,
>> I see an inconsistency between the resolution of CDI-392 and the current
>> wording of "11.5.3. AfterBeanDiscovery event".
>> addBean(): "Fires an event of type ProcessBean containing the given Bean
>> and then registers the Bean with the container, thereby making it
>> available for injection into other beans. The given Bean may implement
>> Interceptor or Decorator."
>> On the other hand BeanManager.getBeans() javadoc:
>> "Note that when called during invocation of an AfterBeanDiscovery event
>> observer, this method will only return beans discovered by the container
>> before the AfterBeanDiscovery event is fired."
>> It seems ProcessBean should be fired and the bean should be registred
>> when addBean() is called BUT in the same time it should not be available
>> via BeanManager.getBeans() until all AfterBeanDiscovery observers are
>> The same applies to observer methods.
>> Weld 2.2.0.Final delays the ProcessBean/registration until all
>> AfterBeanDiscovery observers are processed (note that it's not backwards
>> compatible). I believe this is correct. If so, the AfterBeanDiscovery
>> event description should be clarified. Otherwise the RI must be changed
>> (and I'm afraid it wouldn't be that trivial).
> cdi-dev mailing list
> cdi-dev at lists.jboss.org
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 495 bytes
Desc: Message signed with OpenPGP using GPGMail
Url : http://lists.jboss.org/pipermail/cdi-dev/attachments/20140416/6c77ceb2/attachment.bin
More information about the cdi-dev