Merge changes I442a0ee9,I11825b90
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / TransactionProxy.java
index 9a77d1308e86451d98f434fe12b34b3760ae7daa..e30076d09e05930f6441a9454b791a83cfd180d8 100644 (file)
@@ -94,10 +94,10 @@ public class TransactionProxy implements DOMStoreReadWriteTransaction {
 
             @Override public Optional<NormalizedNode<?,?>> call() throws Exception {
                 Object response = actorContext
-                    .executeRemoteOperation(remoteTransaction, new ReadData(path),
+                    .executeRemoteOperation(remoteTransaction, new ReadData(path).toSerializable(),
                         ActorContext.ASK_DURATION);
-                if(response instanceof ReadDataReply){
-                    ReadDataReply reply = (ReadDataReply) response;
+                if(response.getClass().equals(ReadDataReply.SERIALIZABLE_CLASS)){
+                    ReadDataReply reply = ReadDataReply.fromSerializable(schemaContext,path, response);
                     if(reply.getNormalizedNode() == null){
                         return Optional.absent();
                     }
@@ -120,13 +120,13 @@ public class TransactionProxy implements DOMStoreReadWriteTransaction {
     @Override
     public void write(InstanceIdentifier path, NormalizedNode<?, ?> data) {
         final ActorSelection remoteTransaction = remoteTransactionFromIdentifier(path);
-        remoteTransaction.tell(new WriteData(path, data, schemaContext), null);
+        remoteTransaction.tell(new WriteData(path, data, schemaContext).toSerializable(), null);
     }
 
     @Override
     public void merge(InstanceIdentifier path, NormalizedNode<?, ?> data) {
         final ActorSelection remoteTransaction = remoteTransactionFromIdentifier(path);
-        remoteTransaction.tell(new MergeData(path, data, schemaContext), null);
+        remoteTransaction.tell(new MergeData(path, data, schemaContext).toSerializable(), null);
     }
 
     @Override