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

Leonardo Uribe commented on MYFACES-2945:
-----------------------------------------

Attached to this issue there is a possible patch implementing option "2". This 
is not a final solution, it requires some cleanup.

In few words, the patch does two things:

1. Convert all interfaces on org.apache.myfaces.config.element to abstract 
classes that implements Serializable interface.
2. Provide an interface like this:

public abstract class FacesConfigurationProvider
{
    public abstract FacesConfig getStandardFacesConfig(ExternalContext ectx);
    
    public abstract FacesConfig getMetaInfServicesFacesConfig(ExternalContext 
ectx);
    
    public abstract FacesConfig getAnnotationsFacesConfig(ExternalContext ectx, 
boolean metadataComplete);
    
    public abstract List<FacesConfig> getClassloaderFacesConfig(ExternalContext 
ectx);
    
    public abstract List<FacesConfig> 
getContextSpecifiedFacesConfig(ExternalContext ectx);
    
    public abstract FacesConfig getWebAppFacesConfig(ExternalContext ectx);
    
}

The advantage of this interface is that it allows better customization, but the 
disadvantage is maybe it goes too far and that kind of detail level is not 
necessary. Maybe keep things simple and just provide a Serializable 
FacesConfigDispenser (requires some changes here) is enough. But if that so, an 
interface with a method like this

Serializable getFacesConfig(ExternalContext ectx)

could be the way to go. In theory it is not necessary to expose FacesConfig or 
FacesConfigDispenser on the method, because the intention is just cache this 
value.

Suggestions are welcome.

> 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: General
>    Affects Versions: 2.0.2
>            Reporter: Ivan
>            Assignee: Leonardo Uribe
>         Attachments: MYFACES-2945-1.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