|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.wicket.request.RequestHandlerStack
org.apache.wicket.request.cycle.RequestCycle
public class RequestCycle
RequestCycle
consists of two steps:
IRequestHandler
execution the handler can execute other IRequestHandler
s,
schedule another IRequestHandler
or replace all IRequestHandler
s on stack with
another IRequestHandler
.
RequestHandlerStack.executeRequestHandler(IRequestHandler)
,
RequestHandlerStack.scheduleRequestHandlerAfterCurrent(IRequestHandler)
,
RequestHandlerStack.replaceAllRequestHandlers(IRequestHandler)
Nested Class Summary | |
---|---|
static interface |
RequestCycle.DetachCallback
Custom callback invoked on request cycle detach. |
Nested classes/interfaces inherited from class org.apache.wicket.request.RequestHandlerStack |
---|
RequestHandlerStack.ReplaceHandlerException |
Constructor Summary | |
---|---|
RequestCycle(RequestCycleContext context)
Construct. |
Method Summary | ||
---|---|---|
void |
detach()
Detaches all IRequestHandler s. |
|
static RequestCycle |
get()
Returns request cycle associated with current thread. |
|
ClientInfo |
getClientInfo()
|
|
protected int |
getExceptionRetryCount()
|
|
|
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()
|
|
protected RequestCycle |
getRequestCycle()
|
|
long |
getStartTime()
|
|
UrlRenderer |
getUrlRenderer()
Returns UrlRenderer for this RequestCycle . |
|
protected IRequestHandler |
handleException(java.lang.Exception e)
Return IRequestHandler for the given exception. |
|
boolean |
isCleanupFeedbackMessagesOnDetach()
|
|
ClientInfo |
newClientInfo()
Creates a new agent info object based on this request. |
|
protected UrlRenderer |
newUrlRenderer()
|
|
boolean |
processRequest()
Processes the request. |
|
boolean |
processRequestAndDetach()
Convenience method that processes the request and detaches the RequestCycle . |
|
void |
register(RequestCycle.DetachCallback detachCallback)
Registers a callback to be invoked on RequestCycle detach. |
|
java.lang.String |
renderUrlFor(IRequestHandler handler)
Returns the rendered URL for the request handler or null if the handler couldn't
have been rendered. |
|
protected IRequestHandler |
resolveRequestHandler()
Resolves current request to a IRequestHandler . |
|
void |
setCleanupFeedbackMessagesOnDetach(boolean cleanupFeedbackMessagesOnDetach)
|
|
|
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. |
|
void |
setResponsePage(java.lang.Class<? extends IRequestablePage> pageClass)
Convenience method for setting next page to be rendered. |
|
void |
setResponsePage(java.lang.Class<? extends IRequestablePage> pageClass,
PageParameters parameters)
Convenience method for setting next page to be rendered. |
|
void |
setResponsePage(IRequestablePage page)
Convenience method for setting next page to be rendered. |
|
Url |
urlFor(IRequestHandler handler)
Returns URL for the request handler or null if the handler couldn't have been
encoded. |
|
Url |
urlFor(ResourceReference reference)
Returns a Url for the resource reference |
|
Url |
urlFor(ResourceReference reference,
PageParameters params)
Returns a Url for the resource reference |
Methods inherited from class org.apache.wicket.request.RequestHandlerStack |
---|
executeRequestHandler, getActiveRequestHandler, getRequestHandlerScheduledAfterCurrent, getResponse, replaceAllRequestHandlers, replaceCurrentRequestHandler, scheduleRequestHandlerAfterCurrent, setResponse |
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.IRequestCycle |
---|
getResponse, scheduleRequestHandlerAfterCurrent |
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(java.lang.Exception e)
IRequestHandler
for the given exception.
e
-
public Request getRequest()
getRequest
in interface IRequestCycle
public void setRequest(Request request)
request
- protected RequestCycle getRequestCycle()
getRequestCycle
in class RequestHandlerStack
RequestHandlerStack.getRequestCycle()
public final <T> void setMetaData(MetaDataKey<T> key, T object)
MetaDataKey
.
T
- key
- The singleton key for the metadataobject
- The metadata object
java.lang.IllegalArgumentException
MetaDataKey
public final <T> T getMetaData(MetaDataKey<T> key)
T
- The type of the metadatakey
- The key for the data
MetaDataKey
public Url urlFor(IRequestHandler handler)
null
if the handler couldn't have been
encoded.
handler
-
null
public Url 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 Url urlFor(ResourceReference reference)
Url
for the resource reference
reference
- reference
Url
for the referencepublic java.lang.String renderUrlFor(IRequestHandler handler)
null
if the handler couldn't
have been rendered.
The resulting URL will be relative to current page.
handler
-
null
public void detach()
RequestHandlerStack
IRequestHandler
s.
detach
in class RequestHandlerStack
RequestHandlerStack.detach()
public void register(RequestCycle.DetachCallback detachCallback)
RequestCycle
detach. The callback will be
invoked after all IRequestHandler
s are detached.
detachCallback
- public void setResponsePage(IRequestablePage page)
page
- public void setResponsePage(java.lang.Class<? extends IRequestablePage> pageClass)
pageClass
- public void setResponsePage(java.lang.Class<? extends IRequestablePage> pageClass, PageParameters parameters)
pageClass
- parameters
- public ClientInfo newClientInfo()
newClientInfo()
might be relatively expensive.
public ClientInfo getClientInfo()
public boolean isCleanupFeedbackMessagesOnDetach()
public void setCleanupFeedbackMessagesOnDetach(boolean cleanupFeedbackMessagesOnDetach)
public final long getStartTime()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |