|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.wicket.request.cycle.RequestCycle
public class RequestCycle
RequestCycle
consists of two steps:
IRequestHandler
execution the handler can schedule another IRequestHandler
to run after it is done, or replace all IRequestHandler
s on stack with another
IRequestHandler
.
scheduleRequestHandlerAfterCurrent(IRequestHandler)
,
replaceAllRequestHandlers(IRequestHandler)
Constructor Summary | |
---|---|
RequestCycle(RequestCycleContext context)
Construct. |
Method Summary | ||
---|---|---|
void |
detach()
Detaches RequestCycle state. |
|
|
find(Class<T> type)
Finds a IRequestHandler which is either the currently executing handler or is scheduled to be executed. |
|
static RequestCycle |
get()
Returns request cycle associated with current thread. |
|
IRequestHandler |
getActiveRequestHandler()
|
|
protected int |
getExceptionRetryCount()
|
|
RequestCycleListenerCollection |
getListeners()
|
|
|
getMetaData(MetaDataKey<T> key)
Gets metadata for this request cycle using the given key. |
|
Response |
getOriginalResponse()
Get the original response the request was created with. |
|
Request |
getRequest()
|
|
IRequestHandler |
getRequestHandlerScheduledAfterCurrent()
|
|
Response |
getResponse()
|
|
long |
getStartTime()
|
|
UrlRenderer |
getUrlRenderer()
Returns UrlRenderer for this RequestCycle . |
|
protected IRequestHandler |
handleException(Exception e)
Return IRequestHandler for the given exception. |
|
boolean |
isCleanupFeedbackMessagesOnDetach()
Deprecated. see IApplicationSettings.getFeedbackMessageCleanupFilter()
TODO 7.0 remove |
|
|
mapUrlFor(Class<C> pageClass,
PageParameters parameters)
Returns a bookmarkable URL that references a given page class using a given set of page parameters. |
|
Url |
mapUrlFor(IRequestHandler handler)
Returns URL for the request handler or null if the handler couldn't have been
encoded. |
|
Url |
mapUrlFor(ResourceReference reference,
PageParameters params)
Returns a Url for the resource reference |
|
protected UrlRenderer |
newUrlRenderer()
|
|
protected void |
onBeginRequest()
Called when the request cycle object is beginning its response |
|
void |
onDetach()
Called after request processing is complete, usually takes care of detaching state |
|
protected void |
onEndRequest()
Called when the request cycle object has finished its response |
|
void |
onEvent(IEvent<?> event)
Called when an event is sent to this sink |
|
boolean |
processRequest()
Processes the request. |
|
boolean |
processRequestAndDetach()
Convenience method that processes the request and detaches the RequestCycle . |
|
void |
replaceAllRequestHandlers(IRequestHandler handler)
|
|
protected IRequestHandler |
resolveRequestHandler()
Resolves current request to a IRequestHandler . |
|
void |
scheduleRequestHandlerAfterCurrent(IRequestHandler handler)
|
|
void |
setCleanupFeedbackMessagesOnDetach(boolean cleanupFeedbackMessagesOnDetach)
Deprecated. see isCleanupFeedbackMessagesOnDetach()
TODO 7.0 remove |
|
|
setMetaData(MetaDataKey<T> key,
T object)
Sets the metadata for this request cycle using the given key. |
|
void |
setRequest(Request request)
INTERNAL This method is for internal Wicket use. |
|
Response |
setResponse(Response response)
|
|
void |
setResponsePage(Class<? extends IRequestablePage> pageClass)
Convenience method for setting next page to be rendered. |
|
void |
setResponsePage(Class<? extends IRequestablePage> pageClass,
PageParameters parameters)
Convenience method for setting next page to be rendered. |
|
void |
setResponsePage(Class<? extends IRequestablePage> pageClass,
PageParameters parameters,
RenderPageRequestHandler.RedirectPolicy redirectPolicy)
Convenience method for setting next page to be rendered. |
|
void |
setResponsePage(Class<? extends IRequestablePage> pageClass,
RenderPageRequestHandler.RedirectPolicy redirectPolicy)
Convenience method for setting next page to be rendered. |
|
void |
setResponsePage(IRequestablePage page)
Convenience method for setting next page to be rendered. |
|
|
urlFor(Class<C> pageClass,
PageParameters parameters)
Returns a rendered bookmarkable URL that references a given page class using a given set of page parameters. |
|
CharSequence |
urlFor(IRequestHandler handler)
Returns the rendered URL for the request handler or null if the handler couldn't
have been rendered. |
|
CharSequence |
urlFor(ResourceReference reference,
PageParameters params)
Returns a rendered Url for the resource reference |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RequestCycle(RequestCycleContext context)
context
- Method Detail |
---|
public static RequestCycle get()
null
if no request cycle is associated with
current thread.protected UrlRenderer newUrlRenderer()
public Response getOriginalResponse()
public final UrlRenderer getUrlRenderer()
UrlRenderer
for this RequestCycle
.
getUrlRenderer
in interface IRequestCycle
protected IRequestHandler resolveRequestHandler()
IRequestHandler
.
protected int getExceptionRetryCount()
public boolean processRequest()
true
if the request resolved to a Wicket request, false
otherwise.public boolean processRequestAndDetach()
RequestCycle
.
true
if the request resolved to a Wicket request, false
otherwise.protected IRequestHandler handleException(Exception e)
IRequestHandler
for the given exception.
e
-
public Request getRequest()
getRequest
in interface IRequestCycle
public void setRequest(Request request)
request
- public final <T> void setMetaData(MetaDataKey<T> key, T object)
MetaDataKey
.
T
- key
- The singleton key for the metadataobject
- The metadata object
IllegalArgumentException
MetaDataKey
public final <T> T getMetaData(MetaDataKey<T> key)
T
- The type of the metadatakey
- The key for the data
MetaDataKey
public Url mapUrlFor(IRequestHandler handler)
null
if the handler couldn't have been
encoded.
Note: The produced URL is relative to the filter path. Application code most probably need URL relative to the currently used page, for this use urlFor(org.apache.wicket.request.IRequestHandler)
handler
- the request handler
for which to create a callback url
null
public Url mapUrlFor(ResourceReference reference, PageParameters params)
Url
for the resource reference
Note: The produced URL is relative to the filter path. Application code most probably need URL relative to the currently used page, for this use urlFor(org.apache.wicket.request.resource.ResourceReference, org.apache.wicket.request.mapper.parameter.PageParameters)
reference
- resource referenceparams
- parameters for the resource or null
if none
Url
for the referencepublic final <C extends Page> Url mapUrlFor(Class<C> pageClass, PageParameters parameters)
Note: The produced URL is relative to the filter path. Application code most probably need URL relative to the currently used page, for this use urlFor(Class, org.apache.wicket.request.mapper.parameter.PageParameters)
C
- The type of the pagepageClass
- Class of pageparameters
- Parameters to page or null
if none
public final CharSequence urlFor(ResourceReference reference, PageParameters params)
Url
for the resource reference
reference
- resource referenceparams
- parameters for the resource or null
if none
Url
for the referencepublic final <C extends Page> CharSequence urlFor(Class<C> pageClass, PageParameters parameters)
C
- pageClass
- Class of pageparameters
- Parameters to page or null
if none
public CharSequence urlFor(IRequestHandler handler)
null
if the handler couldn't
have been rendered.
The resulting URL will be relative to current page.
handler
-
null
public final void detach()
RequestCycle
state. Called after request processing is complete
public void onDetach()
public void setResponsePage(IRequestablePage page)
page
- public void setResponsePage(Class<? extends IRequestablePage> pageClass)
pageClass
- The class of the page to renderpublic void setResponsePage(Class<? extends IRequestablePage> pageClass, RenderPageRequestHandler.RedirectPolicy redirectPolicy)
pageClass
- The class of the page to renderredirectPolicy
- The policy to use when deciding whether to redirect or notpublic void setResponsePage(Class<? extends IRequestablePage> pageClass, PageParameters parameters)
pageClass
- The class of the page to renderparameters
- The query parameters for the page to be renderedpublic void setResponsePage(Class<? extends IRequestablePage> pageClass, PageParameters parameters, RenderPageRequestHandler.RedirectPolicy redirectPolicy)
pageClass
- The class of the page to renderparameters
- The query parameters for the page to be renderedredirectPolicy
- The policy to use when deciding whether to redirect or not@Deprecated public final boolean isCleanupFeedbackMessagesOnDetach()
IApplicationSettings.getFeedbackMessageCleanupFilter()
TODO 7.0 remove
@Deprecated public final void setCleanupFeedbackMessagesOnDetach(boolean cleanupFeedbackMessagesOnDetach)
isCleanupFeedbackMessagesOnDetach()
TODO 7.0 remove
cleanupFeedbackMessagesOnDetach
- true if you want them to be cleaned uppublic final long getStartTime()
public void onEvent(IEvent<?> event)
onEvent
in interface IEventSink
protected void onBeginRequest()
protected void onEndRequest()
public RequestCycleListenerCollection getListeners()
public Response getResponse()
getResponse
in interface IRequestCycle
public Response setResponse(Response response)
setResponse
in interface IRequestCycle
public void scheduleRequestHandlerAfterCurrent(IRequestHandler handler)
scheduleRequestHandlerAfterCurrent
in interface IRequestCycle
public IRequestHandler getActiveRequestHandler()
RequestHandlerStack.getActive()
public IRequestHandler getRequestHandlerScheduledAfterCurrent()
RequestHandlerStack.next()
public void replaceAllRequestHandlers(IRequestHandler handler)
handler
- RequestHandlerStack.replaceAll(IRequestHandler)
public <T extends IRequestHandler> T find(Class<T> type)
null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |