com.googlecode.jpattern.core.command
Class ICommand

java.lang.Object
  extended by com.googlecode.jpattern.core.command.ICommand
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ACommand, NullCommand

public abstract class ICommand
extends java.lang.Object
implements java.io.Serializable

Author:
Francesco Cina' 28/gen/2011
See Also:
Serialized Form

Constructor Summary
ICommand()
           
 
Method Summary
abstract  ICommandResult exec()
          This method launch the execution of the command (or chain of commands) using the default DefaultCommandExecutor.
abstract  ICommandResult exec(ICommandExecutor aCommandExecutor)
          This method launch the execution of the command (or chain of commands).
abstract  ICommandResult rollback()
          This method launch the rollback of the command (or chain of commands) using the default DefaultCommandExecutor.
abstract  ICommandResult rollback(ICommandExecutor aCommandExecutor)
          This method launch the rollback of the command (or chain of commands).
abstract  ICommandResult rollback(ICommandResult execResult)
          This method launch the rollback of the command (or chain of commands) only if the ICommandExecutor passed as parameter is not valid.
abstract  ICommandResult rollback(ICommandResult execResult, ICommandExecutor aCommandExecutor)
          This method launch the rollback of the command (or chain of commands) only if the ICommandExecutor passed as parameter is not valid.
abstract  void visit(IProvider provider)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ICommand

public ICommand()
Method Detail

visit

public abstract void visit(IProvider provider)

exec

public abstract ICommandResult exec()
This method launch the execution of the command (or chain of commands) using the default DefaultCommandExecutor. This command is the same of: exec(new ConditionalCommandExecutor());

Returns:
the result of the execution

exec

public abstract ICommandResult exec(ICommandExecutor aCommandExecutor)
This method launch the execution of the command (or chain of commands). Every command in the chain will be managed by an ICommandExecutor object

Parameters:
aCommandExecutor - the pool in which the command will runs
Returns:
the result of the execution

rollback

public abstract ICommandResult rollback()
This method launch the rollback of the command (or chain of commands) using the default DefaultCommandExecutor. This command is the same of: rollback(new ConditionalCommandExecutor());

Returns:
the result of the rollback

rollback

public abstract ICommandResult rollback(ICommandExecutor aCommandExecutor)
This method launch the rollback of the command (or chain of commands). Every command in the chain will be managed by an ICommandExecutor object

Parameters:
aCommandExecutor - the pool in which the command will runs
Returns:
the result of the rollback

rollback

public abstract ICommandResult rollback(ICommandResult execResult)
This method launch the rollback of the command (or chain of commands) only if the ICommandExecutor passed as parameter is not valid. The DefaultCommandExecutor will be used This command is the same of: rollback(execResult, new ConditionalCommandExecutor());

Parameters:
execResult - the result of a Command execution
Returns:
the result of the rollback

rollback

public abstract ICommandResult rollback(ICommandResult execResult,
                                        ICommandExecutor aCommandExecutor)
This method launch the rollback of the command (or chain of commands) only if the ICommandExecutor passed as parameter is not valid. The ICommandExecutor passed as a parameter will be used.

Parameters:
execResult - the result of a Command execution
aCommandExecutor - the pool in which the command will runs
Returns:
the result of the rollback


Copyright © 2011. All Rights Reserved.