org.apache.wicket.request.cycle
Class PageRequestHandlerTracker

java.lang.Object
  extended by org.apache.wicket.request.cycle.AbstractRequestCycleListener
      extended by org.apache.wicket.request.cycle.PageRequestHandlerTracker
All Implemented Interfaces:
IRequestCycleListener

public class PageRequestHandlerTracker
extends AbstractRequestCycleListener

Registers and retrieves first and last IPageRequestHandler in a request cycle. Can be used to find out what is the requested page and what is the actual response page.

To use it an application needs to register it with:


          application.getRequestCycleListeners().add(new PageRequestHandlerTracker());
     

Since:
1.5.8

Field Summary
static MetaDataKey<IPageRequestHandler> FIRST_HANDLER_KEY
          The key for the first handler
static MetaDataKey<IPageRequestHandler> LAST_HANDLER_KEY
          The key for the last handler
 
Constructor Summary
PageRequestHandlerTracker()
           
 
Method Summary
static IPageRequestHandler getFirstHandler(RequestCycle cycle)
          retrieves first handler from the request cycle
static IPageRequestHandler getLastHandler(RequestCycle cycle)
          retrieves last handler from requestcycle
 void onExceptionRequestHandlerResolved(RequestCycle cycle, IRequestHandler handler, Exception exception)
          Called when an IRequestHandler is resolved for an exception and will be 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.
 
Methods inherited from class org.apache.wicket.request.cycle.AbstractRequestCycleListener
onBeginRequest, onDetach, onEndRequest, onException, onRequestHandlerExecuted, onUrlMapped
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FIRST_HANDLER_KEY

public static final MetaDataKey<IPageRequestHandler> FIRST_HANDLER_KEY
The key for the first handler


LAST_HANDLER_KEY

public static final MetaDataKey<IPageRequestHandler> LAST_HANDLER_KEY
The key for the last handler

Constructor Detail

PageRequestHandlerTracker

public PageRequestHandlerTracker()
Method Detail

onRequestHandlerResolved

public void onRequestHandlerResolved(RequestCycle cycle,
                                     IRequestHandler handler)
Description copied from interface: IRequestCycleListener
Called when an IRequestHandler is resolved and will be executed.

Specified by:
onRequestHandlerResolved in interface IRequestCycleListener
Overrides:
onRequestHandlerResolved in class AbstractRequestCycleListener

onRequestHandlerScheduled

public void onRequestHandlerScheduled(RequestCycle cycle,
                                      IRequestHandler handler)
Description copied from interface: IRequestCycleListener
Called when a IRequestHandler has been scheduled. Can be called multiple times during a request when new handlers get scheduled for processing.

Specified by:
onRequestHandlerScheduled in interface IRequestCycleListener
Overrides:
onRequestHandlerScheduled in class AbstractRequestCycleListener
See Also:
RequestCycle.scheduleRequestHandlerAfterCurrent(IRequestHandler)

onExceptionRequestHandlerResolved

public void onExceptionRequestHandlerResolved(RequestCycle cycle,
                                              IRequestHandler handler,
                                              Exception exception)
Description copied from interface: IRequestCycleListener
Called when an IRequestHandler is resolved for an exception and will be executed.

Specified by:
onExceptionRequestHandlerResolved in interface IRequestCycleListener
Overrides:
onExceptionRequestHandlerResolved in class AbstractRequestCycleListener

getLastHandler

public static IPageRequestHandler getLastHandler(RequestCycle cycle)
retrieves last handler from requestcycle

Parameters:
cycle -
Returns:
last handler

getFirstHandler

public static IPageRequestHandler getFirstHandler(RequestCycle cycle)
retrieves first handler from the request cycle

Parameters:
cycle -
Returns:
first handler


Copyright © 2006–2016 Apache Software Foundation. All rights reserved.