BREAKAGE: switching from se.scalablesolutions.akka to akka for all packages

This commit is contained in:
Viktor Klang 2010-10-26 12:49:25 +02:00
parent 5c9fab80d3
commit 8fd6361c44
393 changed files with 2100 additions and 2101 deletions

View file

@ -0,0 +1,34 @@
package akka.stm;
import akka.stm.*;
import akka.stm.local.Atomic;
public class TransactionalVectorExample {
public static void main(String[] args) {
System.out.println();
System.out.println("TransactionalVector example");
System.out.println();
final TransactionalVector<Address> addresses = new TransactionalVector<Address>();
// fill addresses vector (in a transaction)
new Atomic() {
public Object atomically() {
addresses.add(new Address("somewhere"));
addresses.add(new Address("somewhere else"));
return null;
}
}.execute();
System.out.println("addresses: " + addresses);
// access addresses vector (in a transaction)
Address address = new Atomic<Address>() {
public Address atomically() {
return addresses.get(0);
}
}.execute();
System.out.println("address: " + address);
}
}