Class ComplexFuture<T>

  • Type Parameters:
    T - the future result type of an asynchronous operation.
    All Implemented Interfaces:
    java.util.concurrent.Future<T>, Cancellable, CancellableDependency

    public final class ComplexFuture<T>
    extends BasicFuture<T>
    implements CancellableDependency
    Future whose result depends on another Cancellable process or operation or another Future. Dependent process will get cancelled if the future itself is cancelled.
    Since:
    5.0
    • Field Detail

      • dependencyRef

        private final java.util.concurrent.atomic.AtomicReference<Cancellable> dependencyRef
    • Constructor Detail

    • Method Detail

      • setDependency

        public void setDependency​(java.util.concurrent.Future<?> dependency)
      • failed

        public boolean failed​(java.lang.Exception exception)
        Overrides:
        failed in class BasicFuture<T>
      • cancel

        public boolean cancel​(boolean mayInterruptIfRunning)
        Specified by:
        cancel in interface java.util.concurrent.Future<T>
        Overrides:
        cancel in class BasicFuture<T>