Package org.kie.api.executor
Interface CommandCallback
-
public interface CommandCallback
CommandCallback represents logic that shall be executed after command invocation. Depending on the result of invocation eitheronCommandDone
oronCommandError
will be called.
Important note about implementations is that it shall always be possible to be initialized with default constructor as executor service is an async component so it will initialize the command on demand using reflection. In case there is a heavy logic on initialization it should be placed in another service implementation that can be looked up from within command.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
onCommandDone(CommandContext ctx, ExecutionResults results)
Executed as soon as command is executed successfully.void
onCommandError(CommandContext ctx, Throwable exception)
Executed only when command failed and all possible retries were already invoked.
-
-
-
Method Detail
-
onCommandDone
void onCommandDone(CommandContext ctx, ExecutionResults results)
Executed as soon as command is executed successfully.- Parameters:
ctx
- - contextual data given by the executor serviceresults
- - result produced by command
-
onCommandError
void onCommandError(CommandContext ctx, Throwable exception)
Executed only when command failed and all possible retries were already invoked. This indicates that executor will not attempt any more execution of given command as part of the request.- Parameters:
ctx
- - contextual data given by the executor serviceexception
- - exception that was thrown on last attempt to execute command
-
-