1 package org.prevayler.demos.demo2; 2 3 import org.prevayler.Prevayler; 4 import org.prevayler.PrevaylerFactory; 5 import org.prevayler.demos.demo2.business.Bank; 6 import org.prevayler.implementation.snapshot.XmlSnapshotManager; 7 8 public class MainXml { 9 10 public static void main(String [] args) throws Exception { 11 out("A snapshot using Skaringa's XML serialization will be taken every 20 seconds..."); 12 13 PrevaylerFactory factory = new PrevaylerFactory(); 14 factory.configurePrevalenceBase("demo2Xml"); 15 factory.configureSnapshotManager(new XmlSnapshotManager(new Bank(), "demo2Xml")); 16 Prevayler prevayler = factory.create(); 17 18 Main.startSnapshots(prevayler); 19 20 } 21 22 private static void out(String message) { 23 System.out.println(message); 24 } 25 } | Popular Tags |