KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > prevayler > demos > demo2 > MainTransient


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
7
8
9 public class MainTransient {
10     
11     public static void main(String JavaDoc[] ignored) throws Exception JavaDoc {
12         out( "This demo shows how persistence can be turned off"
13             + "\nwithout changing ONE SINGLE LINE OF CODE in the"
14             + "\nbusiness classes or GUI. This is useful for"
15             + "\nrunning automated test scripts orders of magnitude"
16             + "\nfaster than with persistence turned on."
17             + "\n(Pay no attention to the 'Robustness Reminder' this time ;)"
18         );
19
20         //Below is the single line that was changed from Main.java to disable transaction logging. Notice the use of the AbstractPublisher:
21
Prevayler prevayler = PrevaylerFactory.createTransientPrevayler(new Bank());
22
23         Main.startGui(prevayler);
24     }
25
26
27     private static void out(String JavaDoc message) {
28         System.out.println(message);
29     }
30
31 }
32
Popular Tags