Expose completion future from WriteOperations
[mdsal.git] / dom / mdsal-dom-spi / src / main / java / org / opendaylight / mdsal / dom / spi / UncancellableListenableFuture.java
1 /*
2  * Copyright (c) 2020 PANTHEON.tech, s.r.o. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.mdsal.dom.spi;
9
10 import com.google.common.annotations.Beta;
11 import com.google.common.util.concurrent.ForwardingListenableFuture.SimpleForwardingListenableFuture;
12 import com.google.common.util.concurrent.ListenableFuture;
13 import org.slf4j.Logger;
14 import org.slf4j.LoggerFactory;
15
16 @Beta
17 public final class UncancellableListenableFuture<V> extends SimpleForwardingListenableFuture<V> {
18     private static final Logger LOG = LoggerFactory.getLogger(UncancellableListenableFuture.class);
19
20     public UncancellableListenableFuture(final ListenableFuture<V> delegate) {
21         super(delegate);
22     }
23
24     @Override
25     public boolean cancel(final boolean mayInterruptIfRunning) {
26         LOG.debug("Attempted to cancel future", new Throwable());
27         return false;
28     }
29 }