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 Object
implements IPageRecorder

Since:
4.0
Author:
Howard M. Lewis Ship

Constructor Summary
PageRecorderImpl(String pageName, PropertyPersistenceStrategySource strategySource, org.apache.hivemind.ErrorLog log)
           
 
Method Summary
 void commit()
          Persists all changes that have been accumulated.
 Collection getChanges()
           
 boolean isLocked()
          Checks if the current state changes have already been committed.
 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(String pageName,
                        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

isLocked

public boolean isLocked()
Description copied from interface: ChangeObserver
Checks if the current state changes have already been committed.

Specified by:
isLocked in interface ChangeObserver
Returns:
True if state changes are locked, false otherwise.

getChanges

public 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


Copyright © 2006-2008 Apache Software Foundation. All Rights Reserved.