
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.netflix.hystrix.strategy.executionhook.HystrixCommandExecutionHook
public abstract class HystrixCommandExecutionHook
Abstract ExecutionHook with invocations at different lifecycle points of HystrixCommand execution with default no-op implementations.
See HystrixPlugins or the Hystrix GitHub Wiki for information on configuring plugins: https://github.com/Netflix/Hystrix/wiki/Plugins.
Note on thread-safety and performance
A single implementation of this class will be used globally so methods on this class will be invoked concurrently from multiple threads so all functionality must be thread-safe.
Methods are also invoked synchronously and will add to execution time of the commands so all behavior should be fast. If anything time-consuming is to be done it should be spawned asynchronously onto separate worker threads.
| Constructor Summary | |
|---|---|
HystrixCommandExecutionHook()
|
|
| Method Summary | ||
|---|---|---|
|
onComplete(HystrixCommand<T> commandInstance,
T response)
Invoked after completion of HystrixCommand execution that results in a response. |
|
|
onError(HystrixCommand<T> commandInstance,
HystrixRuntimeException.FailureType failureType,
java.lang.Exception e)
Invoked after failed completion of HystrixCommand execution. |
|
|
onFallbackError(HystrixCommand<T> commandInstance,
java.lang.Exception e)
Invoked after failed execution of HystrixCommand.getFallback() with thrown exception. |
|
|
onFallbackStart(HystrixCommand<T> commandInstance)
Invoked before HystrixCommand.getFallback() is about to be executed. |
|
|
onFallbackSuccess(HystrixCommand<T> commandInstance,
T fallbackResponse)
Invoked after successful execution of HystrixCommand.getFallback() with response value. |
|
|
onRunError(HystrixCommand<T> commandInstance,
java.lang.Exception e)
Invoked after failed execution of HystrixCommand.run() with thrown Exception. |
|
|
onRunStart(HystrixCommand<T> commandInstance)
Invoked before HystrixCommand.run() is about to be executed. |
|
|
onRunSuccess(HystrixCommand<T> commandInstance,
T response)
Invoked after successful execution of HystrixCommand.run() with response value. |
|
|
onStart(HystrixCommand<T> commandInstance)
Invoked before HystrixCommand executes. |
|
|
onThreadComplete(HystrixCommand<T> commandInstance)
Invoked at completion of thread execution when HystrixCommand is executed using HystrixCommandProperties.ExecutionIsolationStrategy.THREAD. |
|
|
onThreadStart(HystrixCommand<T> commandInstance)
Invoked at start of thread execution when HystrixCommand is executed using HystrixCommandProperties.ExecutionIsolationStrategy.THREAD. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HystrixCommandExecutionHook()
| Method Detail |
|---|
public <T> void onRunStart(HystrixCommand<T> commandInstance)
HystrixCommand.run() is about to be executed.
commandInstance - The executing HystrixCommand instance.
public <T> T onRunSuccess(HystrixCommand<T> commandInstance,
T response)
HystrixCommand.run() with response value.
commandInstance - The executing HystrixCommand instance.response - from HystrixCommand.run()
public <T> java.lang.Exception onRunError(HystrixCommand<T> commandInstance,
java.lang.Exception e)
HystrixCommand.run() with thrown Exception.
commandInstance - The executing HystrixCommand instance.e - Exception thrown by HystrixCommand.run()
public <T> void onFallbackStart(HystrixCommand<T> commandInstance)
HystrixCommand.getFallback() is about to be executed.
commandInstance - The executing HystrixCommand instance.
public <T> T onFallbackSuccess(HystrixCommand<T> commandInstance,
T fallbackResponse)
HystrixCommand.getFallback() with response value.
commandInstance - The executing HystrixCommand instance.fallbackResponse - from HystrixCommand.getFallback()
public <T> java.lang.Exception onFallbackError(HystrixCommand<T> commandInstance,
java.lang.Exception e)
HystrixCommand.getFallback() with thrown exception.
commandInstance - The executing HystrixCommand instance.e - Exception thrown by HystrixCommand.getFallback()
public <T> void onStart(HystrixCommand<T> commandInstance)
HystrixCommand executes.
commandInstance - The executing HystrixCommand instance.
public <T> T onComplete(HystrixCommand<T> commandInstance,
T response)
HystrixCommand execution that results in a response.
The response can come either from HystrixCommand.run() or HystrixCommand.getFallback().
commandInstance - The executing HystrixCommand instance.response - from HystrixCommand.run() or HystrixCommand.getFallback().
public <T> java.lang.Exception onError(HystrixCommand<T> commandInstance,
HystrixRuntimeException.FailureType failureType,
java.lang.Exception e)
HystrixCommand execution.
commandInstance - The executing HystrixCommand instance.failureType - HystrixRuntimeException.FailureType representing the type of failure that occurred.
See HystrixRuntimeException for more information.
e - Exception thrown by HystrixCommand
public <T> void onThreadStart(HystrixCommand<T> commandInstance)
HystrixCommand is executed using HystrixCommandProperties.ExecutionIsolationStrategy.THREAD.
commandInstance - The executing HystrixCommand instance.public <T> void onThreadComplete(HystrixCommand<T> commandInstance)
HystrixCommand is executed using HystrixCommandProperties.ExecutionIsolationStrategy.THREAD.
commandInstance - The executing HystrixCommand instance.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||