[weld-issues] [JBoss JIRA] Assigned: (WELD-313) create() method of container Bean implementations should be reproducible with user Bean implementations

David Allen (JIRA) jira-events at lists.jboss.org
Thu Dec 24 09:30:30 EST 2009


     [ https://jira.jboss.org/jira/browse/WELD-313?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Allen reassigned WELD-313:
--------------------------------

    Assignee: David Allen


> create() method of container Bean implementations should be reproducible with user Bean implementations
> -------------------------------------------------------------------------------------------------------
>
>                 Key: WELD-313
>                 URL: https://jira.jboss.org/jira/browse/WELD-313
>             Project: Weld
>          Issue Type: Bug
>          Components: Class Beans (Managed and Session)
>    Affects Versions: 1.0.0.GA
>            Reporter: Gavin King
>            Assignee: David Allen
>            Priority: Critical
>             Fix For: 1.0.1.CR1
>
>
> ManagedBean.create() looks like this:
>    public T create(CreationalContext<T> creationalContext)
>    {
>       T instance = getInjectionTarget().produce(creationalContext);
>       getInjectionTarget().inject(instance, creationalContext);
>       if (isInterceptionCandidate() && (hasCdiBoundInterceptors() || hasDirectlyDefinedInterceptors()))
>       {
>          InterceptionUtils.executePostConstruct(instance);
>       }
>       else
>       {
>          getInjectionTarget().postConstruct(instance);
>       }
>       return instance;
>    }
> The code that is aware of interceptors needs to be sucked into InjectionTarget.postConstruct(), since a portable extension can't easily reproduce that logic. create() should look like:
>    public T create(CreationalContext<T> creationalContext)
>    {
>       T instance = getInjectionTarget().produce(creationalContext);
>       getInjectionTarget().inject(instance, creationalContext);
>       getInjectionTarget().postConstruct(instance);
>       return instance;
>    }
> Same goes for destroy().

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the weld-issues mailing list