CommandExecutorService (interface)

Provides a mechanism to execute a Command .

API

CommandExecutorService.java
interface CommandExecutorService {
  Bookmark executeCommand(InteractionContextPolicy interactionContextPolicy, Command command)     (1)
  Bookmark executeCommand(InteractionContextPolicy interactionContextPolicy, CommandDto commandDto, CommandOutcomeHandler outcomeHandler)     (2)
  Bookmark executeCommand(Command command)     (3)
  Bookmark executeCommand(CommandDto commandDto, CommandOutcomeHandler outcomeHandler)     (4)
}
1 executeCommand(InteractionContextPolicy, Command)

Executes the specified Command using the required InteractionContextPolicy , updating the Command (or its persistent equivalent) afterwards (for example, setting its Command#getCommandDto() commandDto field.

2 executeCommand(InteractionContextPolicy, CommandDto, CommandOutcomeHandler)

Executes the specified command (represented as a CommandDto using the required InteractionContextPolicy .

3 executeCommand(Command)

As per #executeCommand(InteractionContextPolicy, Command) , with a policy of InteractionContextPolicy#NO_SWITCH no switch .

4 executeCommand(CommandDto, CommandOutcomeHandler)

As per #executeCommand(InteractionContextPolicy, CommandDto, CommandOutcomeHandler) , with a policy of InteractionContextPolicy#NO_SWITCH no switch .

Members

executeCommand(InteractionContextPolicy, Command)

Executes the specified Command using the required InteractionContextPolicy , updating the Command (or its persistent equivalent) afterwards (for example, setting its Command#getCommandDto() commandDto field.

executeCommand(InteractionContextPolicy, CommandDto, CommandOutcomeHandler)

Executes the specified command (represented as a CommandDto using the required InteractionContextPolicy .

THIS METHOD HAS SIGNIFICANT SIDE-EFFECTS. Specifically, the Command of the executing thread (obtained using org.apache.isis.applib.services.iactn.InteractionProvider to obtain the Interaction , and then Interaction#getCommand() to obtain the Command ) will be UPDATED to hold the CommandDto passed in.

Optionally an CommandOutcomeHandler can be provided to process the result. This is used by the persistent implementations to update their respective persistent equivalents of Command .

executeCommand(Command)

As per #executeCommand(InteractionContextPolicy, Command) , with a policy of InteractionContextPolicy#NO_SWITCH no switch .

Note that this method updates the Command as a side-effect.

executeCommand(CommandDto, CommandOutcomeHandler)

As per #executeCommand(InteractionContextPolicy, CommandDto, CommandOutcomeHandler) , with a policy of InteractionContextPolicy#NO_SWITCH no switch .

Note that this method has significant side-effects.

Implementation

The framework provides a default implementation of this service, o.a.i.core.runtimeservices.command.CommandExecutorServiceDefault

Usage

The CommandExecutorService domain service is provides the ability to execute a specified Command, optionally running the command with the identity of the user captured in that Command.