Search in sources :

Example 21 with ApplicationAssociate

use of com.sun.faces.application.ApplicationAssociate in project mojarra by eclipse-ee4j.

the class ELResolverInitPhaseListener method afterPhase.

// ---------------------------------------------- Methods From PhaseListener
/**
 * <p>
 * Handle a notification that the processing for a particular phase has just been completed.
 * </p>
 *
 * <p>
 * When invoked, this phase listener will remove itself as a registered <code>PhaseListener</code> with all
 * <code>Lifecycle</code> instances.
 */
@Override
public synchronized void afterPhase(PhaseEvent event) {
    if (!postInitCompleted && PhaseId.RENDER_RESPONSE.equals(event.getPhaseId())) {
        ApplicationAssociate associate = ApplicationAssociate.getInstance(event.getFacesContext().getExternalContext());
        associate.setRequestServiced();
        LifecycleFactory factory = (LifecycleFactory) FactoryFinder.getFactory(FactoryFinder.LIFECYCLE_FACTORY);
        // the lifecycle instances
        for (Iterator<String> i = factory.getLifecycleIds(); i.hasNext(); ) {
            Lifecycle lifecycle = factory.getLifecycle(i.next());
            lifecycle.removePhaseListener(this);
        }
        postInitCompleted = true;
    }
}
Also used : ApplicationAssociate(com.sun.faces.application.ApplicationAssociate) LifecycleFactory(jakarta.faces.lifecycle.LifecycleFactory) Lifecycle(jakarta.faces.lifecycle.Lifecycle)

Example 22 with ApplicationAssociate

use of com.sun.faces.application.ApplicationAssociate in project mojarra by eclipse-ee4j.

the class ELResolverInitPhaseListener method beforePhase.

@Override
public synchronized void beforePhase(PhaseEvent event) {
    if (!preInitCompleted) {
        ApplicationAssociate associate = ApplicationAssociate.getInstance();
        associate.setRequestServiced();
        associate.initializeELResolverChains();
        preInitCompleted = true;
    }
}
Also used : ApplicationAssociate(com.sun.faces.application.ApplicationAssociate)

Aggregations

ApplicationAssociate (com.sun.faces.application.ApplicationAssociate)22 FacesContext (jakarta.faces.context.FacesContext)5 NodeList (org.w3c.dom.NodeList)5 Application (jakarta.faces.application.Application)4 ArrayList (java.util.ArrayList)4 Map (java.util.Map)4 IOException (java.io.IOException)3 HashMap (java.util.HashMap)3 List (java.util.List)3 Document (org.w3c.dom.Document)3 Node (org.w3c.dom.Node)3 WebappLifecycleListener (com.sun.faces.application.WebappLifecycleListener)2 ELContextImpl (com.sun.faces.el.ELContextImpl)2 PostConstruct (jakarta.annotation.PostConstruct)2 ExternalContext (jakarta.faces.context.ExternalContext)2 ServletContext (jakarta.servlet.ServletContext)2 HttpSession (jakarta.servlet.http.HttpSession)2 URL (java.net.URL)2 ParserConfigurationException (javax.xml.parsers.ParserConfigurationException)2 Element (org.w3c.dom.Element)2