Replace deprecated Futures.addCallback by the newer version 52/64052/1
authorDavid Suarez <david.suarez.fuentes@gmail.com>
Mon, 9 Oct 2017 09:28:09 +0000 (11:28 +0200)
committerDavid Suarez <david.suarez.fuentes@gmail.com>
Mon, 9 Oct 2017 09:28:09 +0000 (11:28 +0200)
The method addCallback(ListenableFuture<V> future,
FutureCallback<? super V> callback) is deprecated and will be replaced
by a new its new version addCallback(ListenableFuture<V> future,
FutureCallback<? super V> callback, Executor executor) in April 2018.

Change-Id: I99f92ba310b6c0ebf0709b4d8455e596c7a12c47
Signed-off-by: David Suarez <david.suarez.fuentes@gmail.com>
mappingservice/dsbackend/src/main/java/org/opendaylight/lispflowmapping/dsbackend/DataStoreBackEnd.java
mappingservice/neutron/src/main/java/org/opendaylight/lispflowmapping/neutron/intenthandler/listener/VppEndpointListener.java

index d36af2346040d0a3f33914140884ba76bfcdaa33..aa29a060456f7f7fb671e36caaedbd516c3d2b51 100644 (file)
@@ -12,6 +12,7 @@ import com.google.common.base.Preconditions;
 import com.google.common.util.concurrent.CheckedFuture;
 import com.google.common.util.concurrent.FutureCallback;
 import com.google.common.util.concurrent.Futures;
+import com.google.common.util.concurrent.MoreExecutors;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
@@ -267,7 +268,7 @@ public class DataStoreBackEnd implements TransactionChainListener {
             public void onFailure(Throwable throwable) {
                 LOG.error("Transaction failed:", throwable);
             }
-        });
+        }, MoreExecutors.directExecutor());
     }
 
     private <U extends org.opendaylight.yangtools.yang.binding.DataObject> U readTransaction(
@@ -301,7 +302,7 @@ public class DataStoreBackEnd implements TransactionChainListener {
             public void onFailure(Throwable throwable) {
                 LOG.error("Transaction failed:", throwable);
             }
-        });
+        }, MoreExecutors.directExecutor());
     }
 
     public void onTransactionChainFailed(TransactionChain<?, ?> chain, AsyncTransaction<?, ?> transaction,
index ced758393ed4bb84c4c44db275910e7ba82b3575..96d893ccfd25e06972d7f7f767903f8c5a3120cc 100644 (file)
@@ -14,6 +14,7 @@ import com.google.common.util.concurrent.FutureCallback;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.ListeningExecutorService;
+import com.google.common.util.concurrent.MoreExecutors;
 
 import java.util.ArrayList;
 import java.util.Collection;
@@ -115,7 +116,7 @@ public class VppEndpointListener implements AutoCloseable, ClusteredDataTreeChan
                 public void onFailure(Throwable throwable) {
                     LOG.debug("Failed to handle VppEndpoint modifications!");
                 }
-            });
+            }, MoreExecutors.directExecutor());
         }
     }
 
@@ -136,7 +137,7 @@ public class VppEndpointListener implements AutoCloseable, ClusteredDataTreeChan
                 public void onFailure(Throwable throwable) {
                     LOG.debug("Couldn't process {}", newOrModifiedNode.getNodeId().getValue());
                 }
-            });
+            }, MoreExecutors.directExecutor());
             processingTasks.add(processNode(newOrModifiedNode));
         }
         return Futures.immediateFuture(null);