org.apache.wicket.request
Interface IRequestCycleProcessor

All Known Implementing Classes:
AbstractRequestCycleProcessor, UrlCompressingWebRequestProcessor, WebRequestCycleProcessor

public interface IRequestCycleProcessor

The request cycle processor is responsible for handling the steps of a request cycle. It's methods are called in a pre-defined order:

Author:
hillenius
See Also:
AbstractRequestCycleProcessor, WebRequestCycleProcessor

Method Summary
 IRequestCodingStrategy getRequestCodingStrategy()
          Gets the object that is responsible for encoding request targets (like url's in links etc) and decoding urls and request parameters etc into RequestParameters objects.
 void processEvents(RequestCycle requestCycle)
          After a page is restored, this method is responsible for calling any event handling code based on the request.
 IRequestTarget resolve(RequestCycle requestCycle, RequestParameters requestParameters)
           Resolves the request and returns the request target.
 void respond(RequestCycle requestCycle)
          After the target is resolved and the request events are handled, it is time to respond to the request.
 void respond(java.lang.RuntimeException e, RequestCycle requestCycle)
          Whenever a unhandled exception is encountered during the processing of a request cycle, this method is called to respond to the request in a proper way.
 

Method Detail

getRequestCodingStrategy

IRequestCodingStrategy getRequestCodingStrategy()
Gets the object that is responsible for encoding request targets (like url's in links etc) and decoding urls and request parameters etc into RequestParameters objects.

Returns:
the request encoder

resolve

IRequestTarget resolve(RequestCycle requestCycle,
                       RequestParameters requestParameters)

Resolves the request and returns the request target. Typically, the resolver uses the RequestParameters object that is passed in.

Implementors of this method should be careful not to mix this code with event handling code; method processEvents(RequestCycle) is meant for that purpose.

Parameters:
requestCycle - the current request cycle
requestParameters - The request parameters object as decoded by this processor's IRequestCodingStrategy.
Returns:
the request target; has to be non-null!

processEvents

void processEvents(RequestCycle requestCycle)
After a page is restored, this method is responsible for calling any event handling code based on the request. For example, when a link is clicked, resolve(RequestCycle, RequestParameters) should return the page that that link resides on, and this method should call the ILinkListener interface on that component.

Parameters:
requestCycle - the current request cycle

respond

void respond(RequestCycle requestCycle)
After the target is resolved and the request events are handled, it is time to respond to the request. This method is responsible for executing the proper response sequence given the current request target and response.

Parameters:
requestCycle - the current request cycle

respond

void respond(java.lang.RuntimeException e,
             RequestCycle requestCycle)
Whenever a unhandled exception is encountered during the processing of a request cycle, this method is called to respond to the request in a proper way.

Parameters:
e - any unhandled exception
requestCycle - the current request cycle


Copyright © 2004-2010 Apache Software Foundation. All Rights Reserved.