org.apache.wicket.request
Class AbstractRequestCycleProcessor

java.lang.Object
  extended by org.apache.wicket.request.AbstractRequestCycleProcessor
All Implemented Interfaces:
IRequestCycleProcessor
Direct Known Subclasses:
WebRequestCycleProcessor

public abstract class AbstractRequestCycleProcessor
extends java.lang.Object
implements IRequestCycleProcessor

Default abstract implementation of IRequestCycleProcessor.

Author:
eelcohillenius

Constructor Summary
AbstractRequestCycleProcessor()
          Construct.
 
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.
protected abstract  IRequestCodingStrategy newRequestCodingStrategy()
          Creates a new request coding strategy instance.
protected  Page onRuntimeException(Page page, java.lang.RuntimeException e)
          This method is called when a runtime exception is thrown, just before the actual handling of the runtime exception.
 void processEvents(RequestCycle requestCycle)
          After a page is restored, this method is responsible for calling any event handling code based on the request.
protected  IRequestTarget resolveBookmarkablePage(RequestCycle requestCycle, RequestParameters requestParameters)
          Resolves to a bookmarkable page target.
protected  IRequestTarget resolveExternalResource(RequestCycle requestCycle)
          Resolves to an external resource.
protected  IRequestTarget resolveHomePageTarget(RequestCycle requestCycle, RequestParameters requestParameters)
          Resolves to a home page target.
protected  IRequestTarget resolveListenerInterfaceTarget(RequestCycle requestCycle, Page page, java.lang.String componentPath, java.lang.String interfaceName, RequestParameters requestParameters)
          Resolves the RequestTarget for the given interface.
protected  IRequestTarget resolveRenderedPage(RequestCycle requestCycle, RequestParameters requestParameters)
          Resolves to a page target that was previously rendered.
protected  IRequestTarget resolveSharedResource(RequestCycle requestCycle, RequestParameters requestParameters)
          Resolves to a shared resource 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.wicket.request.IRequestCycleProcessor
resolve
 

Constructor Detail

AbstractRequestCycleProcessor

public AbstractRequestCycleProcessor()
Construct.

Method Detail

getRequestCodingStrategy

public IRequestCodingStrategy getRequestCodingStrategy()
Description copied from interface: IRequestCycleProcessor
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.

Specified by:
getRequestCodingStrategy in interface IRequestCycleProcessor
Returns:
the request encoder
See Also:
IRequestCycleProcessor.getRequestCodingStrategy()

processEvents

public void processEvents(RequestCycle requestCycle)
Description copied from interface: IRequestCycleProcessor
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, IRequestCycleProcessor.resolve(RequestCycle, RequestParameters) should return the page that that link resides on, and this method should call the ILinkListener interface on that component.

Specified by:
processEvents in interface IRequestCycleProcessor
Parameters:
requestCycle - the current request cycle
See Also:
IRequestCycleProcessor.processEvents(org.apache.wicket.RequestCycle)

respond

public void respond(RequestCycle requestCycle)
Description copied from interface: IRequestCycleProcessor
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.

Specified by:
respond in interface IRequestCycleProcessor
Parameters:
requestCycle - the current request cycle
See Also:
IRequestCycleProcessor.respond(org.apache.wicket.RequestCycle)

respond

public void respond(java.lang.RuntimeException e,
                    RequestCycle requestCycle)
Description copied from interface: IRequestCycleProcessor
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.

Specified by:
respond in interface IRequestCycleProcessor
Parameters:
e - any unhandled exception
requestCycle - the current request cycle
See Also:
IRequestCycleProcessor.respond(java.lang.RuntimeException, org.apache.wicket.RequestCycle)

newRequestCodingStrategy

protected abstract IRequestCodingStrategy newRequestCodingStrategy()
Creates a new request coding strategy instance. this is (typically) called once at the first time getRequestCodingStrategy() is called.

Returns:
a new request coding strategy

onRuntimeException

protected Page onRuntimeException(Page page,
                                  java.lang.RuntimeException e)
This method is called when a runtime exception is thrown, just before the actual handling of the runtime exception. This implementation passes the call through to RequestCycle.onRuntimeException(Page, RuntimeException). Note that if you override this method RequestCycle.onRuntimeException(Page, RuntimeException) will not be supported.

Parameters:
page - Any page context where the exception was thrown
e - The exception
Returns:
Any error page to redirect to

resolveBookmarkablePage

protected IRequestTarget resolveBookmarkablePage(RequestCycle requestCycle,
                                                 RequestParameters requestParameters)
Resolves to a bookmarkable page target.

Parameters:
requestCycle - the current request cycle
requestParameters - the request parameters object
Returns:
the bookmarkable page as a request target

resolveExternalResource

protected IRequestTarget resolveExternalResource(RequestCycle requestCycle)
Resolves to an external resource.

Parameters:
requestCycle - The current request cycle
Returns:
The external resource request target

resolveHomePageTarget

protected IRequestTarget resolveHomePageTarget(RequestCycle requestCycle,
                                               RequestParameters requestParameters)
Resolves to a home page target.

Parameters:
requestCycle - the current request cycle.
requestParameters - the request parameters object
Returns:
the home page as a request target

resolveListenerInterfaceTarget

protected IRequestTarget resolveListenerInterfaceTarget(RequestCycle requestCycle,
                                                        Page page,
                                                        java.lang.String componentPath,
                                                        java.lang.String interfaceName,
                                                        RequestParameters requestParameters)
Resolves the RequestTarget for the given interface. This method can be overridden if some special interface needs to resolve to its own target.

Parameters:
requestCycle - The current RequestCycle object
page - The page object which holds the component for which this interface is called on.
componentPath - The component path for looking up the component in the page.
interfaceName - The interface to resolve.
requestParameters -
Returns:
The RequestTarget that was resolved

resolveRenderedPage

protected IRequestTarget resolveRenderedPage(RequestCycle requestCycle,
                                             RequestParameters requestParameters)
Resolves to a page target that was previously rendered. Optionally resolves to a component call target, which is a specialization of a page target. If no corresponding page could be found, a expired page target will be returned.

Parameters:
requestCycle - the current request cycle
requestParameters - the request parameters object
Returns:
the previously rendered page as a request target

resolveSharedResource

protected IRequestTarget resolveSharedResource(RequestCycle requestCycle,
                                               RequestParameters requestParameters)
Resolves to a shared resource target.

Parameters:
requestCycle - the current request cycle
requestParameters - the request parameters object
Returns:
the shared resource as a request target


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