@Singleton public class Engine extends Object
Constructor and Description |
---|
Engine()
Create the engine with a single worker.
|
Modifier and Type | Method and Description |
---|---|
void |
addExecutor(Executor executor)
Add an executor to the list of known executors.
|
void |
execute(Execution execution)
Submit the all the steps in the workflow to the engine to be executed.
|
void |
execute(Execution execution,
String... steps)
Submit the step to the engine to be executed.
|
void |
execute(Execution execution,
WorkflowStep... steps)
Submit the step to the engine to be executed.
|
Executor |
findExecutor(String name)
Find an executor that fits the given name.
|
Set<Executor> |
getExecutors() |
int |
getExtraLocalExecutor()
The number of additional jobs that can be scheduled on the local
executor.
|
Collection<String> |
getSteps(String executionId) |
int |
getTimeout()
Return the timout the engine will wait when no steps are ready to be
executed, or executing before it declares the workflow aborted.
|
boolean |
hasStep(String executionId,
String stepId) |
boolean |
isStoreLogs()
Returns true if the executors store the logfiles in the database.
|
void |
setExecutors(Set<Executor> executors) |
void |
setExtraLocalExecutor(int extraLocalExecutor)
Sets the number of additional jobs that can be scheduled.
|
void |
setLocalExecutorThreads(int threads) |
void |
setStoreLogs(boolean storeLogs)
Should the logfiles be stored in the database.
|
void |
setTimeout(int timeout)
Sets the timeout for a workflow in seconds.
|
void |
stop(String executionId)
Stops all steps in a execution from being executed, and removes it from
the
list.
|
void |
stop(String executionId,
String... steps)
Stops a particular step from being executed, and removes it from the
list.
|
void |
stopAll()
Stop all steps from executing.
|
@Inject public void setLocalExecutorThreads(@Named(value="engine.localExecutorThreads") int threads)
public boolean isStoreLogs()
public void setStoreLogs(boolean storeLogs)
storeLogs
- set this to true (the default) to store the logfiles in the
database.public int getExtraLocalExecutor()
public void setExtraLocalExecutor(int extraLocalExecutor)
extraLocalExecutor
- the number of additional jobs that can be scheduled.public int getTimeout()
public void setTimeout(int timeout)
timeout
- the number of seconds to wait before the workflow is declared
ABORTED.public Executor findExecutor(String name)
name
- the name of the executor to find.public void addExecutor(Executor executor)
executor
- the executor, any executions will be done on a new instance of
the executor.public void execute(Execution execution)
execution
- the execution informationException
- if the step could not be added to the list.public void execute(Execution execution, String... steps)
execution
- the execution informationsteps
- the list of steps to be executed.public void execute(Execution execution, WorkflowStep... steps)
execution
- the execution informationsteps
- the list of steps to be executed.public Collection<String> getSteps(String executionId)
public void stop(String executionId, String... steps)
executionId
- the execution Idsteps
- the list of steps to be stopped.public void stop(String executionId)
executionId
- the execution Idpublic void stopAll()
Copyright © 2017. All rights reserved.