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
-
Method Summary
Modifier and TypeMethodDescriptionaddCommand
(CMD command) See theChain
JavaDoc.boolean
See theChain
JavaDoc.boolean
isFrozen()
Returnstrue
, if the configuration of our commands list has been frozen by a call to theexecute()
method,false
otherwise.
-
Constructor Details
-
ChainBase
public ChainBase() -
ChainBase
- Parameters:
command
- TheCommand
to be configured- Throws:
IllegalArgumentException
- ifcommand
isnull
-
ChainBase
- Parameters:
commands
- TheCommand
s to be configured- Throws:
IllegalArgumentException
- ifcommands
, or one of the individualCommand
elements, isnull
-
ChainBase
- Parameters:
commands
- TheCommand
s to be configured- Throws:
IllegalArgumentException
- ifcommands
, or one of the individualCommand
elements, isnull
-
-
Method Details
-
addCommand
See theChain
JavaDoc.- Specified by:
addCommand
in interfaceChain<C extends Context>
- Type Parameters:
CMD
- theCommand
type to be added in theChain
- Parameters:
command
- TheCommand
to be added- Throws:
IllegalArgumentException
- ifcommand
isnull
IllegalStateException
- if no further configuration is allowed
-
execute
See theChain
JavaDoc.- Specified by:
execute
in interfaceChain<C extends Context>
- Specified by:
execute
in interfaceCommand<C extends Context>
- Parameters:
context
- TheContext
to be processed by thisChain
- Returns:
true
if the processing of thisContext
has been completed, orfalse
if the processing of thisContext
should be delegated to a subsequentCommand
in an enclosingChain
- Throws:
Exception
- if thrown by one of theCommand
s in thisChain
but not handled by apostprocess()
method of aFilter
IllegalArgumentException
- ifcontext
isnull
-
isFrozen
Returnstrue
, if the configuration of our commands list has been frozen by a call to theexecute()
method,false
otherwise.- Returns:
true
, if the configuration of our commands list has been frozen by a call to theexecute()
method,false
otherwise.- Since:
- 1.3
-