org.nakedobjects.runtime.persistence.objectstore.algorithm
Class PersistAlgorithmAbstract

java.lang.Object
  extended by org.nakedobjects.runtime.persistence.objectstore.algorithm.PersistAlgorithmAbstract
All Implemented Interfaces:
PersistAlgorithm
Direct Known Subclasses:
DefaultPersistAlgorithm, TopDownPersistAlgorithm, TwoPassPersistAlgorithm

public abstract class PersistAlgorithmAbstract
extends java.lang.Object
implements PersistAlgorithm


Constructor Summary
PersistAlgorithmAbstract()
           
 
Method Summary
protected  boolean alreadyPersistedOrNotPersistable(NakedObject adapter)
          If has a ResolveState that is already persisted or has a specification that indicates instances of its type should not be persisted.
protected  boolean alreadyPersistedOrNotPersistableOrServiceOrStandalone(NakedObject adapter)
          Whether the persist algorithm should skip over this object.
protected  void assertObjectNotPersistentAndPersistable(NakedObject object)
          As per alreadyPersistedOrNotPersistable(NakedObject), ensures object can be persisted else throws NotPersistableException.
 void init()
           
 void shutdown()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.nakedobjects.runtime.persistence.objectstore.algorithm.PersistAlgorithm
makePersistent, name
 

Constructor Detail

PersistAlgorithmAbstract

public PersistAlgorithmAbstract()
Method Detail

init

public void init()

shutdown

public void shutdown()

alreadyPersistedOrNotPersistableOrServiceOrStandalone

protected boolean alreadyPersistedOrNotPersistableOrServiceOrStandalone(NakedObject adapter)
Whether the persist algorithm should skip over this object.

There are various reasons why an object should not be persisted:

Implementation note: the only reason that this method has not been combined with the weaker check in alreadyPersistedOrNotPersistable(NakedObject) is because of existing code that throws an exception if the latter is not fulfilled. REVIEW: should try to combine and remove the other method.


alreadyPersistedOrNotPersistable

protected boolean alreadyPersistedOrNotPersistable(NakedObject adapter)
If has a ResolveState that is already persisted or has a specification that indicates instances of its type should not be persisted.

See Also:
alreadyPersistedOrNotPersistableOrServiceOrStandalone(NakedObject)

assertObjectNotPersistentAndPersistable

protected void assertObjectNotPersistentAndPersistable(NakedObject object)
As per alreadyPersistedOrNotPersistable(NakedObject), ensures object can be persisted else throws NotPersistableException.



Copyright © 2001-2009 Naked Objects Group Ltd.. All Rights Reserved.