public abstract class BatchDescription extends Object
describe()
method and build a workflow in the method, like as following:
@Batch(name = "hoge")
public class HogeBatch extends BatchDescription {
@Override
public void describe() {
Work first = run(FirstFlow.class).soon();
Work second = run(SecondFlow.class).after(first);
Work para = run(ParallelFlow.class).after(first);
Work join = run(JoinFlow.class).after(second, para);
...
}
}
In the above example, only FirstFlow
will be started first. And then, after the FirstFlow
was
completed, SecondFlow
and ParallelFlow
will be concurrently processed. Finally,
JoinFlow
was processed after the all other jobflows were completed.Modifier and Type | Class and Description |
---|---|
protected class |
BatchDescription.DependencyBuilder
A builder for building batch by specifying Unit-of-Works and their dependencies.
|
Constructor and Description |
---|
BatchDescription() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
describe()
Describes workflow structure.
|
Collection<Work> |
getWorks()
Returns a collection of Unit-of-Works which is represented in this batch.
|
protected BatchDescription.DependencyBuilder |
run(Class<? extends FlowDescription> jobflow)
Start registering a new jobflow to this batch.
|
protected BatchDescription.DependencyBuilder |
run(String scriptDefinition)
Deprecated.
does not supported
|
void |
start()
Analyzes batch DSL using
batch description method . |
String |
toString() |
public final void start()
batch description method
.
Application developers should not invoke this method directly.protected abstract void describe()
@Deprecated protected BatchDescription.DependencyBuilder run(String scriptDefinition)
scriptDefinition
- the script definition pathIllegalArgumentException
- if the script definition is something wrongIllegalStateException
- if another job is building dependenciesprotected BatchDescription.DependencyBuilder run(Class<? extends FlowDescription> jobflow)
Work
object which represents the registered jobflow.
And then the latter method accepts Work
objects as its dependencies.jobflow
- the target jobflow classIllegalArgumentException
- if the jobflow class is something wrongIllegalStateException
- if another job is building dependenciespublic Collection<Work> getWorks()
Copyright © 2011–2018 Asakusa Framework Team. All rights reserved.