Package org.apache.commons.chain.impl
Class ChainBase<C extends Context>
java.lang.Object
org.apache.commons.chain.impl.ChainBase<C>
- Type Parameters:
C- Type of the context associated with this chain
Convenience base class for
Chain implementations.- Version:
- $Revision$ $Date$
- Author:
- Craig R. McClanahan
-
Field Summary
Fields inherited from interface org.apache.commons.chain.Command
CONTINUE_PROCESSING, PROCESSING_COMPLETE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddCommand(CMD command) See theChainJavaDoc.booleanSee theChainJavaDoc.booleanisFrozen()Returnstrue, if the configuration of our commands list has been frozen by a call to theexecute()method,falseotherwise.
-
Constructor Details
-
ChainBase
public ChainBase() -
ChainBase
- Parameters:
command- TheCommandto be configured- Throws:
IllegalArgumentException- ifcommandisnull
-
ChainBase
- Parameters:
commands- TheCommands to be configured- Throws:
IllegalArgumentException- ifcommands, or one of the individualCommandelements, isnull
-
ChainBase
- Parameters:
commands- TheCommands to be configured- Throws:
IllegalArgumentException- ifcommands, or one of the individualCommandelements, isnull
-
-
Method Details
-
addCommand
See theChainJavaDoc.- Specified by:
addCommandin interfaceChain<C extends Context>- Type Parameters:
CMD- theCommandtype to be added in theChain- Parameters:
command- TheCommandto be added- Throws:
IllegalArgumentException- ifcommandisnullIllegalStateException- if no further configuration is allowed
-
execute
See theChainJavaDoc.- Specified by:
executein interfaceChain<C extends Context>- Specified by:
executein interfaceCommand<C extends Context>- Parameters:
context- TheContextto be processed by thisChain- Returns:
trueif the processing of thisContexthas been completed, orfalseif the processing of thisContextshould be delegated to a subsequentCommandin an enclosingChain- Throws:
Exception- if thrown by one of theCommands in thisChainbut not handled by apostprocess()method of aFilterIllegalArgumentException- ifcontextisnull
-
isFrozen
Returnstrue, if the configuration of our commands list has been frozen by a call to theexecute()method,falseotherwise.- Returns:
true, if the configuration of our commands list has been frozen by a call to theexecute()method,falseotherwise.- Since:
- 1.3
-