Package weka.gui.beans

# Class FlowRunner

java.lang.Object
weka.gui.beans.FlowRunner

All Implemented Interfaces:
  `RevisionHandler`

public class FlowRunner extends Object implements RevisionHandler
Small utility class for executing KnowledgeFlow flows outside of the KnowledgeFlow application

Version:
  $Revision: 10328 $
Author:
  Mark Hall (mhall{[at]}pentaho{[dot]}org)

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static class`
  `FlowRunner.SimpleLogger`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `FlowRunner()`
  Constructor
  `FlowRunner(boolean loadProps, boolean registerLog)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Environment`
  `getEnvironment()`
  Get the environment variables that are in use.
  `Vector<Object>`
  `getFlows()`
  Get the vector holding the flow(s)
  `String`
  `getRevision()`
  Returns the revision string.
  `boolean`
  `getStartSequentially()`
  Gets whether Startable beans will be launched sequentially or all in parallel.
  `void`
  `load(String fileName)`
  Load a serialized KnowledgeFlow (either binary or xml)
  `void`
  `loadBinary(String fileName)`
  Load a binary serialized KnowledgeFlow
  `void`
  `loadXML(String fileName)`
  Load an XML serialized KnowledgeFlow
  `static void`
  `main(String[] args)`
  Main method for testing this class.
  `void`
  `run()`
  Launch all loaded KnowledgeFlow
  `void`
  `setEnvironment(Environment env)`
  Set the environment variables to use.
  `void`
  `setFlows(Vector<Object> beans)`
  Set the vector holding the flows(s) to run
  `void`
  `setLog(Logger log)`
  `void`
  `setStartSequentially(boolean s)`
  Set whether to launch Startable beans one after the other or all in parallel.
  `void`
  `stopAllFlows()`
  `void`
  `waitUntilFinished()`
  Waits until all flows have finished executing before returning

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

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

- ## Constructor Details

  - ### FlowRunner

    public FlowRunner()
    Constructor

  - ### FlowRunner

    public FlowRunner(boolean loadProps, boolean registerLog)

- ## Method Details

  - ### setLog

    public void setLog(Logger log)

  - ### stopAllFlows

    public void stopAllFlows()

  - ### waitUntilFinished

    public void waitUntilFinished()
    Waits until all flows have finished executing before returning

  - ### load

    public void load(String fileName) throws Exception
    Load a serialized KnowledgeFlow (either binary or xml)
    Parameters:
      `fileName` - the name of the file to load from
    Throws:
      `Exception` - if something goes wrong

  - ### loadBinary

    public void loadBinary(String fileName) throws Exception
    Load a binary serialized KnowledgeFlow
    Parameters:
      `fileName` - the name of the file to load from
    Throws:
      `Exception` - if something goes wrong

  - ### loadXML

    public void loadXML(String fileName) throws Exception
    Load an XML serialized KnowledgeFlow
    Parameters:
      `fileName` - the name of the file to load from
    Throws:
      `Exception` - if something goes wrong

  - ### getFlows

    public Vector<Object> getFlows()
    Get the vector holding the flow(s)
    Returns:
      the Vector holding the flow(s)

  - ### setFlows

    public void setFlows(Vector<Object> beans)
    Set the vector holding the flows(s) to run
    Parameters:
      `beans` - the Vector holding the flows to run

  - ### setEnvironment

    public void setEnvironment(Environment env)
    Set the environment variables to use. NOTE: this needs to be called BEFORE a load method is invoked to ensure that the ${Internal.knowledgeflow.directory} variable get set in the supplied Environment object.
    Parameters:
      `env` - the environment variables to use.

  - ### getEnvironment

    public Environment getEnvironment()
    Get the environment variables that are in use.
    Returns:
      the environment variables that are in ues.

  - ### setStartSequentially

    public void setStartSequentially(boolean s)
    Set whether to launch Startable beans one after the other or all in parallel.
    Parameters:
      `s` - true if Startable beans are to be launched sequentially

  - ### getStartSequentially

    public boolean getStartSequentially()
    Gets whether Startable beans will be launched sequentially or all in parallel.
    Returns:
      true if Startable beans will be launched sequentially

  - ### run

    public void run() throws Exception
    Launch all loaded KnowledgeFlow
    Throws:
      `Exception` - if something goes wrong during execution

  - ### main

    public static void main(String[] args)
    Main method for testing this class.

         Usage:\n\nFlowRunner

    Parameters:
      `args` - command line arguments

  - ### getRevision

    public String getRevision()
    Description copied from interface: `RevisionHandler`
    Returns the revision string.
    Specified by:
      `getRevision` in interface `RevisionHandler`
    Returns:
      the revision