Fix CacheUpdateAware mechanism in cluster.services-implementation
[controller.git] / opendaylight / clustering / services_implementation / src / main / java / org / opendaylight / controller / clustering / services_implementation / internal / ClusterGlobalManager.java
index 8211846..ce33ac8 100644 (file)
@@ -9,8 +9,36 @@
 
 package org.opendaylight.controller.clustering.services_implementation.internal;
 
 
 package org.opendaylight.controller.clustering.services_implementation.internal;
 
+import java.util.Map;
+import org.opendaylight.controller.clustering.services.ICacheUpdateAware;
 import org.opendaylight.controller.clustering.services.IClusterGlobalServices;
 import org.opendaylight.controller.clustering.services.IClusterGlobalServices;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
-public class ClusterGlobalManager extends ClusterManagerCommon implements
-        IClusterGlobalServices {
+public class ClusterGlobalManager
+    extends ClusterManagerCommon
+    implements IClusterGlobalServices {
+    protected static final Logger logger = LoggerFactory.getLogger(ClusterGlobalManager.class);
+
+    @Override
+    void setCacheUpdateAware(Map props, ICacheUpdateAware s) {
+        logger.trace("setCacheUpdateAware");
+        if (props.get("containerName") != null) {
+            // If we got a reference with the containerName property
+            // that is not what we are looking for, so filter it out.
+            return;
+        }
+        super.setCacheUpdateAware(props, s);
+    }
+
+    @Override
+    void unsetCacheUpdateAware(Map props, ICacheUpdateAware s) {
+        logger.trace("unsetCacheUpdateAware");
+        if (props.get("containerName") != null) {
+            // If we got a reference with the containerName property
+            // that is not what we are looking for, so filter it out.
+            return;
+        }
+        super.unsetCacheUpdateAware(props, s);
+    }
 }
 }