Rework ClusterSingletonServiceGroupImpl locking
[mdsal.git] / singleton-service / mdsal-singleton-dom-impl / src / main / java / org / opendaylight / mdsal / singleton / dom / impl / ClusterSingletonServiceGroup.java
index 40d8332edeb39c9ad99eda1f01a4a92a587d8cf8..09ac347444effeea86c5d167bc43731b3b4f360c 100644 (file)
@@ -5,10 +5,10 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.mdsal.singleton.dom.impl;
 
 import com.google.common.util.concurrent.ListenableFuture;
+import org.eclipse.jdt.annotation.Nullable;
 import org.opendaylight.mdsal.eos.common.api.CandidateAlreadyRegisteredException;
 import org.opendaylight.mdsal.eos.common.api.GenericEntity;
 import org.opendaylight.mdsal.eos.common.api.GenericEntityOwnershipChange;
@@ -58,9 +58,9 @@ abstract class ClusterSingletonServiceGroup<P extends Path<P>, E extends Generic
      * without clustering.
      *
      * @param service instance
-     * @return True if this was the last service registered
+     * @return Future which completes when this instance is shutdown if this was the last registration, null otherwise
      */
-    abstract boolean unregisterService(ClusterSingletonServiceRegistration reg);
+    abstract @Nullable ListenableFuture<?> unregisterService(ClusterSingletonServiceRegistration reg);
 
     /**
      * Method implementation has to apply ownershipChange for all registered services.