Class RateLimitFactory

java.lang.Object
com.rale4j.sb.core.RateLimitFactory

@Component public class RateLimitFactory extends Object
Factory class for creating rate limit strategies.
  • Constructor Details

    • RateLimitFactory

      @Autowired public RateLimitFactory(Map<String,RateLimitStrategy> strategies)
      Constructor for RateLimitFactory.
      Parameters:
      strategies - a map of rate limit strategies
  • Method Details

    • getStrategy

      public RateLimitStrategy getStrategy(String name)
      Retrieves a rate limit strategy by name.
      Parameters:
      name - the name of the rate limit strategy
      Returns:
      the rate limit strategy, or a safe fallback strategy