Class DefaultRateLimiterProvider

java.lang.Object
com.sap.cloud.sdk.cloudplatform.resilience4j.DefaultRateLimiterProvider
All Implemented Interfaces:
GenericDecorator, RateLimiterProvider

public class DefaultRateLimiterProvider extends Object implements RateLimiterProvider, GenericDecorator
Decorates a callable with a rate limiter based on a provided resilience configuration.
  • Constructor Details

    • DefaultRateLimiterProvider

      public DefaultRateLimiterProvider()
  • 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 interface GenericDecorator
      Type Parameters:
      T - The type of the callable.
      Parameters:
      callable - The callable to decorate.
      configuration - The configuration to be used.
      Returns:
      The decorated callable.
    • getRateLimiter

      @Nonnull public io.github.resilience4j.ratelimiter.RateLimiter getRateLimiter(@Nonnull ResilienceConfiguration configuration)
      Description copied from interface: RateLimiterProvider
      Provides a rate limiter.
      Specified by:
      getRateLimiter in interface RateLimiterProvider
      Parameters:
      configuration - The configuration for constructing the rate limiter.
      Returns:
      A rate limiter.