public class Resilience4jDecorationStrategy extends Object implements ResilienceDecorationStrategy
Constructor and Description |
---|
Resilience4jDecorationStrategy() |
Resilience4jDecorationStrategy(TimeLimiterProvider timeLimiterProvider,
BulkheadProvider bulkheadProvider,
CircuitBreakerProvider circuitBreakerProvider,
CachingDecorator cachingDecorator) |
Modifier and Type | Method and Description |
---|---|
<T> Callable<T> |
decorateCallable(Callable<T> callable,
ResilienceConfiguration configuration,
Function<? super Throwable,T> fallbackFunction)
Decorate an instance of a callable function.
|
<T> Callable<T> |
decorateFutureSupplier(Supplier<Future<T>> futureSupplier,
ResilienceConfiguration configuration,
Function<? super Throwable,T> fallbackFunction)
Deprecated.
|
<T> Supplier<T> |
decorateSupplier(Supplier<T> supplier,
ResilienceConfiguration configuration,
Function<? super Throwable,T> fallbackFunction)
Decorate an instance of a supplier function.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
decorateCallable, decorateFutureSupplier, decorateSupplier, executeCallable, executeCallable, executeFutureSupplier, executeFutureSupplier, executeSupplier, executeSupplier, queueCallable, queueSupplier
public Resilience4jDecorationStrategy()
public Resilience4jDecorationStrategy(TimeLimiterProvider timeLimiterProvider, BulkheadProvider bulkheadProvider, CircuitBreakerProvider circuitBreakerProvider, CachingDecorator cachingDecorator)
@Nonnull public <T> Supplier<T> decorateSupplier(@Nonnull Supplier<T> supplier, @Nonnull ResilienceConfiguration configuration, @Nullable Function<? super Throwable,T> fallbackFunction)
decorateSupplier
in interface ResilienceDecorationStrategy
T
- The return type of the call.supplier
- The supplier.configuration
- The configuration of the resilient call.fallbackFunction
- In case of failure, execute this function.@Nonnull public <T> Callable<T> decorateCallable(@Nonnull Callable<T> callable, @Nonnull ResilienceConfiguration configuration, @Nullable Function<? super Throwable,T> fallbackFunction)
decorateCallable
in interface ResilienceDecorationStrategy
T
- The return type of the call.callable
- The callable.configuration
- The configuration of the resilient call.fallbackFunction
- In case of failure, execute this function.@Nonnull @Deprecated public <T> Callable<T> decorateFutureSupplier(@Nonnull Supplier<Future<T>> futureSupplier, @Nonnull ResilienceConfiguration configuration, @Nullable Function<? super Throwable,T> fallbackFunction)
decorateFutureSupplier
in interface ResilienceDecorationStrategy
T
- The return type of the call.futureSupplier
- The supplier of a future.configuration
- The configuration of the resilient call.fallbackFunction
- In case of failure, execute this function.Copyright © 2019 SAP SE. All rights reserved.