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 Mon, 14 Oct 2013 16:48:43 GMT

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

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

I would prefer only one abstract method. 

abstract void inject(Object instance, String scope) 

and this one

void inject(Object instance)

with a default implementation that call inject(instance,null). But I like keep things simple
and avoid multiple methods in that part to override, so better one abstract method, because
after all, this method will be called only by JSF internals. Anyway is the same.

Who defines the scope of the injected object in this case? JSF. So as long as the bean container
provides the scope we need, everything will work well. Any disadvantage? I don't see anything
from JSF perspective. We are providing the necessary information to deal with the injection
to the bean container, that's it. It is up to the bean container how to deal with that.

Theorically there should be some structure that holds the injected reference to call preDestroy
in the right time. But in that sense, it is resposibility of JSF to deal with that logic.
If the instance is a Factory, FactoryFinder holds the instances. If is an application scope
artifact, the same and so on. There is no need to hold both the creationalContext and the
instance on the same place, more if we consider that creationalContext is a implementation
detail of CDI.

> 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
>             Fix For: 2.2.0
>
>         Attachments: cdiELresolverWeb.zip, cdiELResolver.zip, cdiPartialViewContext.war,
cdiPartialViewContext.zip, cdi.patch, cdiphaselistener1.patch, cdiphaselistener2.patch, cdirevised.patch,
cdiValidatorSource.zip, cdiValidator.war, MYFACES-3786-1.patch, MYFACES-3786-2.patch
>
>
>  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