- All Implemented Interfaces:
PhaseListener,Serializable,EventListener
This phase listener picks up phase listener instances and phase event callbacks from the request scope subscribed via
subscribeToRequestXxxPhase() methods of the Events utility class and calls them back for each matching phase.
This differs in a few subtle ways from subscribeToViewXxxPhase() methods of the Events class which subscribes to the
view scope. Namely, this phase listener will execute slightly earlier for its before phase and slightly later for its after phase as compared to the view
scoped ones. Additionally, the phase listener instances and phase event callbacks registered via this phase listener will not become part of the view state,
but will execute only once during the current request instead of during every (postback) request on the same view.
- Since:
- 1.2
- Author:
- Arjan Tijms, Bauke Scholtz
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidadd(PhaseListener phaseListener) Adds the given phase listener to the current request scope.voidafterPhase(PhaseEvent event) voidbeforePhase(PhaseEvent event) static booleanremove(PhaseListener phaseListener) Removes the given phase listener from the current request scope.
-
Constructor Details
-
CallbackPhaseListener
public CallbackPhaseListener()
-
-
Method Details
-
getPhaseId
- Specified by:
getPhaseIdin interfacePhaseListener
-
beforePhase
- Specified by:
beforePhasein interfacePhaseListener
-
afterPhase
- Specified by:
afterPhasein interfacePhaseListener
-
add
Adds the given phase listener to the current request scope.- Parameters:
phaseListener- The phase listener to be added to the current request scope.
-
remove
Removes the given phase listener from the current request scope.- Parameters:
phaseListener- The phase listener to be removed from the current request scope.- Returns:
trueif the current request scope indeed contained the given phase listener.
-