|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.chain.impl.ChainBase
public class ChainBase
Convenience base class for Chain
implementations.
Field Summary | |
---|---|
protected Command[] |
commands
The list of Command s 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 Command s. |
|
ChainBase(Collection commands)
Construct a Chain configured with the specified
Command s. |
|
ChainBase(Command command)
Construct a Chain configured with the specified
Command . |
|
ChainBase(Command[] commands)
Construct a Chain configured with the specified
Command s. |
Method Summary | |
---|---|
void |
addCommand(Command command)
See the Chain JavaDoc. |
boolean |
execute(Context context)
See the Chain JavaDoc. |
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 Command
s 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
IllegalArgumentException
- if command
is null
public ChainBase(Command[] commands)
Construct a Chain
configured with the specified
Command
s.
commands
- The Command
s to be configured
IllegalArgumentException
- if commands
,
or one of the individual Command
elements,
is null
public ChainBase(Collection commands)
Construct a Chain
configured with the specified
Command
s.
commands
- The Command
s to be configured
IllegalArgumentException
- if commands
,
or one of the individual Command
elements,
is null
Method Detail |
---|
public void addCommand(Command command)
Chain
JavaDoc.
addCommand
in interface Chain
command
- The Command
to be added
IllegalArgumentException
- if command
is null
IllegalStateException
- if no further configuration is allowedpublic boolean execute(Context context) throws 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
Exception
- if thrown by one of the Command
s
in this Chain
but not handled by a postprocess()
method of a Filter
IllegalArgumentException
- if context
is null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |