2009-05-23 22:24:02 +02:00
|
|
|
package se.scalablesolutions.akka.api;
|
|
|
|
|
|
2010-03-11 09:50:15 +01:00
|
|
|
import se.scalablesolutions.akka.persistence.common.*;
|
|
|
|
|
import se.scalablesolutions.akka.persistence.cassandra.*;
|
2009-09-23 09:02:14 +02:00
|
|
|
import se.scalablesolutions.akka.annotation.inittransactionalstate;
|
2009-05-23 22:24:02 +02:00
|
|
|
|
|
|
|
|
public class PersistentClasher {
|
2009-09-23 09:02:14 +02:00
|
|
|
private PersistentMap state;
|
2009-05-23 22:24:02 +02:00
|
|
|
|
2009-09-23 09:02:14 +02:00
|
|
|
@inittransactionalstate
|
|
|
|
|
public void init() {
|
2009-12-05 20:59:15 +01:00
|
|
|
state = CassandraStorage.newMap();
|
2009-09-23 09:02:14 +02:00
|
|
|
}
|
|
|
|
|
|
2009-05-23 22:24:02 +02:00
|
|
|
public String getState(String key) {
|
|
|
|
|
return (String)state.get(key).get();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setState(String key, String msg) {
|
|
|
|
|
state.put(key, msg);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void clash() {
|
|
|
|
|
state.put("clasher", "was here");
|
|
|
|
|
}
|
|
|
|
|
}
|