com.tibco.tea.agent.api

## Interface SettableFuture<V>

- Type Parameters:
    `V` - - type of the return value for the asynchronous operation.

      public interface SettableFuture<V>

  SettableFuture is a custom Future object that TEA Agent library provides for defining asynchronous operations. An asynchronous operation should return `SettableFuture`. To mark the asynchronous operation as finished, set the value for the Future using `set(Object)`. `setProgress(int)` and `setProgressStatus(String)` can be used to set the progress of the asynchronous operation

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `V` | `get()` Return the value stored by this SettableFuture.
    `int` | `getProgress()` Return the progress (in percentage) for the asynchronous operation Value should be between 0 and 100.
    `String` | `getProgressStatus()` Get the progress status for the asynchronous operation
    `boolean` | `isDone()` To find out if the asynchronous operation has finished execution or not.
    `boolean` | `set(V newValue)` Sets the value of this future.
    `boolean` | `setException(Throwable throwable)` Sets the future to having failed with the given exception.
    `void` | `setProgress(int progress)` Set the progress (in percentage) for the asynchronous operation Value should be between 0 and 100.
    `void` | `setProgressStatus(String progressStatus)` Set the progress status for the asynchronous operation e.g.

- - ### Method Detail

    - #### set

          boolean set(V newValue)

      Sets the value of this future. This method will return `true` if the value was successfully set, or `false` if the future has already been set.
      Parameters:
        `newValue` - the value the future should hold.
      Returns:
        true if the value was successfully set.

    - #### setException

          boolean setException(Throwable throwable)

      Sets the future to having failed with the given exception. This method will return `true` if the exception was successfully set, or `false` if the future has already been set.
      Parameters:
        `t` - the exception the future should hold.
      Returns:
        true if the exception was successfully set.

    - #### get

          V get()
          throws InterruptedException,
                ExecutionException

      Return the value stored by this SettableFuture. If the future holds an exception, then ExecutionException would be thrown.
      Returns:
        the value stored in the future
      Throws:
        `InterruptedException`
        `ExecutionException`

    - #### isDone

          boolean isDone()

      To find out if the asynchronous operation has finished execution or not.
      Returns:

    - #### getProgress

          int getProgress()

      Return the progress (in percentage) for the asynchronous operation Value should be between 0 and 100.
      Returns:
        the progress

    - #### setProgress

          void setProgress(int progress)

      Set the progress (in percentage) for the asynchronous operation Value should be between 0 and 100.
      Parameters:
        `progress` - the progress to set

    - #### setProgressStatus

          void setProgressStatus(String progressStatus)

      Set the progress status for the asynchronous operation e.g. 'provisioning software', 'Persistence subsystem starting'
      Parameters:
        `progressStatus` -

    - #### getProgressStatus

          String getProgressStatus()

      Get the progress status for the asynchronous operation
      Returns:

Copyright © 2022 TIBCO Software Inc.. All Rights Reserved.