Package weka.gui.beans
Class FlowRunner
- java.lang.Object
-
- weka.gui.beans.FlowRunner
-
- All Implemented Interfaces:
RevisionHandler
public class FlowRunner extends java.lang.Object implements RevisionHandler
Small utility class for executing KnowledgeFlow flows outside of the KnowledgeFlow application- Version:
- $Revision: 7059 $
- Author:
- Mark Hall (mhall{[at]}pentaho{[dot]}org)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFlowRunner.SimpleLogger
-
Constructor Summary
Constructors Constructor Description FlowRunner()Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description EnvironmentgetEnvironment()Get the environment variables that are in use.java.util.VectorgetFlows()Get the vector holding the flow(s)java.lang.StringgetRevision()Returns the revision string.booleangetStartSequentially()Gets whether Startable beans will be launched sequentially or all in parallel.voidload(java.lang.String fileName)Load a serialized KnowledgeFlow (either binary or xml)voidloadBinary(java.lang.String fileName)Load a binary serialized KnowledgeFlowvoidloadXML(java.lang.String fileName)Load an XML serialized KnowledgeFlowstatic voidmain(java.lang.String[] args)Main method for testing this class.voidrun()Launch all loaded KnowledgeFlowvoidsetEnvironment(Environment env)Set the environment variables to use.voidsetFlows(java.util.Vector beans)Set the vector holding the flows(s) to runvoidsetLog(Logger log)voidsetStartSequentially(boolean s)Set whether to launch Startable beans one after the other or all in parallel.voidstopAllFlows()voidwaitUntilFinished()Waits until all flows have finished executing before returning
-
-
-
Method Detail
-
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(java.lang.String fileName) throws java.lang.ExceptionLoad a serialized KnowledgeFlow (either binary or xml)- Parameters:
fileName- the name of the file to load from- Throws:
java.lang.Exception- if something goes wrong
-
loadBinary
public void loadBinary(java.lang.String fileName) throws java.lang.ExceptionLoad a binary serialized KnowledgeFlow- Parameters:
fileName- the name of the file to load from- Throws:
java.lang.Exception- if something goes wrong
-
loadXML
public void loadXML(java.lang.String fileName) throws java.lang.ExceptionLoad an XML serialized KnowledgeFlow- Parameters:
fileName- the name of the file to load from- Throws:
java.lang.Exception- if something goes wrong
-
getFlows
public java.util.Vector getFlows()
Get the vector holding the flow(s)- Returns:
- the Vector holding the flow(s)
-
setFlows
public void setFlows(java.util.Vector 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 java.lang.ExceptionLaunch all loaded KnowledgeFlow- Throws:
java.lang.Exception- if something goes wrong during execution
-
main
public static void main(java.lang.String[] args)
Main method for testing this class.
Usage:
Usage:\n\nFlowRunner
- Parameters:
args- command line arguments
-
getRevision
public java.lang.String getRevision()
Description copied from interface:RevisionHandlerReturns the revision string.- Specified by:
getRevisionin interfaceRevisionHandler- Returns:
- the revision
-
-