org.apache.myfaces.extensions.cdi.jsf.impl.listener.phase
Class PhaseListenerExtension

java.lang.Object
  extended by org.apache.myfaces.extensions.cdi.jsf.impl.listener.phase.PhaseListenerExtension
All Implemented Interfaces:
javax.enterprise.inject.spi.Extension

public class PhaseListenerExtension
extends Object
implements javax.enterprise.inject.spi.Extension

The PhaseListenerExtension picks up all JsfPhaseListener annotated beans for later registration as PhaseListeners. We have to maintain this separately for each ContextClassLoader since it is possible that multiple WebApps start up in parallel.


Constructor Summary
PhaseListenerExtension()
           
 
Method Summary
static List<javax.faces.event.PhaseListener> consumePhaseListeners()
          Exposes the found phase-listeners for the invocation.
 void filterJsfPhaseListeners(javax.enterprise.inject.spi.ProcessAnnotatedType processAnnotatedType)
          Filters beans annotated with JsfPhaseListener.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PhaseListenerExtension

public PhaseListenerExtension()
Method Detail

filterJsfPhaseListeners

public void filterJsfPhaseListeners(@Observes
                                    javax.enterprise.inject.spi.ProcessAnnotatedType processAnnotatedType)
Filters beans annotated with JsfPhaseListener. The class will be stored for consuming it later (see #consumePhaseListeners)

Parameters:
processAnnotatedType - current process-annotated-type

consumePhaseListeners

public static List<javax.faces.event.PhaseListener> consumePhaseListeners()
Exposes the found phase-listeners for the invocation. Afterwards it will return an empty list.

Returns:
found phase-listeners for the first invocation, an empty list if there are no phase-listeners or if they are consumed already.


Copyright © 2010-2011 The Apache Software Foundation. All Rights Reserved.