Package weka.knowledgeflow

# Class BaseExecutionEnvironment

java.lang.Object
weka.knowledgeflow.BaseExecutionEnvironment

All Implemented Interfaces:
  `ExecutionEnvironment`

public class BaseExecutionEnvironment extends Object implements ExecutionEnvironment
Base class for execution environments

Author:
  Mark Hall (mhall{[at]}pentaho{[dot]}com)

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static class`
  `BaseExecutionEnvironment.BaseExecutionEnvironmentDefaults`
  Defaults for the base execution environment

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `DESCRIPTION`
  Description of the default execution environment

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `BaseExecutionEnvironment()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `FlowExecutor`
  `getDefaultFlowExecutor()`
  Gets a new instance of the default flow executor suitable for use with this execution environment
  `Defaults`
  `getDefaultSettings()`
  Get default settings for the base execution environment
  `String`
  `getDescription()`
  Get a description of this execution environment
  `Environment`
  `getEnvironmentVariables()`
  Get environment variables for this execution environment
  `FlowExecutor`
  `getFlowExecutor()`
  Get the executor that will actually be responsible for running the flow.
  `GraphicalEnvironmentCommandHandler`
  `getGraphicalEnvironmentCommandHandler()`
  Get the environment for performing commands at the application-level in a graphical environment.
  `Logger`
  `getLog()`
  Get the log in use
  `LoggingLevel`
  `getLoggingLevel()`
  Get the logging level in use
  `Settings`
  `getSettings()`
  Get knowledge flow settings for this execution environment
  `boolean`
  `isHeadless()`
  Get whether this execution environment is headless
  `void`
  `setEnvironmentVariables(Environment env)`
  Set environment variables for this execution environment
  `void`
  `setFlowExecutor(FlowExecutor executor)`
  Set the executor that will actually be responsible for running the flow.
  `void`
  `setGraphicalEnvironmentCommandHandler(GraphicalEnvironmentCommandHandler handler)`
  Set the environment for performing commands at the application-level in a graphical environment.
  `void`
  `setHeadless(boolean headless)`
  Set whether this execution environment is headless
  `void`
  `setLog(Logger log)`
  Set the log to use
  `void`
  `setLoggingLevel(LoggingLevel level)`
  Set the logging level to use
  `void`
  `setSettings(Settings settings)`
  Set knowledge flow settings for this execution environment
  `void`
  `stopProcessing()`
  The main point at which to request stop processing of a flow.
  `<T> Future<ExecutionResult<T>>`
  `submitTask(StepTask<T> stepTask)`
  Submit a task to be run by the execution environment.

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### DESCRIPTION

    public static final String DESCRIPTION
    Description of the default execution environment
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### BaseExecutionEnvironment

    public BaseExecutionEnvironment()

- ## Method Details

  - ### getDescription

    public 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

  - ### getGraphicalEnvironmentCommandHandler

    public GraphicalEnvironmentCommandHandler getGraphicalEnvironmentCommandHandler()
    Get the environment for performing commands at the application-level in a graphical environment.
    Specified by:
      `getGraphicalEnvironmentCommandHandler` in interface `ExecutionEnvironment`
    Returns:
      the graphical environment command handler, or null if running headless

  - ### setGraphicalEnvironmentCommandHandler

    public void setGraphicalEnvironmentCommandHandler(GraphicalEnvironmentCommandHandler handler)
    Set the environment for performing commands at the application-level in a graphical environment.
    Specified by:
      `setGraphicalEnvironmentCommandHandler` in interface `ExecutionEnvironment`

  - ### getEnvironmentVariables

    public Environment getEnvironmentVariables()
    Get environment variables for this execution environment
    Specified by:
      `getEnvironmentVariables` in interface `ExecutionEnvironment`
    Returns:
      the environment variables for this execution environment

  - ### setEnvironmentVariables

    public void setEnvironmentVariables(Environment env)
    Set environment variables for this execution environment
    Specified by:
      `setEnvironmentVariables` in interface `ExecutionEnvironment`
    Parameters:
      `env` - the environment variables to use

  - ### setSettings

    public void setSettings(Settings settings)
    Description copied from interface: `ExecutionEnvironment`
    Set knowledge flow settings for this execution environment
    Specified by:
      `setSettings` in interface `ExecutionEnvironment`
    Parameters:
      `settings` - the settings to use

  - ### getSettings

    public Settings getSettings()
    Description copied from interface: `ExecutionEnvironment`
    Get knowledge flow settings for this execution environment
    Specified by:
      `getSettings` in interface `ExecutionEnvironment`
    Returns:
      the settings to use

  - ### getLog

    public Logger getLog()
    Get the log in use
    Specified by:
      `getLog` in interface `ExecutionEnvironment`
    Returns:
      the log in use

  - ### setLog

    public void setLog(Logger log)
    Set the log to use
    Specified by:
      `setLog` in interface `ExecutionEnvironment`
    Parameters:
      `log` - the log to use

  - ### getLoggingLevel

    public LoggingLevel getLoggingLevel()
    Get the logging level in use
    Specified by:
      `getLoggingLevel` in interface `ExecutionEnvironment`
    Returns:
      the logging level in use

  - ### setLoggingLevel

    public void setLoggingLevel(LoggingLevel level)
    Set the logging level to use
    Specified by:
      `setLoggingLevel` in interface `ExecutionEnvironment`
    Parameters:
      `level` - the logging level to use

  - ### submitTask

    public <T> 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

  - ### getDefaultSettings

    public Defaults getDefaultSettings()
    Get default settings for the base execution environment
    Specified by:
      `getDefaultSettings` in interface `ExecutionEnvironment`
    Returns:
      the default settings