info.magnolia.commands
Class DelegateCommand
java.lang.Object
info.magnolia.commands.DelegateCommand
- All Implemented Interfaces:
- Command, Cloneable
public class DelegateCommand
- extends Object
- implements Command
Delegate to an other command at runtime.
Method Summary |
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 ctx)
|
String |
getCommandName()
|
void |
setCommandName(String commandName)
|
DelegateCommand
@Inject
public DelegateCommand(CommandsManager commandsManager)
execute
public boolean execute(Context ctx)
throws Exception
- Specified by:
execute
in interface Command
- Throws:
Exception
getCommandName
public String getCommandName()
setCommandName
public void setCommandName(String commandName)
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.