transactional actors and remote actors implemented
This commit is contained in:
parent
a585e0ce38
commit
0a915eaff9
20 changed files with 1419 additions and 472 deletions
|
|
@ -6,9 +6,9 @@ import se.scalablesolutions.akka.kernel.state.*;
|
|||
|
||||
public class InMemStateful {
|
||||
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());
|
||||
private TransactionalMap<String, String> mapState = factory.newInMemoryMap();
|
||||
private TransactionalVector<String> vectorState = factory.newInMemoryVector();
|
||||
private TransactionalRef<String> refState = factory.newInMemoryRef();
|
||||
|
||||
@transactional
|
||||
public String getMapState(String key) {
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ public class InMemoryStateTest extends TestCase {
|
|||
final private ActiveObjectFactory factory = new ActiveObjectFactory();
|
||||
|
||||
protected void setUp() {
|
||||
|
||||
conf.configureActiveObjects(
|
||||
new RestartStrategy(new AllForOne(), 3, 5000),
|
||||
new Component[]{
|
||||
|
|
|
|||
|
|
@ -6,9 +6,9 @@ import se.scalablesolutions.akka.annotation.state;
|
|||
|
||||
public class PersistentStateful {
|
||||
private TransactionalState factory = new TransactionalState();
|
||||
private TransactionalMap mapState = factory.newMap(new PersistentMapConfig(new CassandraStorageConfig()));
|
||||
private TransactionalVector vectorState = factory.newVector(new PersistentVectorConfig(new CassandraStorageConfig()));;
|
||||
private TransactionalRef refState = factory.newRef(new PersistentRefConfig(new CassandraStorageConfig()));
|
||||
private TransactionalMap mapState = factory.newPersistentMap(new CassandraStorageConfig());
|
||||
private TransactionalVector vectorState = factory.newPersistentVector(new CassandraStorageConfig());;
|
||||
private TransactionalRef refState = factory.newPersistentRef(new CassandraStorageConfig());
|
||||
|
||||
@transactional
|
||||
public String getMapState(String key) {
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ public class RemoteInMemoryStateTest extends TestCase {
|
|||
server.connect();
|
||||
}
|
||||
}).start();
|
||||
try { Thread.currentThread().sleep(1000); } catch (Exception e) {}
|
||||
}
|
||||
final private ActiveObjectGuiceConfiguratorForJava conf = new ActiveObjectGuiceConfiguratorForJava();
|
||||
final private se.scalablesolutions.akka.kernel.actor.ActiveObjectFactory factory = new se.scalablesolutions.akka.kernel.actor.ActiveObjectFactory();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue