R- the return type of actual method
public class ReturnStaticValueHandler<R> extends Object implements BreakHandler<R>
BreakHandlerthat always returns the value given as a parameter.
This implementation can be shared between different executions of circuit breaker and therefore does not require
factory method implementing
BreakHandlerFactory to be reusable.
|Constructor and Description|
|Modifier and Type||Method and Description|
Handles situation when break occurs.
public ReturnStaticValueHandler(R returnValue)
public R onBreak(ContextAwareCircuitBreaker<R> circuitBreaker, Task<R> task, BreakStrategy<R> breakStrategy, ExecutionContext<R> executionContext)
circuitBreaker- a reference to the
ContextAwareCircuitBreakerwhich called this break handler
task- the task which execution was prevented by break strategy and resulted in calling this break handler
breakStrategy- the strategy which prevented the execution of task and resulted in calling this break handler
executionContext- contains current execution data (specific to current execution)
Copyright © 2017. All rights reserved.