Interface FlowExecutor

  • All Known Implementing Classes:
    FlowRunner, StepInjectorFlowRunner

    public interface FlowExecutor
    Interface to something that can execute a Knowledge Flow process
    Version:
    $Revision: $
    Author:
    Mark Hall (mhall{[at]}pentaho{[dot]}com)
    • Method Detail

      • setFlow

        void setFlow​(Flow flow)
        Set the flow to be executed
        Parameters:
        flow - the flow to execute
      • getFlow

        Flow getFlow()
        Get the flow to be executed
        Returns:
        the flow to be executed
      • setLogger

        void setLogger​(Logger logger)
        Set a log to use
        Parameters:
        logger - the log tos use
      • getLogger

        Logger getLogger()
        Get the log in use
        Returns:
        the log in use
      • setLoggingLevel

        void setLoggingLevel​(LoggingLevel level)
        Set the level to log at
        Parameters:
        level - the level to log at (logging messages at this level or below will be displayed in the log)
      • getLoggingLevel

        LoggingLevel getLoggingLevel()
        Get the logging level to log at
        Returns:
        the logging level to log at
      • setExecutionEnvironment

        void setExecutionEnvironment​(BaseExecutionEnvironment env)
        Set the execution environment to use
        Parameters:
        env - the execution environment to use
      • setSettings

        void setSettings​(Settings settings)
        Convenience method for applying settings - implementers should delegate the the execution environment
        Parameters:
        settings - the settings to use
      • getSettings

        Settings getSettings()
        Convenience method for getting current settings - implementers should delegate the the execution environment
        Returns:
        the settings in use
      • getExecutionEnvironment

        BaseExecutionEnvironment getExecutionEnvironment()
        Return the execution environment object for this flow executor
        Returns:
        the execution environment
      • runSequentially

        void runSequentially()
                      throws WekaException
        Run the flow sequentially (i.e. launch start points sequentially rather than in parallel)
        Throws:
        WekaException - if a problem occurs during execution
      • runParallel

        void runParallel()
                  throws WekaException
        Run the flow by launching all start points in parallel
        Throws:
        WekaException - if a problem occurs during execution
      • waitUntilFinished

        void waitUntilFinished()
        Block until all steps are no longer busy
      • stopProcessing

        void stopProcessing()
        Stop all processing
      • wasStopped

        boolean wasStopped()
        Returns true if execution was stopped via the stopProcessing() method
        Returns:
        true if execution was stopped
      • addExecutionFinishedCallback

        void addExecutionFinishedCallback​(ExecutionFinishedCallback callback)
        Add a callback to notify when execution finishes
        Parameters:
        callback - the callback to notify
      • removeExecutionFinishedCallback

        void removeExecutionFinishedCallback​(ExecutionFinishedCallback callback)
        Remove a callback
        Parameters:
        callback - the callback to remove