|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Defines an object that can observe changes to properties of a page and its components, store the state of the page between request cycles, and restore a page's state on a subsequent request cycle.
Concrete implementations of this can store the changes in memory, as client-side cookies, in a flat file, or in a database.
Method Summary | |
void |
commit()
Persists all changes that have been accumulated. |
void |
discard()
Invoked at the end of a request cycle in which the page recorder is discarded (either implicitly, because the page recorder has no changes, or explicitly because of IEngine#forgetPage(String) or
markForDiscard() . |
Collection |
getChanges()
Returns a Collection of IPageChange objects that represent
the persistant state of the page. |
boolean |
getHasChanges()
Returns true if the recorder has any changes for the page. |
void |
initialize(String pageName,
IRequestCycle cycle)
Invoked after the recorder is instantiated to initialize it for the current request cycle. |
boolean |
isDirty()
Returns true if the recorder has observed any changes that have not been committed to external storage. |
boolean |
isLocked()
Returns true if the recorder is in a locked state, following a commit() . |
boolean |
isMarkedForDiscard()
Returns true if the recorder has been marked for discard. |
void |
markForDiscard()
Invoked to mark the recorder for discarding at the end of the request cycle. |
void |
rollback(IPage page)
Rolls back the page to the currently persisted state. |
void |
setLocked(boolean value)
Invoked to lock or unlock the recorder. |
Methods inherited from interface org.apache.tapestry.event.ChangeObserver |
observeChange |
Method Detail |
public void initialize(String pageName, IRequestCycle cycle)
pageName
- the fully qualified page namecycle
- the current request cyclepublic void discard()
IEngine#forgetPage(String)
or
markForDiscard()
.public void commit()
After commiting, a page recorder automatically locks itself.
public Collection getChanges()
Collection
of IPageChange
objects that represent
the persistant state of the page.public boolean getHasChanges()
public boolean isDirty()
public boolean isLocked()
commit()
.public void rollback(IPage page)
A page recorder can only rollback changes to properties
which have changed at some point. This can cause some minor
problems, addressed by PageDetachListener#pageDetached(PageEvent)
.
public void setLocked(boolean value)
public void markForDiscard()
public boolean isMarkedForDiscard()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |