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

Jakob Korherr commented on MYFACES-2785:
----------------------------------------

Hi Leo,

Looking at the code of LifecycleProviderFactory, I think this solution is too 
complicated for this easy task. However I agree that we should make this more 
pluggable, thus I introduced a very easy FacesInitializerFactory which looks at 
the init param org.apache.myfaces.FACES_INITIALIZER to get a custom 
FacesInitializer. If it does not find this param, it just uses the default one. 
For now this should be pluggable enough, I think.

Yes, we totally should move some commons-discovery code into our codebase, 
however I would prefer to do that on a different jira issue.

Ok, yes. This is one of the things you can talk about for hours without getting 
a result. However your suggestion seems reasonable, thus I changed the code to 
set the UIViewRoot in AbstractFacesInitializer.

I will provide another patch shortly. If you have no objections, I will commit 
that one tomorrow!

> Clean up initialization code and add tests for StartupServletContextListener 
> and MyFacesServlet
> -----------------------------------------------------------------------------------------------
>
>                 Key: MYFACES-2785
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2785
>             Project: MyFaces Core
>          Issue Type: Task
>          Components: JSR-314
>    Affects Versions: 2.0.1-SNAPSHOT
>            Reporter: Jakob Korherr
>            Assignee: Jakob Korherr
>         Attachments: MYFACES-2785.patch
>
>
> Some major code clean up on the initialization of MyFaces:
> - The solution for startup and shutdown FacesContext implementations 
> (MYFACES-2730) introduced some duplicate code on StartupFacesContextImpl and 
> FacesContextImpl. This can be solved by providing a base implementation class 
> (like the one in for StartupExternalContext). This will make maintaining the 
> two FacesContext implementation very easy, because there are no duplicate 
> methods (except for getViewRoot() on StartupFacesContextImpl).
> - JUnit tests are needed to verify the behavior of 
> StartupServletContextListener and MyFacesServlet and to check if the 
> FacesContext is available on startup and shutdown
> - AbstractFacesInitializer should provide a static method to get the right 
> FacesInitializer impl instead of having several duplicate methods in 
> StartupServletContextListener and MyFacesServlet that do nothing but getting 
> the right impl and invoking some method on it.
> - AbstractFacesInitializer.dispatchInitDestroyEvent should use the 
> application object from the StartupFacesContextImpl and not directly from the 
> factory
> - AbstractFacesInitializer.getLifecycleId() is unused because of MYFACES-2730
> - initStartupFacesContext() and initShutdownFacesContext() should set the 
> field startup correctly (true or false) and should not create the UIViewRoot 
> directly (it should be created in StartupFacesContextImpl at first access)
> - minor javadoc copy and paste error on FacesInitializer

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to