com.spss.psapi.task

Interface ExecutionHandle

    • Method Summary

      Methods 
      Modifier and Type Method and Description
      java.lang.String getErrorMessage()
      Returns an error message if execution terminated with an error and a message is available; returns null otherwise.
      ExecutionState getExecutionState()
      Returns the latest ExecutionState of the associated task.
      int getExitCode()
      Returns the exit code from executing the task.
      java.lang.Object getResult()
      Returns the result of the task if execution terminated with success and the task produced a result.
      Task getTask()
      Returns the Task being executed.
      ExecutionState terminate()
      Terminates execution of the associated task and returns its final ExecutionState.
      ExecutionState terminate(long milliseconds)
      Terminates execution of the associated task, waits until the task has finished or until the specified timeout has expired (whichever is sooner) and returns the execution state of the task.
      ExecutionState waitForCompletion()
      Waits until the associated task has finished executing and returns its final ExecutionState.
      ExecutionState waitForCompletion(long milliseconds)
      Waits until the associated task has finished executing, or until the specified timeout has expired (whichever is sooner) and returns the ExecutionState of the task.
    • Method Detail

      • getTask

        Task getTask()
        Returns the Task being executed.
        Returns:
        the Task being executed
      • getExecutionState

        ExecutionState getExecutionState()
        Returns the latest ExecutionState of the associated task.
        Returns:
        the latest execution state
      • waitForCompletion

        ExecutionState waitForCompletion()
        Waits until the associated task has finished executing and returns its final ExecutionState.
        Returns:
        the final execution state
      • waitForCompletion

        ExecutionState waitForCompletion(long milliseconds)
        Waits until the associated task has finished executing, or until the specified timeout has expired (whichever is sooner) and returns the ExecutionState of the task. A timeout of 0 or less means to wait forever.
        Parameters:
        milliseconds - the maximum time to wait for completion
        Returns:
        the execution state when the call completed
      • terminate

        ExecutionState terminate()
        Terminates execution of the associated task and returns its final ExecutionState. The call blocks until the task has finished. The return value may not be TERMINATED if execution had completed before the termination request was sent.
        Returns:
        the final execution state
      • terminate

        ExecutionState terminate(long milliseconds)
        Terminates execution of the associated task, waits until the task has finished or until the specified timeout has expired (whichever is sooner) and returns the execution state of the task. The result may not be TERMINATED if execution had completed before the termination request was sent or if execution had not completed before the timeout expired. A timeout of 0 or less means to wait forever.
        Parameters:
        milliseconds - the maximum time to wait for the task to complete
        Returns:
        the execution state when the call completed
        Since:
        PSAPI 13.0
      • getResult

        java.lang.Object getResult()
        Returns the result of the task if execution terminated with success and the task produced a result. Returns null if the task is still executing, or if it terminated in a state other than SUCCESS, or if it did not return a result.
        Returns:
        the result of the task if it has terminated successfully, or null otherwise
      • getExitCode

        int getExitCode()
        Returns the exit code from executing the task. Typically this is either 0 to indicate success or 1 to indicate failure although some tasks may use different conventions. The result of querying the exit code before the task has finished executing is undefined.
        Returns:
        the exit code from this task
        Since:
        PSAPI 1.2
      • getErrorMessage

        java.lang.String getErrorMessage()
        Returns an error message if execution terminated with an error and a message is available; returns null otherwise.
        Returns:
        a message describing why execution failed

(C) Copyright IBM Corp. 1994, 2015. All Rights Reserved.