[SHL-174] Add ability to denote Commands that have multiple steps Created: 18/Mar/15 Updated: 19/Mar/15
|Remaining Estimate:||Not Specified|
|Time Spent:||Not Specified|
|Original Estimate:||Not Specified|
Spring Shell provides intercepting the lifecycle of the command being invoked through the ExecutionProcessor interface.
The interface defines three lifecycle events that can be intercepted:
I'm interested in hooking into the afterReturningInvocation to provide "step logic" - potentially allowing user or system input to execute additional logic based on the result of the initial command result (and/or each step result).
The custom ExecutionProcessor would need to identify which commands are denoted as multi-step - I would suggest a new custom annotation (e.g. @CliStepIndicator) on the command method, which would be available on the ParseResult invocationContext instance passed into the processor methods.
The step logic would be configurable to determine if there are more steps to execute, configure each step in preparation of execution, execute the step, and handle each step execution's result (e.g. logging to the shell), if any.
It should also ensure that the commands original/final result is handled correctly.
An example scenario would be a command that provides links to "next" and "previous" result sets, and for those links to be followed and their step execution results logged to the console.
|Comment by Robin Howlett [ 19/Mar/15 ]|
Created pull request SHL-174: Multi-Step Commands #67