Class Futures.NonCancellationPropagatingFuture<V>
- java.lang.Object
-
- com.google.common.util.concurrent.internal.InternalFutureFailureAccess
-
- com.google.common.util.concurrent.AbstractFuture<V>
-
- com.google.common.util.concurrent.AbstractFuture.TrustedFuture<V>
-
- com.google.common.util.concurrent.Futures.NonCancellationPropagatingFuture<V>
-
- All Implemented Interfaces:
AbstractFuture.Trusted<V>
,ListenableFuture<V>
,java.lang.Runnable
,java.util.concurrent.Future<V>
- Enclosing class:
- Futures
private static final class Futures.NonCancellationPropagatingFuture<V> extends AbstractFuture.TrustedFuture<V> implements java.lang.Runnable
A wrapped future that does not propagate cancellation to its delegate.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.common.util.concurrent.AbstractFuture
AbstractFuture.Trusted<V>, AbstractFuture.TrustedFuture<V>
-
-
Field Summary
Fields Modifier and Type Field Description private ListenableFuture<V>
delegate
-
Constructor Summary
Constructors Constructor Description NonCancellationPropagatingFuture(ListenableFuture<V> delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
afterDone()
Callback method that is called exactly once after the future is completed.protected java.lang.String
pendingToString()
Provide a human-readable explanation of why this future has not yet completed.void
run()
-
Methods inherited from class com.google.common.util.concurrent.AbstractFuture.TrustedFuture
addListener, cancel, get, get, isCancelled, isDone
-
Methods inherited from class com.google.common.util.concurrent.AbstractFuture
interruptTask, maybePropagateCancellationTo, set, setException, setFuture, toString, tryInternalFastPathGetFailure, wasInterrupted
-
-
-
-
Field Detail
-
delegate
@CheckForNull private ListenableFuture<V> delegate
-
-
Constructor Detail
-
NonCancellationPropagatingFuture
NonCancellationPropagatingFuture(ListenableFuture<V> delegate)
-
-
Method Detail
-
run
public void run()
- Specified by:
run
in interfacejava.lang.Runnable
-
pendingToString
@CheckForNull protected java.lang.String pendingToString()
Description copied from class:AbstractFuture
Provide a human-readable explanation of why this future has not yet completed.- Overrides:
pendingToString
in classAbstractFuture<V>
- Returns:
- null if an explanation cannot be provided (e.g. because the future is done).
-
afterDone
protected void afterDone()
Description copied from class:AbstractFuture
Callback method that is called exactly once after the future is completed.If
AbstractFuture.interruptTask()
is also run during completion,AbstractFuture.afterDone()
runs after it.The default implementation of this method in
AbstractFuture
does nothing. This is intended for very lightweight cleanup work, for example, timing statistics or clearing fields. If your task does anything heavier consider, just using a listener with an executor.- Overrides:
afterDone
in classAbstractFuture<V>
-
-