|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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:
resolve(RequestCycle, RequestParameters)
is called to get the request target. A
request might refer to e.g. a bookmarkable page, a listener interface call on a component on a
previously rendered page, a shared resource or e.g. a non-wicket resource that resides in the web
application folder. processEvents(RequestCycle)
is called after the target is resolved. It is meant to
handle/ distribute events like e.g. listener interface calls on components. During this
processing, the request target may be changed (e.g. by calling setResponsePage). What actually
happens is that RequestCycle
holds a stack of targets, of which it will
take to last addition as the recent one, but walks the whole stack in order to do cleaning up
after the request is handled.respond(RequestCycle)
is called to create a response to the requesting client.
Typically, the actual response handling is to be (or delegated) by the request target
implementation, but different strategies might do as they seem fit. respond(RuntimeException, RequestCycle)
is called whenever an uncaught exception
occurs during the event handling or response phase so that an appropriate exception response can
be generated. This method is guaranteed to be called whenever such an exception happens, but will
never be called otherwise.
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 |
---|
IRequestCodingStrategy getRequestCodingStrategy()
RequestParameters
objects.
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.
requestCycle
- the current request cyclerequestParameters
- The request parameters object as decoded by this processor's
IRequestCodingStrategy
.
void processEvents(RequestCycle requestCycle)
resolve(RequestCycle, RequestParameters)
should return the page that that link
resides on, and this method should call the
ILinkListener
interface on that component.
requestCycle
- the current request cyclevoid respond(RequestCycle requestCycle)
requestCycle
- the current request cyclevoid respond(java.lang.RuntimeException e, RequestCycle requestCycle)
e
- any unhandled exceptionrequestCycle
- the current request cycle
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |