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

Jakob Korherr commented on MYFACES-2945:
----------------------------------------

With the patch MYFACES-2945-FacesConfigurationMerger.patch the following is 
possible for Geronimo:

public class GeronimoFacesConfigurationMerger extends FacesConfigurationMerger
{

    private FacesConfigurationMerger myfacesProvider;

    public GeronimoFacesConfigurationMerger(FacesConfigurationMerger 
myfacesProvider)
    {
        this.myfacesProvider = myfacesProvider;
    }

    @Override
    public FacesConfigData getFacesConfigData(FacesConfigurationProvider 
facesConfigProvider, ExternalContext ectx)
    {
        FacesConfigData facesConfigData = getCachedData(ectx);

        if (facesConfigData == null)
        {
            // merge the data using MyFaces' FacesConfigurationMerger impl 
            facesConfigData = 
myfacesProvider.getFacesConfigData(facesConfigProvider, ectx);

            // cache it
            cacheFacesConfigData(facesConfigData, ectx);
        }

        return facesConfigData;
    }

    private FacesConfigData getCachedData(ExternalContext ectx)
    {
        // TODO get cached FacesConfigData instance
        return null;
    }

    private void cacheFacesConfigData(FacesConfigData facesConfigData, 
ExternalContext ectx)
    {
        // TODO cache data
    }

}

If no objections, I will commit this patch soon!

> Make a way to get the FacesConfig from a provider
> -------------------------------------------------
>
>                 Key: MYFACES-2945
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2945
>             Project: MyFaces Core
>          Issue Type: Improvement
>          Components: SPI
>    Affects Versions: 2.0.2
>            Reporter: Ivan
>            Assignee: Leonardo Uribe
>             Fix For: 2.0.3-SNAPSHOT
>
>         Attachments: MYFACES-2945-2.patch, MYFACES-2945-3.patch, 
> MYFACES-2945-FacesConfigurationMerger.patch
>
>
> Currently, MyFaces startup listener will parse the all the faces 
> configuration files and sort them on each startup time, and it will be better 
> to do it once in the deployment time, and get those data structure instances 
> from a provider. One possible way is to make those FacesConfig class 
> serializable.

-- 
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