Package weka.gui.beans
Class FlowRunner
java.lang.Object
weka.gui.beans.FlowRunner
- All Implemented Interfaces:
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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet the environment variables that are in use.getFlows()
Get the vector holding the flow(s)Returns the revision string.boolean
Gets whether Startable beans will be launched sequentially or all in parallel.void
Load a serialized KnowledgeFlow (either binary or xml)void
loadBinary
(String fileName) Load a binary serialized KnowledgeFlowvoid
Load an XML serialized KnowledgeFlowstatic void
Main method for testing this class.void
run()
Launch all loaded KnowledgeFlowvoid
Set the environment variables to use.void
Set the vector holding the flows(s) to runvoid
void
setStartSequentially
(boolean s) Set whether to launch Startable beans one after the other or all in parallel.void
void
Waits until all flows have finished executing before returning
-
Constructor Details
-
FlowRunner
public FlowRunner()Constructor -
FlowRunner
public FlowRunner(boolean loadProps, boolean registerLog)
-
-
Method Details
-
setLog
-
stopAllFlows
public void stopAllFlows() -
waitUntilFinished
public void waitUntilFinished()Waits until all flows have finished executing before returning -
load
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
Load a binary serialized KnowledgeFlow- Parameters:
fileName
- the name of the file to load from- Throws:
Exception
- if something goes wrong
-
loadXML
Load an XML serialized KnowledgeFlow- Parameters:
fileName
- the name of the file to load from- Throws:
Exception
- if something goes wrong
-
getFlows
Get the vector holding the flow(s)- Returns:
- the Vector holding the flow(s)
-
setFlows
Set the vector holding the flows(s) to run- Parameters:
beans
- the Vector holding the flows to run
-
setEnvironment
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
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
Launch all loaded KnowledgeFlow- Throws:
Exception
- if something goes wrong during execution
-
main
Main method for testing this class.Usage:\n\nFlowRunner
- Parameters:
args
- command line arguments
-
getRevision
Description copied from interface:RevisionHandler
Returns the revision string.- Specified by:
getRevision
in interfaceRevisionHandler
- Returns:
- the revision
-