org.prevayler.demos.memento.commands
Class Transfer

java.lang.Object
  extended by org.prevayler.util.memento.MementoTransaction
      extended by org.prevayler.demos.memento.commands.Transfer
All Implemented Interfaces:
Serializable

public class Transfer
extends MementoTransaction

See Also:
Serialized Form

Constructor Summary
Transfer(long sourceNumber, long destinationNumber, long amount)
           
 
Method Summary
protected  void checkPrecondition()
          Check the precondition.
protected  void createMementos(MementoCollector collector)
          Create mementos for all objects which (possibly) get modified.
protected  Account execute(MementoCollector collector)
          Execute the actual command.
protected  void findObjects(Bank prevalentSystem)
          Find the objects this command modifies.
 
Methods inherited from class org.prevayler.util.memento.MementoTransaction
execute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Transfer

public Transfer(long sourceNumber,
                long destinationNumber,
                long amount)
Method Detail

findObjects

protected void findObjects(Bank prevalentSystem)
                    throws Exception
Description copied from class: MementoTransaction
Find the objects this command modifies.

Specified by:
findObjects in class MementoTransaction
Parameters:
prevalentSystem - The prevalent system in which to find the objects.
Throws:
Exception

checkPrecondition

protected void checkPrecondition()
Description copied from class: MementoTransaction
Check the precondition.

Specified by:
checkPrecondition in class MementoTransaction

createMementos

protected void createMementos(MementoCollector collector)
Description copied from class: MementoTransaction
Create mementos for all objects which (possibly) get modified.

Specified by:
createMementos in class MementoTransaction
Parameters:
collector - The memento collector to which to add the mementos.

execute

protected Account execute(MementoCollector collector)
                   throws Exception
Description copied from class: MementoTransaction
Execute the actual command.

Specified by:
execute in class MementoTransaction
Parameters:
collector - The memento collector which can be used to execute subcommands.
Returns:
The object returned by the execution of this command. Most commands simply return null.
Throws:
Exception


Copyright © 2001-2013. All Rights Reserved.