BREAKAGE: switching from se.scalablesolutions.akka to akka for all packages
This commit is contained in:
parent
29791593f0
commit
680ee7ddf1
393 changed files with 2100 additions and 2101 deletions
36
akka-actor/src/test/java/akka/stm/RefExample.java
Normal file
36
akka-actor/src/test/java/akka/stm/RefExample.java
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
package akka.stm;
|
||||
|
||||
import akka.stm.Ref;
|
||||
import akka.stm.local.Atomic;
|
||||
|
||||
public class RefExample {
|
||||
public static void main(String[] args) {
|
||||
System.out.println();
|
||||
System.out.println("Ref example");
|
||||
System.out.println();
|
||||
|
||||
final Ref<Integer> ref = new Ref<Integer>(0);
|
||||
|
||||
Integer value1 = new Atomic<Integer>() {
|
||||
public Integer atomically() {
|
||||
return ref.get();
|
||||
}
|
||||
}.execute();
|
||||
|
||||
System.out.println("value 1: " + value1);
|
||||
|
||||
new Atomic() {
|
||||
public Object atomically() {
|
||||
return ref.set(5);
|
||||
}
|
||||
}.execute();
|
||||
|
||||
Integer value2 = new Atomic<Integer>() {
|
||||
public Integer atomically() {
|
||||
return ref.get();
|
||||
}
|
||||
}.execute();
|
||||
|
||||
System.out.println("value 2: " + value2);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue