Interface ExecutorHelper

All Superinterfaces:
AutoCloseable, Executor
All Known Implementing Classes:
ExecutorHelperImpl

public interface ExecutorHelper extends Executor
Helper class for routing Maven execution based on preferences and/or issued execution requests.
  • Method Details

    • forMavenInstallation

      static ExecutorHelper forMavenInstallation(Path installationDirectory, ExecutorHelper.Mode defaultMode)
      Creates ExecutorHelper along with needed executors using provided installation directory. Created instance will assume that provided executors are managed by itself, and on close will close them as well.
      Parameters:
      installationDirectory - The Maven Home (installation) directory.
      defaultMode - The default mode of helper.
      Returns:
      New instance of helper that will create executors, and close them when is closed.
    • forExecutors

      static ExecutorHelper forExecutors(ExecutorHelper.Mode defaultMode, EmbeddedMavenExecutor embedded, ForkedMavenExecutor forked)
      Creates ExecutorHelper instance with provided default mode and provided executors. Created instance will assume that provided executors are managed by caller, and on close will not close them.
      Parameters:
      defaultMode - The default mode of helper.
      embedded - The embedded executor to use.
      forked - The forked executor to use.
      Returns:
      New instance of helper that will not close provided executors when is closed.
    • getDefaultMode

      ExecutorHelper.Mode getDefaultMode()
      Returns the preferred mode of this helper.
    • execute

      default ExecutorResult execute(ExecutorRequest executorRequest) throws ExecutorException
      Executes the request with preferred mode executor.
      Specified by:
      execute in interface Executor
      Parameters:
      executorRequest - the request containing all necessary information for the execution
      Returns:
      ExecutorResult carrying the result of the execution
      Throws:
      ExecutorException - if an error occurs during the execution process
    • execute

      ExecutorResult execute(ExecutorHelper.Mode mode, ExecutorRequest executorRequest) throws ExecutorException
      Executes the request with passed in mode executor.
      Throws:
      ExecutorException