Package: org.gradle.tooling

## [Java] Interface BuildActionExecuter<T>

- org.gradle.tooling.LongRunningOperation

- All Superinterfaces:
    ConfigurableLauncher, LongRunningOperation

  Used to execute a BuildAction in the build process.

  Parameters:
    `` - The type of result produced by this executer.
  Since:
    1.8

- - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `T` | `run()` Runs the action, blocking until its result is available.
    `void` | `run(ResultHandler<? super T> handler)` Starts executing the action, passing the result to the given handler when complete.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `interface ConfigurableLauncher` | `addProgressListener, addProgressListener, addProgressListener, addProgressListener, setColorOutput, setJavaHome, setJvmArguments, setJvmArguments, setStandardError, setStandardInput, setStandardOutput, withArguments, withArguments, withCancellationToken`
    `interface LongRunningOperation` | `addProgressListener, addProgressListener, addProgressListener, addProgressListener, setColorOutput, setJavaHome, setJvmArguments, setJvmArguments, setStandardError, setStandardInput, setStandardOutput, withArguments, withArguments, withCancellationToken`

- - ### Method Detail

    - #### public T run()

      Runs the action, blocking until its result is available.

      throws:
        UnsupportedVersionException When the target Gradle version does not support build action execution.
      throws:
        org.gradle.tooling.exceptions.UnsupportedOperationConfigurationException When the target Gradle version does not support some requested configuration option.
      throws:
        org.gradle.tooling.exceptions.UnsupportedBuildArgumentException When there is a problem with build arguments provided by withArguments(String...).
      throws:
        BuildActionFailureException When the build action fails with an exception.
      throws:
        BuildCancelledException When the operation was cancelled before it completed successfully.
      throws:
        BuildException On some failure executing the Gradle build.
      throws:
        GradleConnectionException On some other failure using the connection.
      throws:
        IllegalStateException When the connection has been closed or is closing.
      Since:
        1.8

    - #### public void run(ResultHandler<? super T> handler)

      Starts executing the action, passing the result to the given handler when complete. This method returns immediately, and the result is later passed to the given handler's ResultHandler.onComplete method.

      If the operation fails, the handler's ResultHandler.onFailure method is called with the appropriate exception. See run() for a description of the various exceptions that the operation may fail with.

      throws:
        IllegalStateException When the connection has been closed or is closing.
      Parameters:
        `handler` - The handler to supply the result to.
      Since:
        1.8