[SHL-174] Add ability to denote Commands that have multiple steps Created: 18/Mar/15  Updated: 19/Mar/15

Status: Open
Project: Spring Shell
Component/s: None
Affects Version/s: 1.1.0
Fix Version/s: None

Type: New Feature Priority: Minor
Reporter: Robin Howlett Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

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:

  • before a command has been invoked
  • after an invocation has been returned
  • after an exception was thrown

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.



 Comments   
Comment by Robin Howlett [ 19/Mar/15 ]

Created pull request SHL-174: Multi-Step Commands #67

Generated at Wed Jun 19 02:57:53 UTC 2019 using JIRA 7.9.2#79002-sha1:3bb15b68ecd99a30eb364c4c1a393359bcad6278.