Modifier and Type | Field and Description |
---|---|
protected Command[] |
commands
|
protected boolean |
frozen
Flag indicating whether the configuration of our commands list
has been frozen by a call to the
execute() method. |
CONTINUE_PROCESSING, PROCESSING_COMPLETE
Constructor and Description |
---|
ChainBase()
|
ChainBase(java.util.Collection commands)
|
ChainBase(Command command)
|
ChainBase(Command[] commands)
|
Modifier and Type | Method and Description |
---|---|
void |
addCommand(Command command)
See the
Chain JavaDoc. |
boolean |
execute(Context context)
See the
Chain JavaDoc. |
(package private) Command[] |
getCommands()
|
protected Command[] commands
protected boolean frozen
Flag indicating whether the configuration of our commands list
has been frozen by a call to the execute()
method.
public ChainBase()
public ChainBase(Command command)
command
- The Command
to be configuredjava.lang.IllegalArgumentException
- if command
is null
public ChainBase(Command[] commands)
public void addCommand(Command command)
Chain
JavaDoc.addCommand
in interface Chain
command
- The Command
to be addedjava.lang.IllegalArgumentException
- if command
is null
java.lang.IllegalStateException
- if no further configuration is allowedpublic boolean execute(Context context) throws java.lang.Exception
Chain
JavaDoc.execute
in interface Chain
execute
in interface Command
context
- The Context
to be processed by this
Chain
true
if the processing of this Context
has been completed, or false
if the processing
of this Context
should be delegated to a subsequent
Command
in an enclosing Chain
java.lang.Exception
- if thrown by one of the Command
s
in this Chain
but not handled by a postprocess()
method of a Filter
java.lang.IllegalArgumentException
- if context
is null
Command[] getCommands()