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 public class MainReplicaServer { 9 10 public static void main(String [] ignored) throws Exception { 11 out( "This demo shows how your application can be replicated" 12 + "\nwithout changing ONE SINGLE LINE OF CODE in the" 13 + "\nbusiness classes or GUI. This enables query load-" 14 + "\nbalancing and system fault-tolerance." 15 + "\n\nThe server is up. Now you can start the replica" 16 + "\non any machine in your network:" 17 + "\n java org.prevayler.demos.demo2.MainReplica <This machine's IP Address>\n\n" 18 ); 19 20 PrevaylerFactory factory = new PrevaylerFactory(); 21 factory.configurePrevalentSystem(new Bank()); 22 factory.configurePrevalenceBase("demo2"); 23 factory.configureReplicationServer(PrevaylerFactory.DEFAULT_REPLICATION_PORT); 24 Prevayler prevayler = factory.create(); 25 26 Main.startGui(prevayler); 27 } 28 29 30 private static void out(String message) { 31 System.out.println(message); 32 } 33 34 } 35 | Popular Tags |