org.prevayler.demos.memento
Class Bank

java.lang.Object
  extended by org.prevayler.demos.memento.Bank
All Implemented Interfaces:
Serializable

public class Bank
extends Object
implements Serializable

The Bank class without the notification to a listener and including a memento.

See Also:
Serialized Form

Nested Class Summary
 class Bank.AccountNotFound
           
 
Constructor Summary
Bank()
           
 
Method Summary
 List accounts()
           
 Account createAccount(String holder)
           
 void createMemento(MementoCollector collector)
          Create a memento of the current state.
 void deleteAccount(long number)
           
 Account findAccount(long number)
           
 String toString()
           
 void transfer(long sourceNumber, long destinationNumber, long amount, Date timestamp)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Bank

public Bank()
Method Detail

createMemento

public void createMemento(MementoCollector collector)
Create a memento of the current state.


createAccount

public Account createAccount(String holder)
                      throws Account.InvalidHolder
Throws:
Account.InvalidHolder

deleteAccount

public void deleteAccount(long number)
                   throws Bank.AccountNotFound
Throws:
Bank.AccountNotFound

accounts

public List accounts()

findAccount

public Account findAccount(long number)
                    throws Bank.AccountNotFound
Throws:
Bank.AccountNotFound

transfer

public void transfer(long sourceNumber,
                     long destinationNumber,
                     long amount,
                     Date timestamp)
              throws Bank.AccountNotFound,
                     Account.InvalidAmount
Throws:
Bank.AccountNotFound
Account.InvalidAmount

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2001-2013. All Rights Reserved.