-public class ShardTransaction extends UntypedActor {
-
- private final ActorRef shardActor;
-
- private final DOMStoreReadWriteTransaction transaction;
-
- private final MutableCompositeModification modification = new MutableCompositeModification();
-
- private final LoggingAdapter log = Logging.getLogger(getContext().system(), this);
-
- public ShardTransaction(DOMStoreReadWriteTransaction transaction, ActorRef shardActor) {
- this.transaction = transaction;
- this.shardActor = shardActor;
- }
-
-
- public static Props props(final DOMStoreReadWriteTransaction transaction, final ActorRef shardActor){
- return Props.create(new Creator<ShardTransaction>(){
-
- @Override
- public ShardTransaction create() throws Exception {
- return new ShardTransaction(transaction, shardActor);
- }
- });
- }
-
- @Override
- public void onReceive(Object message) throws Exception {
- if(message instanceof ReadData){
- readData((ReadData) message);
- } else if(message instanceof WriteData){
- writeData((WriteData) message);
- } else if(message instanceof MergeData){
- mergeData((MergeData) message);
- } else if(message instanceof DeleteData){
- deleteData((DeleteData) message);
- } else if(message instanceof ReadyTransaction){
- readyTransaction((ReadyTransaction) message);
- } else if(message instanceof CloseTransaction){
- closeTransaction((CloseTransaction) message);
- } else if(message instanceof GetCompositedModification){
- // This is here for testing only
- getSender().tell(new GetCompositeModificationReply(new ImmutableCompositeModification(modification)), getSelf());
+public abstract class ShardTransaction extends AbstractUntypedActor {
+
+ private final ActorRef shardActor;
+ protected final SchemaContext schemaContext;
+ private final String shardName;
+
+
+ private final MutableCompositeModification modification = new MutableCompositeModification();
+
+ protected ShardTransaction(ActorRef shardActor, SchemaContext schemaContext,
+ String shardName) {
+ this.shardActor = shardActor;
+ this.schemaContext = schemaContext;
+ this.shardName = shardName;