KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > prevayler > demos > demo1 > NumberStorageTransaction


1 package org.prevayler.demos.demo1;
2
3 import java.util.Date JavaDoc;
4
5 import org.prevayler.Transaction;
6
7
8 /**
9  * To change the state of the business objects, the client code must use a Transaction like this one.
10  */

11 class NumberStorageTransaction implements Transaction {
12
13     private int _numberToKeep;
14
15     private NumberStorageTransaction() {} //Necessary for Skaringa XML serialization
16
NumberStorageTransaction(int numberToKeep) {
17         _numberToKeep = numberToKeep;
18     }
19
20     public void executeOn(Object JavaDoc prevalentSystem, Date JavaDoc ignored) {
21         ((NumberKeeper)prevalentSystem).keep(_numberToKeep);
22     }
23 }
24
Popular Tags