public class Pipeline
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private boolean |
autoSave
Flag to force all loaded trees to save changes after
term(com.goldencode.trpl.BaseState) . |
private boolean |
readOnly
Trees will be loaded for read-only access.
|
private int |
threads
Number of threads in the pool to process trees.
|
protected java.util.List<WalkElement> |
walkers
List of walkers to process as the pipeline.
|
Constructor and Description |
---|
Pipeline()
Default constructor.
|
Pipeline(java.util.List<WalkElement> walkers)
Construct an instance that contains the given list of walkers as the
pipeline to execute.
|
Modifier and Type | Method and Description |
---|---|
int |
getThreads()
Get the number of threads in the pool to process trees..
|
java.util.List<WalkElement> |
getWalkers()
Provides an independent list of the walkers that that define the pipeline.
|
void |
init(BaseState state)
Called once per pipeline run, before any tree walkers are processed.
|
boolean |
isAutoSave()
Get the flag that determines if all loaded trees should be forced to save
changes after the pipeline completes processing (after
term(com.goldencode.trpl.BaseState) ). |
boolean |
isReadOnly()
Get the flag that determines if trees will be loaded for read-only
access.
|
void |
setAutoSave(boolean autoSave)
Set the flag that determines if all loaded trees should be forced to save
changes after the pipeline completes processing (after
term(com.goldencode.trpl.BaseState) ). |
void |
setReadOnly(boolean readOnly)
Set the flag that determines if trees will be loaded for read-only
access.
|
void |
setThreads(int threads)
Set the number of threads in the pool to process trees..
|
void |
term(BaseState state)
Called once per pipeline run, after all tree walkers are processed.
|
private int threads
private boolean autoSave
term(com.goldencode.trpl.BaseState)
.private boolean readOnly
protected java.util.List<WalkElement> walkers
public Pipeline()
public Pipeline(java.util.List<WalkElement> walkers)
walkers
- List of walkers to process as the pipeline.public void init(BaseState state)
This is useful for allocating resources or calculating/initializing any values that should be handled once per pipeline.
state
- Provides the processing state of the current run. However it
is important to note that there is no tree nor current node
defined when this is called.public void term(BaseState state)
This is useful for cleanup or termination processing. For example, this is the common location for clearing or saving any values or state that should be handled once per pipeline.
state
- Provides the processing state of the current run. However it
is important to note that there is no tree nor current node
defined when this is called.public java.util.List<WalkElement> getWalkers()
null
if no walk
elements are configured.public int getThreads()
public void setThreads(int threads)
threads
- The number of threads.public boolean isAutoSave()
term(com.goldencode.trpl.BaseState)
).public void setAutoSave(boolean autoSave)
term(com.goldencode.trpl.BaseState)
).autoSave
- The auto-save flag.public boolean isReadOnly()
true
, no changes will be saved.public void setReadOnly(boolean readOnly)
true
, no changes will be saved.readOnly
- The read-only flag.