public class CallbackPhaseListener extends Object implements PhaseListener
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.
Events
,
Serialized FormConstructor and Description |
---|
CallbackPhaseListener() |
Modifier and Type | Method and Description |
---|---|
static void |
add(PhaseListener phaseListener)
Adds the given phase listener to the current request scope.
|
void |
afterPhase(PhaseEvent event) |
void |
beforePhase(PhaseEvent event) |
PhaseId |
getPhaseId() |
static boolean |
remove(PhaseListener phaseListener)
Removes the given phase listener from the current request scope.
|
public PhaseId getPhaseId()
getPhaseId
in interface PhaseListener
public void beforePhase(PhaseEvent event)
beforePhase
in interface PhaseListener
public void afterPhase(PhaseEvent event)
afterPhase
in interface PhaseListener
public static void add(PhaseListener phaseListener)
phaseListener
- The phase listener to be added to the current request scope.public static boolean remove(PhaseListener phaseListener)
phaseListener
- The phase listener to be removed from the current request scope.true
if the current request scope indeed contained the given phase listener.Copyright © 2012–2020 OmniFaces. All rights reserved.