org.springframework.shell.core
Class SimpleExecutionStrategy

java.lang.Object
  extended by org.springframework.shell.core.SimpleExecutionStrategy
All Implemented Interfaces:
ExecutionStrategy

public class SimpleExecutionStrategy
extends Object
implements ExecutionStrategy

Simple execution strategy for invoking a target method. Supports pre/post processing to allow CommandMarkers for aop-like behavior ( typically used for controlling stateful objects).


Constructor Summary
SimpleExecutionStrategy()
           
 
Method Summary
 Object execute(ParseResult parseResult)
          Executes the method indicated by the ParseResult.
 boolean isReadyForCommands()
          Indicates commands are able to be presented.
 void terminate()
          Indicates the execution runtime should be terminated.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleExecutionStrategy

public SimpleExecutionStrategy()
Method Detail

execute

public Object execute(ParseResult parseResult)
               throws RuntimeException
Description copied from interface: ExecutionStrategy
Executes the method indicated by the ParseResult.

Specified by:
execute in interface ExecutionStrategy
Parameters:
parseResult - that should be executed (never presented as null)
Returns:
an object which will be rendered by the Shell implementation (may return null)
Throws:
RuntimeException - which is handled by the Shell implementation

isReadyForCommands

public boolean isReadyForCommands()
Description copied from interface: ExecutionStrategy
Indicates commands are able to be presented. This generally means all important system startup activities have completed.

Specified by:
isReadyForCommands in interface ExecutionStrategy
Returns:
whether commands can be presented for processing at this time

terminate

public void terminate()
Description copied from interface: ExecutionStrategy
Indicates the execution runtime should be terminated. This allows it to cleanup before returning control flow to the caller. Necessary for clean shutdowns.

Specified by:
terminate in interface ExecutionStrategy