[cdi-dev] [JBoss JIRA] (CDI-392) Clarify when the operations of BeanManager can be called

Antoine Sabot-Durand (JIRA) issues at jboss.org
Wed Feb 26 05:43:47 EST 2014


    [ https://issues.jboss.org/browse/CDI-392?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12948247#comment-12948247 ] 

Antoine Sabot-Durand commented on CDI-392:
------------------------------------------

{quote}
Well, there is nothing in the API which says that this is optional for the BeanManager.
{quote}

If I look at the javadoc of `getBeans(Type beanType, Annotation... qualifiers)` at the end I read

{quote}
*Throws :*
*IllegalStateException* - if called during application initialization, before the AfterDeploymentValidation event is fired The container is permitted to define a non-portable mode in which getBeans(Type, Annotation...) may be called from an observer of the AfterBeanDiscovery event.
{quote}

My understanding was that it's not allowed but that an implementation is allowed to define a non-portable behavior by allowing the call after AfterBeanDiscovery event is fired.
>From what you say [~struberg], I understand that I misunderstood that point. So why don't we forbid definitively call to these operations before AfterDeploymentValidation event to avoid junior developers to create futur bugs ?
                
> Clarify when the operations of BeanManager can be called
> --------------------------------------------------------
>
>                 Key: CDI-392
>                 URL: https://issues.jboss.org/browse/CDI-392
>             Project: CDI Specification Issues
>          Issue Type: Clarification
>            Reporter: Matus Abaffy
>            Assignee: Mark Struberg
>              Labels: CDI_spec_chge, Ready_to_fix
>             Fix For: 1.2 Proposed
>
>
> The current version of spec. states (under 11.3. The BeanManager object): "Any operation of BeanManager may be called at any time during the execution of the application."
> This sentence is likely to be misinterpreted (see WELD-1453). Pointing out that BeanManager's methods can be called (without causing exception) just after AfterDeploymentValidation event is fired might be helpful.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the cdi-dev mailing list