Package org.chenile.owiz.impl
Class Chain<InputType>
java.lang.Object
org.chenile.owiz.impl.CommandBase<InputType>
org.chenile.owiz.impl.Chain<InputType>
- All Implemented Interfaces:
AttachableCommand<InputType>
,BypassableCommand<InputType>
,Command<InputType>
,OrchestrationAware<InputType>
- Direct Known Subclasses:
FilterChain
,ForLoop
,ParallelChain
public class Chain<InputType>
extends CommandBase<InputType>
implements Command<InputType>, AttachableCommand<InputType>
A chain is a command that executes a chain of other commands.
-
Field Summary
Modifier and TypeFieldDescriptionprotected Set<OrderedCommandDesc>
protected int
static final String
Fields inherited from class org.chenile.owiz.impl.CommandBase
commandDescriptor, orchConfigurator
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
attachCommand
(AttachmentDescriptor<InputType> attachmentDescriptor, CommandDescriptor<InputType> command) Allow a command to attach itself to this chain.protected void
obtainExecutionCommands
(InputType context) Obtain the list of commands that needs to be actually executed.protected boolean
shouldStopChain
(InputType context) AN extension point to allow sub classes to stop a chain if a condition is satisfied.Methods inherited from class org.chenile.owiz.impl.CommandBase
bypass, execute, getConfigValue, getId, getParentId, obtainCommand, postprocess, preprocess, setCommandDescriptor, setOrchConfigurator
-
Field Details
-
INDEX
- See Also:
-
commandDescSet
-
currentIndex
protected int currentIndex
-
-
Constructor Details
-
Chain
public Chain()
-
-
Method Details
-
doExecute
- Specified by:
doExecute
in classCommandBase<InputType>
- Throws:
Exception
-
shouldStopChain
AN extension point to allow sub classes to stop a chain if a condition is satisfied.- Parameters:
context
- containing the data required.- Returns:
- false by default.
- Throws:
Exception
- .
-
attachCommand
public void attachCommand(AttachmentDescriptor<InputType> attachmentDescriptor, CommandDescriptor<InputType> command) Allow a command to attach itself to this chain. If the index is not specified then the attachment order defines the execution order. Else if index is explicitly specified then the execution order would be the ascending order of the index.- Specified by:
attachCommand
in interfaceAttachableCommand<InputType>
-
obtainExecutionCommands
Obtain the list of commands that needs to be actually executed. ConsidersInterpolationCommand
- these commands are supposed to emit out the actual commands that need to be executed.- Parameters:
context
- - the context that was passed- Returns:
- - the set of commands applicable for that context
-