org.apache.tapestry.record
Class PageRecorderImpl

java.lang.Object
  extended by org.apache.tapestry.record.PageRecorderImpl
All Implemented Interfaces:
IPageRecorder, ChangeObserver

public class PageRecorderImpl
extends java.lang.Object
implements IPageRecorder

Since:
4.0
Author:
Howard M. Lewis Ship

Constructor Summary
PageRecorderImpl(java.lang.String pageName, IRequestCycle requestCycle, PropertyPersistenceStrategySource strategySource, org.apache.hivemind.ErrorLog log)
           
 
Method Summary
 void commit()
          Persists all changes that have been accumulated.
 java.util.Collection getChanges()
           
 void observeChange(ObservedChangeEvent event)
          Sent when the observed object changes a property.
 void rollback(IPage page)
          Rolls back the page to the currently persisted state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PageRecorderImpl

public PageRecorderImpl(java.lang.String pageName,
                        IRequestCycle requestCycle,
                        PropertyPersistenceStrategySource strategySource,
                        org.apache.hivemind.ErrorLog log)
Method Detail

commit

public void commit()
Description copied from interface: IPageRecorder
Persists all changes that have been accumulated. If the recorder saves change incrementally, this should ensure that all changes have been persisted.

After commiting, a page recorder automatically locks itself.

Specified by:
commit in interface IPageRecorder

getChanges

public java.util.Collection getChanges()

rollback

public void rollback(IPage page)
Description copied from interface: IPageRecorder
Rolls back the page to the currently persisted state.

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(org.apache.tapestry.event.PageEvent).

Specified by:
rollback in interface IPageRecorder

observeChange

public void observeChange(ObservedChangeEvent event)
Description copied from interface: ChangeObserver
Sent when the observed object changes a property. The event identifies the object, the property and the new value.

Specified by:
observeChange in interface ChangeObserver