public class FlowRunner extends java.lang.Object implements FlowExecutor, CommandlineRunnable
Modifier and Type | Class and Description |
---|---|
static class |
FlowRunner.SimpleLogger
A simple logging implementation that writes to standard out
|
Constructor and Description |
---|
FlowRunner()
Constructor
|
FlowRunner(Settings settings)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addExecutionFinishedCallback(ExecutionFinishedCallback callback)
Set a callback to notify when flow execution finishes
|
boolean |
flowBusy()
Checks to see if any step(s) are doing work
|
BaseExecutionEnvironment |
getExecutionEnvironment()
Return the execution environment object for this flow executor
|
Flow |
getFlow()
Get the flow to execute
|
boolean |
getLaunchStartPointsSequentially()
Get whether to launch start points sequentially
|
Logger |
getLogger()
Get the log to use
|
LoggingLevel |
getLoggingLevel()
Get the logging level to use
|
Settings |
getSettings()
Get the settings in use when executing the Flow
|
static void |
main(java.lang.String[] args)
Main method for executing the FlowRunner
|
void |
postExecution()
Perform any teardown stuff that might need to happen after execution.
|
void |
preExecution()
Perform any setup stuff that might need to happen before execution.
|
void |
removeExecutionFinishedCallback(ExecutionFinishedCallback callback)
Remove a callback
|
void |
run()
Execute the flow
|
void |
run(java.lang.Object toRun,
java.lang.String[] args)
Run a FlowRunner object
|
void |
runParallel()
Run the flow by launching start points in parallel
|
void |
runSequentially()
Run the flow by launching start points sequentially.
|
void |
setEnvironment(Environment env) |
void |
setExecutionEnvironment(BaseExecutionEnvironment env)
Set the execution environment to use
|
void |
setFlow(Flow flow)
Set the flow to execute
|
void |
setLaunchStartPointsSequentially(boolean s)
Set whether to launch start points sequentially
|
void |
setLogger(Logger logger)
Set the log to use
|
void |
setLoggingLevel(LoggingLevel level)
Set the logging level to use
|
void |
setSettings(Settings settings)
Set the settings to use when executing the Flow
|
void |
stopProcessing()
Attempt to stop processing in all steps
|
void |
waitUntilFinished()
Wait until all the steps are no longer busy
|
boolean |
wasStopped()
Returns true if execution was stopped via the stopProcessing() method
|
public FlowRunner()
public FlowRunner(Settings settings)
public void setSettings(Settings settings)
setSettings
in interface FlowExecutor
settings
- the settings to usepublic Settings getSettings()
getSettings
in interface FlowExecutor
public void setEnvironment(Environment env)
public static void main(java.lang.String[] args)
args
- command line argumentspublic void run(java.lang.Object toRun, java.lang.String[] args) throws java.lang.Exception
run
in interface CommandlineRunnable
toRun
- the FlowRunner object to executeargs
- the command line argumentsjava.lang.Exception
- if a problem occurspublic void addExecutionFinishedCallback(ExecutionFinishedCallback callback)
addExecutionFinishedCallback
in interface FlowExecutor
callback
- the callback to notifypublic void removeExecutionFinishedCallback(ExecutionFinishedCallback callback)
removeExecutionFinishedCallback
in interface FlowExecutor
callback
- the callback to removepublic Flow getFlow()
getFlow
in interface FlowExecutor
public void setFlow(Flow flow)
setFlow
in interface FlowExecutor
flow
- the flow to executepublic Logger getLogger()
getLogger
in interface FlowExecutor
public void setLogger(Logger logger)
setLogger
in interface FlowExecutor
logger
- the log to usepublic LoggingLevel getLoggingLevel()
getLoggingLevel
in interface FlowExecutor
public void setLoggingLevel(LoggingLevel level)
setLoggingLevel
in interface FlowExecutor
level
- the logging level to usepublic boolean getLaunchStartPointsSequentially()
public void setLaunchStartPointsSequentially(boolean s)
s
- true if start points are to be launched sequentiallypublic BaseExecutionEnvironment getExecutionEnvironment()
FlowExecutor
getExecutionEnvironment
in interface FlowExecutor
public void setExecutionEnvironment(BaseExecutionEnvironment env)
setExecutionEnvironment
in interface FlowExecutor
env
- the execution environment to usepublic void run() throws WekaException
WekaException
- if a problem occurspublic void runSequentially() throws WekaException
runSequentially
in interface FlowExecutor
WekaException
- if a problem occurspublic void runParallel() throws WekaException
runParallel
in interface FlowExecutor
WekaException
- if a problem occurspublic void waitUntilFinished()
waitUntilFinished
in interface FlowExecutor
public boolean flowBusy()
public void stopProcessing()
stopProcessing
in interface FlowExecutor
public boolean wasStopped()
wasStopped
in interface FlowExecutor
public void preExecution() throws java.lang.Exception
CommandlineRunnable
preExecution
in interface CommandlineRunnable
java.lang.Exception
- if a problem occurs during setuppublic void postExecution() throws java.lang.Exception
CommandlineRunnable
postExecution
in interface CommandlineRunnable
java.lang.Exception
- if a problem occurs during teardown