com.hazelcast.util.executor

## Class CompletableFutureTask<V>

- java.lang.Object
- - com.hazelcast.spi.impl.AbstractCompletableFuture<V>
  - - com.hazelcast.util.executor.CompletableFutureTask<V>

- All Implemented Interfaces:
    ICompletableFuture<V>, Runnable, Future<V>, RunnableFuture<V>

      public class CompletableFutureTask<V>
      extends com.hazelcast.spi.impl.AbstractCompletableFuture<V>
      implements ICompletableFuture<V>, RunnableFuture<V>

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CompletableFutureTask(Callable<V> callable, ExecutorService asyncExecutor)`
    `CompletableFutureTask(Runnable runnable, V result, ExecutorService asyncExecutor)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `cancelled(boolean mayInterruptIfRunning)` Protected method invoked when this task transitions to state `isCancelled`.
    `void` | `run()`
    `String` | `toString()`

    - ### Methods inherited from class com.hazelcast.spi.impl.AbstractCompletableFuture

      `andThen, andThen, cancel, done, get, get, getResult, isCancelled, isDone, setResult, shouldCancel`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface com.hazelcast.core.ICompletableFuture

      `andThen, andThen`

    - ### Methods inherited from interface java.util.concurrent.Future

      `cancel, get, get, isCancelled, isDone`

- - ### Constructor Detail

    - #### CompletableFutureTask

          public CompletableFutureTask(Callable<V> callable,
                                       ExecutorService asyncExecutor)

    - #### CompletableFutureTask

          public CompletableFutureTask(Runnable runnable,
                                       V result,
                                       ExecutorService asyncExecutor)

  - ### Method Detail

    - #### run

          public void run()

      Specified by:
        `run` in interface `Runnable`
      Specified by:
        `run` in interface `RunnableFuture<V>`

    - #### cancelled

          protected void cancelled(boolean mayInterruptIfRunning)

      Description copied from class: `com.hazelcast.spi.impl.AbstractCompletableFuture`
      Protected method invoked when this task transitions to state `isCancelled`. The default implementation does nothing. Subclasses may override this method to invoke callbacks or perform bookkeeping. Implementation has to handle exceptions itself.
      Overrides:
        `cancelled` in class `com.hazelcast.spi.impl.AbstractCompletableFuture<V>`
      Parameters:
        `mayInterruptIfRunning` - `true` if the thread executing this task was supposed to be interrupted; otherwise, in-progress tasks are allowed to complete

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2018. All rights reserved.