org.apache.hc.core5.concurrent

## Class ComplexCancellable

- java.lang.Object
- - org.apache.hc.core5.concurrent.ComplexCancellable

- All Implemented Interfaces:
    Cancellable, CancellableDependency

      public final class ComplexCancellable
      extends Object
      implements CancellableDependency

  `Cancellable` that has a dependency on another `Cancellable` process or operation. Dependent process or operation will get cancelled if this `Cancellable` itself is cancelled.
  Since:
    5.0

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ComplexCancellable()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `cancel()` Cancels the ongoing operation or process.
    `boolean` | `isCancelled()` Determines whether the process or operation has been cancelled.
    `void` | `setDependency(Cancellable dependency)` Sets `Cancellable` dependency on another ongoing process or operation represented by `Cancellable`.

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

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

- - ### Constructor Detail

    - #### ComplexCancellable

          public ComplexCancellable()

  - ### Method Detail

    - #### isCancelled

          public boolean isCancelled()

      Description copied from interface: `CancellableDependency`
      Determines whether the process or operation has been cancelled.
      Specified by:
        `isCancelled` in interface `CancellableDependency`
      Returns:
        cancelled flag.

    - #### setDependency

          public void setDependency(Cancellable dependency)

      Description copied from interface: `CancellableDependency`
      Sets `Cancellable` dependency on another ongoing process or operation represented by `Cancellable`.
      Specified by:
        `setDependency` in interface `CancellableDependency`

    - #### cancel

          public boolean cancel()

      Description copied from interface: `Cancellable`
      Cancels the ongoing operation or process.
      Specified by:
        `cancel` in interface `Cancellable`
      Returns:
        `true` if the operation or process has been cancelled as a result of this method call or `false` if it has already been cancelled or not started.

Copyright © 2005–2022 The Apache Software Foundation. All rights reserved.