public class RequestCycleListenerCollection extends ListenerCollection<IRequestCycleListener> implements IRequestCycleListener
IRequestCycleListener
that notifies all registered listeners with each
IRequestCycleListener event.
onBeginRequest(RequestCycle)
, onRequestHandlerScheduled(RequestCycle, IRequestHandler)
and
onRequestHandlerResolved(RequestCycle, IRequestHandler)
are notified in first in, first out order.
onEndRequest(RequestCycle)
and onDetach(RequestCycle)
are notified in last in
first out order (i.e. reversed order). So for these events the collection functions as a stack.
The RequestCycleListenerCollection
will use the first exception handler that is returned
from all listeners in onException(RequestCycle, Exception)
ListenerCollection.INotifier<T>
Constructor and Description |
---|
RequestCycleListenerCollection() |
Modifier and Type | Method and Description |
---|---|
void |
onBeginRequest(RequestCycle cycle)
Notifies all registered listeners of the onBeginRequest event in first in first out order,
i.e.
|
void |
onDetach(RequestCycle cycle)
Notifies all registered listeners of the
onDetach event in first in last out order
(i.e. |
void |
onEndRequest(RequestCycle cycle)
Notifies all registered listeners of the
onEndRequest event in first in last out
order (i.e. |
IRequestHandler |
onException(RequestCycle cycle,
Exception ex)
Notifies all registered listeners of the exception and calls the first handler that was
returned by the listeners.
|
void |
onExceptionRequestHandlerResolved(RequestCycle cycle,
IRequestHandler handler,
Exception exception)
Called when an
IRequestHandler is resolved for an exception and will be executed. |
void |
onRequestHandlerExecuted(RequestCycle cycle,
IRequestHandler handler)
Called after an
IRequestHandler has been executed. |
void |
onRequestHandlerResolved(RequestCycle cycle,
IRequestHandler handler)
Called when an
IRequestHandler is resolved and will be executed. |
void |
onRequestHandlerScheduled(RequestCycle cycle,
IRequestHandler handler)
Called when a
IRequestHandler has been scheduled. |
void |
onUrlMapped(RequestCycle cycle,
IRequestHandler handler,
Url url)
Called after a Url is generated for a
IRequestHandler . |
add, isAllowingDuplicates, isAllowingNulls, iterator, notify, notifyIgnoringExceptions, remove, reversedNotify, reversedNotifyIgnoringExceptions
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public void onBeginRequest(RequestCycle cycle)
onBeginRequest
.onBeginRequest
in interface IRequestCycleListener
public void onEndRequest(RequestCycle cycle)
onEndRequest
event in first in last out
order (i.e. the last listener that received an #onBeginRequest
will be the first to
get notified of an onEndRequest
.onEndRequest
in interface IRequestCycleListener
IRequestCycleListener.onEndRequest(RequestCycle)
public void onDetach(RequestCycle cycle)
onDetach
event in first in last out order
(i.e. the last listener that received an #onBeginRequest
will be the first to get
notified of an onDetach
.onDetach
in interface IRequestCycleListener
IRequestCycleListener.onDetach(RequestCycle)
public IRequestHandler onException(RequestCycle cycle, Exception ex)
onException
in interface IRequestCycleListener
cycle
- The current request cycle
ex
- the exception that was passed in to
RequestCycle.handleException(Exception)
null
if none. If a request handler
is returned, it will override any configured
exception mapper
.IRequestCycleListener.onException(RequestCycle, Exception)
public void onRequestHandlerResolved(RequestCycle cycle, IRequestHandler handler)
IRequestCycleListener
IRequestHandler
is resolved and will be executed.onRequestHandlerResolved
in interface IRequestCycleListener
public void onExceptionRequestHandlerResolved(RequestCycle cycle, IRequestHandler handler, Exception exception)
IRequestCycleListener
IRequestHandler
is resolved for an exception and will be executed.onExceptionRequestHandlerResolved
in interface IRequestCycleListener
public void onRequestHandlerScheduled(RequestCycle cycle, IRequestHandler handler)
IRequestCycleListener
IRequestHandler
has been scheduled. Can be called multiple times during
a request when new handlers get scheduled for processing.onRequestHandlerScheduled
in interface IRequestCycleListener
RequestCycle.scheduleRequestHandlerAfterCurrent(IRequestHandler)
public void onRequestHandlerExecuted(RequestCycle cycle, IRequestHandler handler)
IRequestCycleListener
IRequestHandler
has been executed. If the execution resulted in an
exception this method will not be called for that particular IRequestHandler
.onRequestHandlerExecuted
in interface IRequestCycleListener
public void onUrlMapped(RequestCycle cycle, IRequestHandler handler, Url url)
IRequestCycleListener
IRequestHandler
. This method can be used to
modify generated urls, for example query parameters can be added.onUrlMapped
in interface IRequestCycleListener
Copyright © 2006–2022 Apache Software Foundation. All rights reserved.