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;
@Override
public void onRemoval(
final RemovalNotification<RpcResponseKey, ResponseExpectedRpcListener<?>> notification) {
- notification.getValue().discard();
+ if (! notification.getCause().equals(RemovalCause.EXPLICIT)) {
+ notification.getValue().discard();
+ }
}
};