Fixed cache logging
[openflowjava.git] / openflow-protocol-impl / src / main / java / org / opendaylight / openflowjava / protocol / impl / connection / ConnectionAdapterImpl.java
index 62339ae856fd4b08dd05df7d40904c1da1abcb7b..c24899fd1c975c7f0c746725f725b5edfa0d1cd4 100644 (file)
@@ -71,6 +71,7 @@ import org.slf4j.LoggerFactory;
 import com.google.common.base.Preconditions;
 import com.google.common.cache.Cache;
 import com.google.common.cache.CacheBuilder;
+import com.google.common.cache.RemovalCause;
 import com.google.common.cache.RemovalListener;
 import com.google.common.cache.RemovalNotification;
 import com.google.common.util.concurrent.ListenableFuture;
@@ -103,7 +104,9 @@ public class ConnectionAdapterImpl implements ConnectionFacade {
         @Override
         public void onRemoval(
                 final RemovalNotification<RpcResponseKey, ResponseExpectedRpcListener<?>> notification) {
-            notification.getValue().discard();
+            if (! notification.getCause().equals(RemovalCause.EXPLICIT)) {
+                notification.getValue().discard();
+            }
         }
     };