|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.primix.tapestry.engine.RequestCycle
Provides the logic for processing a single request cycle. Provides access to
the engine
and the RequestContext
.
Constructor Summary | |
RequestCycle(IEngine engine,
RequestContext requestContext,
IMonitor monitor)
Standard constructor used to render a response page. |
Method Summary | |
void |
cleanup()
Called at the end of the request cycle (i.e., after all responses have been sent back to the client), to release all pages loaded during the request cycle. |
void |
commitPageChanges()
Invokes IPageRecorder.commit() on each page recorder loaded
during the request cycle. |
java.lang.String |
encodeURL(java.lang.String URL)
Passes the String through HttpServletResponse.encodeURL() , which
ensures that the session id is encoded in the URL (if necessary). |
java.lang.Object |
getAttribute(java.lang.String name)
Retrieves a previously stored attribute, returning null if not found. |
IEngine |
getEngine()
Returns the engine which is processing this request cycle. |
IMonitor |
getMonitor()
|
java.lang.String |
getNextActionId()
Returns the next action id. |
IPage |
getPage()
Identifies the page being rendered. |
IPage |
getPage(java.lang.String name)
Gets the page from the engines's IPageSource . |
protected IPageRecorder |
getPageRecorder(java.lang.String name)
Returns the page recorder for the named page. |
RequestContext |
getRequestContext()
|
IEngineService |
getService()
Returns the service which initiated this request cycle. |
boolean |
isRewinding()
Returns true if the context is being used to rewind a prior state of the page. |
boolean |
isRewound(IComponent component)
Checks to see if the current action id matches the target action id. |
void |
observeChange(ObservedChangeEvent event)
For pages without a page recorder ,
we're the change observer . |
void |
removeAttribute(java.lang.String name)
Removes a previously stored attribute, if one with the given name exists. |
void |
renderPage(IResponseWriter writer)
Renders the page by invoking IPage.renderPage(IResponseWriter, IRequestCycle) . |
void |
rewindForm(IForm form,
java.lang.String targetActionId)
Rewinds an individual form by invoking IForm.rewind(IResponseWriter, IRequestCycle) . |
void |
rewindPage(java.lang.String targetActionId,
IComponent targetComponent)
Rewinds the page by invoking IPage.renderPage(IResponseWriter, IRequestCycle) . |
void |
setAttribute(java.lang.String name,
java.lang.Object value)
Allows a temporary object to be stored in the request cycle, which allows otherwise unrelated objects to communicate. |
void |
setPage(IPage value)
Sets the page to be rendered. |
void |
setPage(java.lang.String name)
Sets the page to be rendered. |
void |
setService(IEngineService value)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public RequestCycle(IEngine engine, RequestContext requestContext, IMonitor monitor)
Method Detail |
public void cleanup()
cleanup
in interface IRequestCycle
public IEngineService getService()
IRequestCycle
getService
in interface IRequestCycle
public void setService(IEngineService value)
public java.lang.String encodeURL(java.lang.String URL)
IRequestCycle
HttpServletResponse.encodeURL()
, which
ensures that the session id is encoded in the URL (if necessary).encodeURL
in interface IRequestCycle
public IEngine getEngine()
IRequestCycle
getEngine
in interface IRequestCycle
public java.lang.Object getAttribute(java.lang.String name)
IRequestCycle
getAttribute
in interface IRequestCycle
public IMonitor getMonitor()
getMonitor
in interface IRequestCycle
public java.lang.String getNextActionId()
IRequestCycle
getNextActionId
in interface IRequestCycle
public IPage getPage()
IRequestCycle
getPage
in interface IRequestCycle
public IPage getPage(java.lang.String name)
IPageSource
.getPage
in interface IRequestCycle
com.primix.tapestry.IRequestCycle
IEngine.getPageSource()
protected IPageRecorder getPageRecorder(java.lang.String name)
IEngine.getPageRecorder(String)
is
invoked to get the recorder, if it exists.public RequestContext getRequestContext()
getRequestContext
in interface IRequestCycle
public boolean isRewinding()
IRequestCycle
isRewinding
in interface IRequestCycle
public boolean isRewound(IComponent component) throws StaleLinkException
IRequestCycle
If theres a match on action id, then the component
is compared against the target component. If there's a mismatch
then a StaleLinkException
is thrown.
isRewound
in interface IRequestCycle
public void removeAttribute(java.lang.String name)
IRequestCycle
removeAttribute
in interface IRequestCycle
public void renderPage(IResponseWriter writer) throws RequestCycleException
IPage.renderPage(IResponseWriter, IRequestCycle)
.
This clears all attributes.renderPage
in interface IRequestCycle
public void rewindForm(IForm form, java.lang.String targetActionId) throws RequestCycleException
IForm.rewind(IResponseWriter, IRequestCycle)
.
The process is expected to end with a RenderRewoundException
.
If the entire page is renderred without this exception being thrown, it means
that the target action id was not valid, and a
RequestCycleException
is thrown.
This clears all attributes.
rewindForm
in interface IRequestCycle
public void rewindPage(java.lang.String targetActionId, IComponent targetComponent) throws RequestCycleException
IPage.renderPage(IResponseWriter, IRequestCycle)
.
The process is expected to end with a RenderRewoundException
.
If the entire page is renderred without this exception being thrown, it means
that the target action id was not valid, and a
RequestCycleException
is thrown.
This clears all attributes.
rewindPage
in interface IRequestCycle
com.primix.tapestry.IRequestCycle
IAction
public void setAttribute(java.lang.String name, java.lang.Object value)
IRequestCycle
HttpServletRequest.setAttribute()
,
except that values can be changed and removed as well.
This is used by components to locate each other. A component, such
as Body
, will write itself under a well-known name
into the request cycle, and components it wraps can locate it by that name.
setAttribute
in interface IRequestCycle
public void setPage(IPage value)
IRequestCycle
setPage
in interface IRequestCycle
public void setPage(java.lang.String name)
IRequestCycle
setPage
in interface IRequestCycle
public void commitPageChanges() throws PageRecorderCommitException
IPageRecorder.commit()
on each page recorder loaded
during the request cycle.commitPageChanges
in interface IRequestCycle
com.primix.tapestry.IRequestCycle
IPageRecorder.commit()
public void observeChange(ObservedChangeEvent event)
page recorder
,
we're the change observer
.
If such a page actually emits a change, then
we'll obtain a new page recorder from the
engine
, set the recorder
as the page's change observer, and forward the event
to the newly created recorder. In addition, the
new page recorder is remembered so that it will
be committed by commitPageChanges()
.observeChange
in interface ChangeObserver
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |