Make LocalThreePhaseCommitCohort::operationError final
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / LocalTransactionChain.java
index 56466f78408fe24602564f9c62e14a8f5e31add5..b42c52d99341a716ae337510cea158cac1fd6de4 100644 (file)
@@ -9,6 +9,8 @@ package org.opendaylight.controller.cluster.datastore;
 
 import akka.actor.ActorSelection;
 import com.google.common.base.Preconditions;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
 import org.opendaylight.controller.cluster.datastore.identifiers.TransactionIdentifier;
 import org.opendaylight.controller.sal.core.spi.data.AbstractSnapshotBackedTransactionChain;
 import org.opendaylight.controller.sal.core.spi.data.DOMStoreReadTransaction;
@@ -78,7 +80,13 @@ final class LocalTransactionChain extends AbstractSnapshotBackedTransactionChain
 
     @SuppressWarnings("unchecked")
     @Override
-    public LocalThreePhaseCommitCohort onTransactionReady(DOMStoreWriteTransaction tx) {
+    public LocalThreePhaseCommitCohort onTransactionReady(@Nonnull DOMStoreWriteTransaction tx,
+            @Nullable Exception operationError) {
+        if(operationError != null) {
+            return new LocalChainThreePhaseCommitCohort((SnapshotBackedWriteTransaction<TransactionIdentifier>)tx,
+                    operationError);
+        }
+
         try {
             return (LocalThreePhaseCommitCohort) tx.ready();
         } catch (Exception e) {