Deprecate org.opendaylight.controller.md.sal.dom.spi.AbstractRegistrationTree 78/61078/2
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 2 Aug 2017 21:32:28 +0000 (23:32 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 2 Aug 2017 21:37:05 +0000 (23:37 +0200)
This is a utility class, which has a conterpart in mdsal. Deprecate it
and related classes, migrating users.

Change-Id: I8206350ddb60bb19aed93ff3840e0e68e288d55a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DataTreeCohortActorRegistry.java
opendaylight/md-sal/sal-dom-spi/pom.xml
opendaylight/md-sal/sal-dom-spi/src/main/java/org/opendaylight/controller/md/sal/dom/spi/AbstractRegistrationTree.java
opendaylight/md-sal/sal-dom-spi/src/main/java/org/opendaylight/controller/md/sal/dom/spi/RegistrationTreeNode.java
opendaylight/md-sal/sal-dom-spi/src/main/java/org/opendaylight/controller/md/sal/dom/spi/RegistrationTreeSnapshot.java
opendaylight/md-sal/sal-dom-spi/src/main/java/org/opendaylight/controller/sal/core/spi/data/AbstractDOMStoreTreeChangePublisher.java
opendaylight/md-sal/sal-inmemory-datastore/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/ResolveDataChangeEventsTask.java
opendaylight/md-sal/sal-inmemory-datastore/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/ResolveDataChangeState.java
opendaylight/md-sal/sal-inmemory-datastore/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/tree/ListenerTree.java

index 0e149fa..572abee 100644 (file)
@@ -22,12 +22,12 @@ import java.util.List;
 import java.util.Map;
 import javax.annotation.concurrent.NotThreadSafe;
 import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
-import org.opendaylight.controller.md.sal.dom.spi.AbstractRegistrationTree;
-import org.opendaylight.controller.md.sal.dom.spi.RegistrationTreeNode;
-import org.opendaylight.controller.md.sal.dom.spi.RegistrationTreeSnapshot;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
 import org.opendaylight.mdsal.dom.api.DOMDataTreeCandidate;
 import org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier;
+import org.opendaylight.mdsal.dom.spi.AbstractRegistrationTree;
+import org.opendaylight.mdsal.dom.spi.RegistrationTreeNode;
+import org.opendaylight.mdsal.dom.spi.RegistrationTreeSnapshot;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidate;
index 264d471..f60edf0 100644 (file)
         <type>pom</type>
         <scope>import</scope>
       </dependency>
+      <dependency>
+        <groupId>org.opendaylight.mdsal</groupId>
+        <artifactId>mdsal-artifacts</artifactId>
+        <version>2.3.0-SNAPSHOT</version>
+        <type>pom</type>
+        <scope>import</scope>
+      </dependency>
     </dependencies>
   </dependencyManagement>
 
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>sal-core-api</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.opendaylight.mdsal</groupId>
+      <artifactId>mdsal-dom-spi</artifactId>
+    </dependency>
   </dependencies>
 
   <scm>
index c1865c8..0da140e 100644 (file)
@@ -16,7 +16,10 @@ import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgum
  * An abstract tree of registrations. Allows a read-only snapshot to be taken.
  *
  * @param <T> Type of registered object
+ *
+ * @deprecated Use {@link org.opendaylight.mdsal.dom.spi.AbstractRegistrationTree} instead.
  */
+@Deprecated
 public abstract class AbstractRegistrationTree<T> {
     private final ReadWriteLock rwLock = new ReentrantReadWriteLock(true);
     private final RegistrationTreeNode<T> rootNode = new RegistrationTreeNode<>(null, null);
index 378e9ed..178bbe2 100644 (file)
@@ -33,7 +33,10 @@ import org.slf4j.LoggerFactory;
  *
  * @param <T> registration type
  * @author Robert Varga
+ *
+ * @deprecated Use {@link org.opendaylight.mdsal.dom.spi.RegistrationTreeNode} instead.
  */
+@Deprecated
 public final class RegistrationTreeNode<T> implements Identifiable<PathArgument> {
     private static final Logger LOG = LoggerFactory.getLogger(RegistrationTreeNode.class);
 
index 09b8b2f..d3cbdad 100644 (file)
@@ -15,10 +15,14 @@ import java.util.concurrent.locks.Lock;
  * A stable read-only snapshot of a {@link AbstractRegistrationTree}.
  *
  * @author Robert Varga
+ *
+ * @deprecated Use {@link org.opendaylight.mdsal.dom.spi.RegistrationTreeSnapshot} instead.
  */
+@Deprecated
 public final class RegistrationTreeSnapshot<T> implements AutoCloseable {
     @SuppressWarnings("rawtypes")
-    private static final AtomicIntegerFieldUpdater<RegistrationTreeSnapshot> CLOSED_UPDATER = AtomicIntegerFieldUpdater.newUpdater(RegistrationTreeSnapshot.class, "closed");
+    private static final AtomicIntegerFieldUpdater<RegistrationTreeSnapshot> CLOSED_UPDATER =
+            AtomicIntegerFieldUpdater.newUpdater(RegistrationTreeSnapshot.class, "closed");
     private final RegistrationTreeNode<T> node;
     private final Lock lock;
 
index bf07dae..74938ef 100644 (file)
@@ -12,9 +12,9 @@ import java.util.List;
 import javax.annotation.Nonnull;
 import org.opendaylight.controller.md.sal.dom.api.DOMDataTreeChangeListener;
 import org.opendaylight.controller.md.sal.dom.spi.AbstractDOMDataTreeChangeListenerRegistration;
-import org.opendaylight.controller.md.sal.dom.spi.AbstractRegistrationTree;
-import org.opendaylight.controller.md.sal.dom.spi.RegistrationTreeNode;
-import org.opendaylight.controller.md.sal.dom.spi.RegistrationTreeSnapshot;
+import org.opendaylight.mdsal.dom.spi.AbstractRegistrationTree;
+import org.opendaylight.mdsal.dom.spi.RegistrationTreeNode;
+import org.opendaylight.mdsal.dom.spi.RegistrationTreeSnapshot;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidate;
index e1eebe6..fac78e7 100644 (file)
@@ -15,10 +15,10 @@ import com.google.common.collect.Multimap;
 import java.util.Collection;
 import java.util.Map.Entry;
 import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker.DataChangeScope;
-import org.opendaylight.controller.md.sal.dom.spi.RegistrationTreeSnapshot;
 import org.opendaylight.controller.md.sal.dom.store.impl.DOMImmutableDataChangeEvent.Builder;
 import org.opendaylight.controller.md.sal.dom.store.impl.DOMImmutableDataChangeEvent.SimpleEventFactory;
 import org.opendaylight.controller.md.sal.dom.store.impl.tree.ListenerTree;
+import org.opendaylight.mdsal.dom.spi.RegistrationTreeSnapshot;
 import org.opendaylight.yangtools.util.concurrent.NotificationManager;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
index e9b91e5..1547ad1 100644 (file)
@@ -18,8 +18,8 @@ import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
 import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker.DataChangeScope;
-import org.opendaylight.controller.md.sal.dom.spi.RegistrationTreeNode;
 import org.opendaylight.controller.md.sal.dom.store.impl.DOMImmutableDataChangeEvent.Builder;
+import org.opendaylight.mdsal.dom.spi.RegistrationTreeNode;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
index c0ad313..da3e3b4 100644 (file)
@@ -9,9 +9,9 @@ package org.opendaylight.controller.md.sal.dom.store.impl.tree;
 
 import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker.DataChangeScope;
 import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeListener;
-import org.opendaylight.controller.md.sal.dom.spi.AbstractRegistrationTree;
-import org.opendaylight.controller.md.sal.dom.spi.RegistrationTreeNode;
 import org.opendaylight.controller.md.sal.dom.store.impl.DataChangeListenerRegistration;
+import org.opendaylight.mdsal.dom.spi.AbstractRegistrationTree;
+import org.opendaylight.mdsal.dom.spi.RegistrationTreeNode;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 
@@ -84,27 +84,4 @@ public final class ListenerTree extends AbstractRegistrationTree<DataChangeListe
             releaseLock();
         }
     }
-
-    /**
-     * Obtain a tree walking context. This context ensures a consistent view of
-     * the listener registrations. The context should be closed as soon as it
-     * is not required, because each unclosed instance blocks modification of
-     * the listener tree.
-     *
-     * @return A walker instance.
-     *
-     * @deprecated Use {@link #takeSnapshot()} instead.
-     */
-    @Deprecated
-    public ListenerWalker getWalker() {
-        /*
-         * TODO: The only current user of this method is local to the datastore.
-         *       Since this class represents a read-lock, losing a reference to
-         *       it is a _major_ problem, as the registration process will get
-         *       wedged, eventually grinding the system to a halt. Should an
-         *       external user exist, make the Walker a phantom reference, which
-         *       will cleanup the lock if not told to do so.
-         */
-        return new ListenerWalker(takeSnapshot());
-    }
 }

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.