Remove close method from RequestProcessor 84/104584/1
authorGilles Thouenon <gilles.thouenon@orange.com>
Sat, 25 Feb 2023 08:55:41 +0000 (09:55 +0100)
committerGilles Thouenon <gilles.thouenon@orange.com>
Sat, 25 Feb 2023 08:55:41 +0000 (09:55 +0100)
Wit new implementation of RequestProcessor, transactions are better
managed, and their closure is assured by the commit. Letting the user
interfere in transaction management can make the application very
instable.
So, remove close method from NetworkTransactionService interface.

JIRA: TRNSPRTPCE-727
Signed-off-by: Gilles Thouenon <gilles.thouenon@orange.com>
Change-Id: I9b384c729d105795d0047d51149f9bf9342ce298

common/src/main/java/org/opendaylight/transportpce/common/network/NetworkTransactionImpl.java
common/src/main/java/org/opendaylight/transportpce/common/network/NetworkTransactionService.java
common/src/main/java/org/opendaylight/transportpce/common/network/RequestProcessor.java

index 42132c96ebc8c8252987e642ce82377a56536ed0..10f1dafbb5328797daa73a8a2763148847706be0 100644 (file)
@@ -53,12 +53,6 @@ public final class NetworkTransactionImpl implements NetworkTransactionService {
         return requestProcessor.commit();
     }
 
-    @Override
-    public void close() {
-
-        requestProcessor.close();
-    }
-
     public <T extends DataObject> void merge(LogicalDatastoreType store,
         InstanceIdentifier<T> path, T data) {
         requestProcessor.merge(store, path, data);
index af75889fe4a9e82eb8cd47c23bdaea6ce9753f82..1b139d91ca0d0b80db90614d41f6f7e288764845 100644 (file)
@@ -33,8 +33,6 @@ public interface NetworkTransactionService {
 
     FluentFuture<? extends @NonNull CommitInfo> commit();
 
-    void close();
-
     /**
      * the Databroker related to NetworkTransactionService.
      * @return the Databroker related to NetworkTransactionService.
index 940cd4f7ca5eac15baf6ae4e8ef8c24d2204412b..d3a61a69b7bbeb603c530c9d83567842c0f7dee4 100644 (file)
@@ -132,13 +132,6 @@ public class RequestProcessor {
         }
     }
 
-    public void close() {
-        LOG.info("closing RequestProcessor Locks by {}", Thread.currentThread().getName());
-        writeTrMap.remove(Thread.currentThread().getName());
-        readL.unlock();
-        writeL.unlock();
-    }
-
     /**
      * Return the dataBroker related to RequestProcessor.
      * @return the dataBroker