info.magnolia.commands
Class DelegateCommand

java.lang.Object
  extended by info.magnolia.commands.DelegateCommand
All Implemented Interfaces:
Command, Cloneable

public class DelegateCommand
extends Object
implements Command

Delegate to an other command at runtime.


Field Summary
 
Fields inherited from interface info.magnolia.commands.chain.Command
CONTINUE_PROCESSING, PROCESSING_COMPLETE
 
Constructor Summary
DelegateCommand(CommandsManager commandsManager)
           
 
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)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DelegateCommand

@Inject
public DelegateCommand(CommandsManager commandsManager)
Method Detail

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.