info.magnolia.commands.chain
Class ChainBase
java.lang.Object
info.magnolia.commands.chain.ChainBase
- All Implemented Interfaces:
- Chain, Command, Cloneable
public class ChainBase
- extends Object
- implements Chain
Replacement for org.apache.commons.chain.impl.ChainBase. Base Chain
implementation.
Method Summary |
void |
addCommand(Command command)
|
Command |
clone()
This method allows to create new clone of a command, so the instances in
the CommandManager's catalogs are masters, and the execution always uses
clone created by this method.
NOTE: CommandsManager clone the command instances by standard
Java cloning mechanism. |
boolean |
execute(Context context)
|
List<Command> |
getCommands()
Returns unmodifiable list of commands. |
commands
protected List<Command> commands
frozen
protected boolean frozen
ChainBase
public ChainBase()
ChainBase
public ChainBase(Command command)
ChainBase
public ChainBase(Command... commands)
ChainBase
public ChainBase(Collection<Command> commands)
addCommand
public void addCommand(Command command)
- Specified by:
addCommand
in interface Chain
execute
public boolean execute(Context context)
throws Exception
- Specified by:
execute
in interface Command
- Throws:
Exception
getCommands
public List<Command> getCommands()
- Returns unmodifiable list of commands.
clone
public Command clone()
throws CloneNotSupportedException
- Description copied from interface:
Command
- This method allows to create new clone of a command, so the instances in
the CommandManager's catalogs are masters, and the execution always uses
clone created by this method.
NOTE: CommandsManager clone the command instances by standard
Java cloning mechanism. If deep copy is needed then you have to override
clone method of command.
- Specified by:
clone
in interface Command
- Overrides:
clone
in class Object
- Throws:
CloneNotSupportedException
Copyright © 2003-2014 Magnolia International Ltd.. All Rights Reserved.