added init tx state hook for active objects, rewrote mongodb test

This commit is contained in:
jboner 2009-09-23 09:02:14 +02:00
parent 1bce709c5d
commit 98bdd9370d
17 changed files with 538 additions and 593 deletions

View file

@ -1,15 +1,21 @@
package se.scalablesolutions.akka.api;
import se.scalablesolutions.akka.annotation.transactionrequired;
import se.scalablesolutions.akka.annotation.inittransactionalstate;
import se.scalablesolutions.akka.state.*;
@transactionrequired
public class InMemStatefulNested {
private TransactionalState factory = new TransactionalState();
private TransactionalMap<String, String> mapState = factory.newMap();
private TransactionalVector<String> vectorState = factory.newVector();
private TransactionalRef<String> refState = factory.newRef();
private TransactionalMap<String, String> mapState;
private TransactionalVector<String> vectorState;
private TransactionalRef<String> refState;
@inittransactionalstate
public void init() {
mapState = TransactionalState.newMap();
vectorState = TransactionalState.newVector();
refState = TransactionalState.newRef();
}
public String getMapState(String key) {
return (String)mapState.get(key).get();