com.primix.tapestry
Interface IPageRecorder

All Superinterfaces:
ChangeObserver
All Known Implementing Classes:
PageRecorder

public interface IPageRecorder
extends ChangeObserver

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.

Version:
$Id: IPageRecorder.java,v 1.10 2001/08/26 04:53:58 hship Exp $
Author:
Howard Ship

Method Summary
 void commit()
          Persists all changes that have been accumulated.
 java.util.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.
 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().
 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 com.primix.tapestry.event.ChangeObserver
observeChange
 

Method Detail

commit

public void commit()
            throws PageRecorderCommitException
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 record automatically locks itself.


getChanges

public java.util.Collection getChanges()
Returns a Collection of IPageChange objects that represent the persistant state of the page.

getHasChanges

public boolean getHasChanges()
Returns true if the recorder has any changes for the page.

isDirty

public boolean isDirty()
Returns true if the recorder has observed any changes that have not been committed to external storage.

isLocked

public boolean isLocked()
Returns true if the recorder is in a locked state, following a commit().

rollback

public void rollback(IPage page)
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(PageEvent).


setLocked

public void setLocked(boolean value)
Invoked to lock or unlock the recorder. Recoders are locked after they are commited, and stay locked until explicitly unlocked in a subsequent request cycle.