Search in sources :

Example 1 with FacesConfigurationProvider

use of org.apache.myfaces.spi.FacesConfigurationProvider in project tomee by apache.

the class TomEEFacesConfigurationProviderFactory method getFacesConfigurationProvider.

@Override
public FacesConfigurationProvider getFacesConfigurationProvider(final ExternalContext externalContext) {
    FacesConfigurationProvider returnValue = (FacesConfigurationProvider) externalContext.getApplicationMap().get(FACES_CONFIGURATION_PROVIDER_INSTANCE_KEY);
    if (returnValue == null) {
        final ExternalContext extContext = externalContext;
        try {
            returnValue = resolveFacesConfigurationProviderFromService(extContext);
            externalContext.getApplicationMap().put(FACES_CONFIGURATION_PROVIDER_INSTANCE_KEY, returnValue);
        } catch (final ClassNotFoundException | NoClassDefFoundError e) {
        // ignore
        } catch (final InstantiationException | InvocationTargetException | IllegalAccessException e) {
            getLogger().log(Level.SEVERE, "", e);
        } catch (final PrivilegedActionException e) {
            throw new FacesException(e);
        }
    }
    return returnValue;
}
Also used : PrivilegedActionException(java.security.PrivilegedActionException) ExternalContext(javax.faces.context.ExternalContext) FacesConfigurationProvider(org.apache.myfaces.spi.FacesConfigurationProvider) InvocationTargetException(java.lang.reflect.InvocationTargetException) FacesException(javax.faces.FacesException)

Aggregations

InvocationTargetException (java.lang.reflect.InvocationTargetException)1 PrivilegedActionException (java.security.PrivilegedActionException)1 FacesException (javax.faces.FacesException)1 ExternalContext (javax.faces.context.ExternalContext)1 FacesConfigurationProvider (org.apache.myfaces.spi.FacesConfigurationProvider)1