-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 class ShardTransaction extends AbstractUntypedActor {
+
+ private final ActorRef shardActor;
+
+ // FIXME : see below
+ // If transactionChain is not null then this transaction is part of a
+ // transactionChain. Not really clear as to what that buys us
+ private final DOMStoreTransactionChain transactionChain;
+
+ 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(null, transaction, shardActor);