|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.primix.tapestry.record.PageRecorder | +--com.primix.tapestry.record.SimplePageRecorder
Simple implementation of IPageRecorder
that stores page changes in-memory using
collections.
The recorder must be made session persistant, either by being stored
directly in the session, or being referenced from a session-persistant
object. SimpleEngine
simply stores a Map
of
these page recorders.
Fields inherited from class com.primix.tapestry.record.PageRecorder |
dirty, locked |
Constructor Summary | |
SimplePageRecorder()
|
Method Summary | |
void |
commit()
Simply clears the dirty flag, because there is no external place to store changed page properties. |
java.util.Collection |
getChanges()
Returns a Collection of IPageChange objects
identifying changes to the page and its components. |
boolean |
getHasChanges()
Returns true if the recorder has any changes recorded. |
void |
readExternal(java.io.ObjectInput in)
Reads the state stored by writeExternal(ObjectOutput) . |
protected void |
recordChange(java.lang.String componentPath,
java.lang.String propertyName,
java.lang.Object newValue)
Records a change to a particular component. |
void |
writeExternal(java.io.ObjectOutput out)
Writes the changes. |
Methods inherited from class com.primix.tapestry.record.PageRecorder |
isDirty, isLocked, observeChange, persistValue, restoreValue, rollback, setLocked |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SimplePageRecorder()
Method Detail |
public void commit() throws PageRecorderCommitException
commit
in class PageRecorder
public boolean getHasChanges()
public java.util.Collection getChanges()
PageRecorder
Collection
of IPageChange
objects
identifying changes to the page and its components.getChanges
in class PageRecorder
protected void recordChange(java.lang.String componentPath, java.lang.String propertyName, java.lang.Object newValue)
PageRecorder
This method is responsible for setting the dirty flag if the described change is real.
recordChange
in class PageRecorder
com.primix.tapestry.record.PageRecorder
componentPath
- the name of the component relative to the
page which contains it. May be null if the change was to a
property of the page itself.propertyName
- the name of the property which changed.newValue
- the new value for the property, which may also
be null.IComponent.getIdPath()
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
writeExternal(ObjectOutput)
.readExternal
in interface java.io.Externalizable
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
For each change, writes:
String
, may be null)
String
)
writeExternal
in interface java.io.Externalizable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |