|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.chain.impl.ChainBase
public class ChainBase
Convenience base class for Chain implementations.
| Field Summary | |
|---|---|
protected Command[] |
commands
The list of Commands configured for this Chain, in
the order in which they may delegate processing to the remainder of
the Chain. |
protected boolean |
frozen
Flag indicating whether the configuration of our commands list has been frozen by a call to the execute() method. |
| Fields inherited from interface org.apache.commons.chain.Command |
|---|
CONTINUE_PROCESSING, PROCESSING_COMPLETE |
| Constructor Summary | |
|---|---|
ChainBase()
Construct a Chain with no configured Commands. |
|
ChainBase(java.util.Collection commands)
Construct a Chain configured with the specified
Commands. |
|
ChainBase(Command command)
Construct a Chain configured with the specified
Command. |
|
ChainBase(Command[] commands)
Construct a Chain configured with the specified
Commands. |
|
| Method Summary | |
|---|---|
void |
addCommand(Command command)
See the Chain JavaDoc. |
boolean |
execute(Context context)
See the Chain JavaDoc. |
(package private) Command[] |
getCommands()
Return an array of the configured Commands for this
Chain. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Command[] commands
The list of Commands configured for this Chain, in
the order in which they may delegate processing to the remainder of
the Chain.
protected boolean frozen
Flag indicating whether the configuration of our commands list
has been frozen by a call to the execute() method.
| Constructor Detail |
|---|
public ChainBase()
public ChainBase(Command command)
Construct a Chain configured with the specified
Command.
command - The Command to be configured
java.lang.IllegalArgumentException - if command
is nullpublic ChainBase(Command[] commands)
Construct a Chain configured with the specified
Commands.
commands - The Commands to be configured
java.lang.IllegalArgumentException - if commands,
or one of the individual Command elements,
is nullpublic ChainBase(java.util.Collection commands)
Construct a Chain configured with the specified
Commands.
commands - The Commands to be configured
java.lang.IllegalArgumentException - if commands,
or one of the individual Command elements,
is null| Method Detail |
|---|
public void addCommand(Command command)
Chain JavaDoc.
addCommand in interface Chaincommand - The Command to be added
java.lang.IllegalArgumentException - if command
is null
java.lang.IllegalStateException - if no further configuration is allowed
public boolean execute(Context context)
throws java.lang.Exception
Chain JavaDoc.
execute in interface Chainexecute in interface Commandcontext - 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 Commands
in this Chain but not handled by a postprocess()
method of a Filter
java.lang.IllegalArgumentException - if context
is nullCommand[] getCommands()
Return an array of the configured Commands for this
Chain. This method is package private, and is used only
for the unit tests.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||