myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leonardo Uribe (JIRA)" <...@myfaces.apache.org>
Subject [jira] [Commented] (MYFACES-3786) Web Container injection support should be provided for additional lifecycle artifacts (not just managed beans)
Date Thu, 10 Oct 2013 11:16:44 GMT

    [ https://issues.apache.org/jira/browse/MYFACES-3786?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13791397#comment-13791397
] 

Leonardo Uribe commented on MYFACES-3786:
-----------------------------------------

Thinking more about this really the use of createNewInstanceAndInject(String className) is
very limited, because in JSF artifacts we usually have situations when we need to wrap multiple
objects and in those cases we pass the inner instance as a parameter of the constructor, so
we get back to this:

public abstract class org.apache.myfaces.spi.InjectionLifecycleProvider
{
    public abstract void inject(Object instance) throws InjectionLifecycleProviderException;
    public abstract void postConstruct(Object instance) throws InjectionLifecycleProviderException;

    public abstract void preDestroy(Object instance) throws InjectionLifecycleProviderException;
}

This means we cannot reuse the existing logic in LifecycleProvider2. But we can take advantage
of the fact that CDI has something similar it its code. If CDI is present, the default method
just try to inject using BeanManager API. If no CDI is present, an implementation will be
required, but to keep things working just use LifecycleProvider2 stuff in JSF ManagedBeans
only.

> Web Container injection support should be provided for additional lifecycle artifacts
(not just managed beans)
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: MYFACES-3786
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3786
>             Project: MyFaces Core
>          Issue Type: Task
>          Components: JSR-344
>            Reporter: Leonardo Uribe
>            Assignee: Leonardo Uribe
>         Attachments: cdiELresolverWeb.zip, cdiELResolver.zip, cdiPartialViewContext.war,
cdiPartialViewContext.zip, cdi.patch, cdiphaselistener1.patch, cdiphaselistener2.patch, cdiValidatorSource.zip,
cdiValidator.war
>
>
> This issue is all about how to inject beans into jsf artifacts.
> See JSF 2.2 section 5.4.1
> The problem here is in some point we need to give the control to the underlying environment
to inject beans into the artifacts, but we don't know much about how to properly do it, so
we need to try with examples.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Mime
View raw message