info.magnolia.commands
Class DelegateCommand
java.lang.Object
info.magnolia.commands.DelegateCommand
- All Implemented Interfaces:
- Command
public class DelegateCommand
- extends Object
- implements Command
Delegate to an other command at runtime.
Method Summary |
DelegateCommand |
copy(Command command)
This method allows to create new copy of a command, so the instances in
the CommandManager's catalogs are masters, and the execution always uses
new instance created by this method.
NOTE: If your command uses default parameters (set from a JCR property),
you MUST override this method to copy the values from the master command
to the actually used copy. |
boolean |
execute(Context ctx)
|
String |
getCommandName()
|
void |
setCommandName(String commandName)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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)
copy
public DelegateCommand copy(Command command)
- Description copied from interface:
Command
- This method allows to create new copy of a command, so the instances in
the CommandManager's catalogs are masters, and the execution always uses
new instance created by this method.
NOTE: If your command uses default parameters (set from a JCR property),
you MUST override this method to copy the values from the master command
to the actually used copy.
- Specified by:
copy
in interface Command
Copyright © 2003-2013 Magnolia International Ltd.. All Rights Reserved.