Class BaseExecutionEnvironment

  • All Implemented Interfaces:
    ExecutionEnvironment

    public class BaseExecutionEnvironment
    extends java.lang.Object
    implements ExecutionEnvironment
    Base class for execution environments
    Author:
    Mark Hall (mhall{[at]}pentaho{[dot]}com)
    • Field Detail

      • DESCRIPTION

        public static final java.lang.String DESCRIPTION
        Description of the default execution environment
        See Also:
        Constant Field Values
    • Constructor Detail

      • BaseExecutionEnvironment

        public BaseExecutionEnvironment()
    • Method Detail

      • getDescription

        public java.lang.String getDescription()
        Get a description of this execution environment
        Specified by:
        getDescription in interface ExecutionEnvironment
        Returns:
        a description of this execution environemtn
      • isHeadless

        public boolean isHeadless()
        Get whether this execution environment is headless
        Specified by:
        isHeadless in interface ExecutionEnvironment
        Returns:
        true if this execution environment is headless
      • setHeadless

        public void setHeadless​(boolean headless)
        Set whether this execution environment is headless
        Specified by:
        setHeadless in interface ExecutionEnvironment
        Parameters:
        headless - true if the execution environment is headless
      • submitTask

        public <T> java.util.concurrent.Future<ExecutionResult<T>> submitTask​(StepTask<T> stepTask)
                                                                       throws WekaException
        Submit a task to be run by the execution environment. The default execution environment uses an ExecutorService to run tasks in parallel. Client steps are free to use this service or to just do their processing locally within their own code.
        Specified by:
        submitTask in interface ExecutionEnvironment
        Parameters:
        stepTask - the StepTask encapsulating the code to be run
        Returns:
        the Future holding the status and result when complete
        Throws:
        WekaException - if processing fails in the case of
      • stopProcessing

        public void stopProcessing()
        The main point at which to request stop processing of a flow. This will request the FlowExecutor to stop and then shutdown the executor service
        Specified by:
        stopProcessing in interface ExecutionEnvironment
      • getDefaultFlowExecutor

        public FlowExecutor getDefaultFlowExecutor()
        Gets a new instance of the default flow executor suitable for use with this execution environment
        Returns:
        a new instance of the default flow executor suitable for use with this execution environment
      • getFlowExecutor

        public FlowExecutor getFlowExecutor()
        Get the executor that will actually be responsible for running the flow. This is not guaranteed to be available from this execution environment until the flow is actually running (or at least initialized)
        Returns:
        the executor that will be running the flow
      • setFlowExecutor

        public void setFlowExecutor​(FlowExecutor executor)
        Set the executor that will actually be responsible for running the flow. This is not guaranteed to be available from this execution environment until the flow is actually running (or at least initialized)
        Parameters:
        executor - the executor that will be running the flow