completed remote active objects (1:st iteration) - left todo are: TX semantics, supervision and remote references + tests

This commit is contained in:
Jonas Boner 2009-06-24 15:12:47 +02:00
parent 8ff45daddc
commit 47abc143a4
22 changed files with 1228 additions and 314 deletions

View file

@ -5,9 +5,10 @@ import se.scalablesolutions.akka.annotation.transactional;
import se.scalablesolutions.akka.kernel.state.*;
public class InMemStateful {
@state private TransactionalMap<String, String> mapState = new InMemoryTransactionalMap<String, String>();
@state private TransactionalVector<String> vectorState = new InMemoryTransactionalVector<String>();
@state private TransactionalRef<String> refState = new TransactionalRef<String>();
private TransactionalState factory = new TransactionalState();
private TransactionalMap mapState = factory.newMap(new InMemoryMapConfig());
private TransactionalVector vectorState = factory.newVector(new InMemoryVectorConfig());;
private TransactionalRef refState = factory.newRef(new InMemoryRefConfig());
@transactional
public String getMapState(String key) {
@ -47,11 +48,12 @@ public class InMemStateful {
}
@transactional
public void failure(String key, String msg, InMemFailer failer) {
public String failure(String key, String msg, InMemFailer failer) {
mapState.put(key, msg);
vectorState.add(msg);
refState.swap(msg);
failer.fail();
return msg;
}
@transactional