public class FlowRunner extends Object implements RevisionHandler
Modifier and Type | Class and Description |
---|---|
static class |
FlowRunner.SimpleLogger |
Modifier and Type | Field and Description |
---|---|
protected Vector |
m_beans
The potential flow(s) to execute
|
protected Environment |
m_env |
protected Logger |
m_log |
protected int |
m_runningCount |
protected boolean |
m_startSequentially
run each Startable bean sequentially? (default in parallel)
|
Constructor and Description |
---|
FlowRunner()
Constructor
|
Modifier and Type | Method and Description |
---|---|
protected void |
decreaseCount() |
Environment |
getEnvironment()
Get the environment variables that are in use.
|
Vector |
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.
|
protected void |
launchThread(Startable s,
int flowNum) |
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
|
protected void |
runSequentially(TreeMap<Integer,Startable> startables) |
void |
setEnvironment(Environment env)
Set the environment variables to use.
|
void |
setFlows(Vector 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
|
protected Vector m_beans
protected int m_runningCount
protected transient Logger m_log
protected transient Environment m_env
protected boolean m_startSequentially
public void setLog(Logger log)
protected void launchThread(Startable s, int flowNum)
protected void decreaseCount()
public void stopAllFlows()
public void waitUntilFinished()
public void load(String fileName) throws Exception
fileName
- the name of the file to load fromException
- if something goes wrongpublic void loadBinary(String fileName) throws Exception
fileName
- the name of the file to load fromException
- if something goes wrongpublic void loadXML(String fileName) throws Exception
fileName
- the name of the file to load fromException
- if something goes wrongpublic Vector getFlows()
public void setFlows(Vector beans)
beans
- the Vector holding the flows to runpublic void setEnvironment(Environment env)
env
- the environment variables to use.public Environment getEnvironment()
public void setStartSequentially(boolean s)
s
- true if Startable beans are to be launched sequentiallypublic boolean getStartSequentially()
public void run() throws Exception
Exception
- if something goes wrong during executionpublic static void main(String[] args)
Usage:
Usage:\n\nFlowRunner
args
- command line argumentspublic String getRevision()
RevisionHandler
getRevision
in interface RevisionHandler
Copyright © 2015 University of Waikato, Hamilton, NZ. All rights reserved.