Removing the Container Aware dependency from Clustering Services.
[controller.git] / opendaylight / clustering / services_implementation / src / main / java / org / opendaylight / controller / clustering / services_implementation / internal / ClusterManager.java
index ca13fbc2d23df7cb94d295401e48c30ec78bb9aa..4a67e76ab25b5e92e63e7433cd9efdea5934a7af 100644 (file)
@@ -55,11 +55,10 @@ import org.opendaylight.controller.clustering.services.IClusterServices;
 import org.opendaylight.controller.clustering.services.IGetUpdates;
 import org.opendaylight.controller.clustering.services.IListenRoleChange;
 import org.opendaylight.controller.clustering.services.ListenRoleChangeAddException;
-import org.opendaylight.controller.sal.core.IContainerAware;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class ClusterManager implements IClusterServices, IContainerAware {
+public class ClusterManager implements IClusterServices {
     protected static final Logger logger = LoggerFactory
             .getLogger(ClusterManager.class);
     private DefaultCacheManager cm;
@@ -371,6 +370,7 @@ public class ClusterManager implements IClusterServices, IContainerAware {
             return null;
         }
         for (String cacheName : manager.getCacheNames()) {
+            if (!manager.isRunning(cacheName)) continue;
             if (cacheName.startsWith("{" + containerName + "}_")) {
                 String[] res = cacheName.split("[{}]");
                 if (res.length >= 4 && res[1].equals(containerName)
@@ -676,21 +676,4 @@ public class ClusterManager implements IClusterServices, IContainerAware {
             }
         }
     }
-
-    private void removeContainerCaches(String containerName) {
-        logger.info("Destroying caches for container {}", containerName);
-        for (String cacheName : this.getCacheList(containerName)) {
-            this.destroyCache(containerName, cacheName);
-        }
-    }
-
-    @Override
-    public void containerCreate(String arg0) {
-        // no op
-    }
-
-    @Override
-    public void containerDestroy(String container) {
-        removeContainerCaches(container);
-    }
 }