Update stm module to work with AkkaApplication

This commit is contained in:
Peter Vlugter 2011-10-07 15:22:36 +02:00
parent 2381ec54d0
commit 3aadcd7645
32 changed files with 263 additions and 223 deletions

View file

@ -1,5 +1,6 @@
package akka.stm.example;
import akka.AkkaApplication;
import akka.stm.*;
import akka.actor.*;
@ -9,10 +10,12 @@ public class RetryExample {
System.out.println("Retry example");
System.out.println();
AkkaApplication application = new AkkaApplication("RetryExample");
final Ref<Double> account1 = new Ref<Double>(100.0);
final Ref<Double> account2 = new Ref<Double>(100.0);
ActorRef transferer = Actors.actorOf(Transferer.class);
ActorRef transferer = application.createActor(new Props().withCreator(Transferer.class));
transferer.tell(new Transfer(account1, account2, 500.0));
// Transferer: not enough money - retrying