Class DefaultTimeLimiterProvider
java.lang.Object
com.sap.cloud.sdk.cloudplatform.resilience4j.DefaultTimeLimiterProvider
- All Implemented Interfaces:
GenericDecorator
,TimeLimiterProvider
public class DefaultTimeLimiterProvider
extends Object
implements TimeLimiterProvider, GenericDecorator
Decorates a callable with a time limiter based on a provided resilience configuration.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<T> Callable<T>
decorateCallable
(Callable<T> callable, ResilienceConfiguration configuration) Decorates the given callable to enable a resilient property.io.github.resilience4j.timelimiter.TimeLimiter
getTimeLimiter
(ResilienceConfiguration configuration) Provides a time limiter.
-
Constructor Details
-
DefaultTimeLimiterProvider
public DefaultTimeLimiterProvider()
-
-
Method Details
-
decorateCallable
@Nonnull public <T> Callable<T> decorateCallable(@Nonnull Callable<T> callable, @Nonnull ResilienceConfiguration configuration) Description copied from interface:GenericDecorator
Decorates the given callable to enable a resilient property.- Specified by:
decorateCallable
in interfaceGenericDecorator
- Type Parameters:
T
- The type of the callable.- Parameters:
callable
- The callable to decorate.configuration
- The configuration to be used.- Returns:
- The decorated callable.
-
getTimeLimiter
@Nonnull public io.github.resilience4j.timelimiter.TimeLimiter getTimeLimiter(@Nonnull ResilienceConfiguration configuration) Description copied from interface:TimeLimiterProvider
Provides a time limiter.- Specified by:
getTimeLimiter
in interfaceTimeLimiterProvider
- Parameters:
configuration
- The configuration for constructing the time limiter.- Returns:
- A time limiter.
-