Module bus.limiter

Interface Provider

All Superinterfaces:
org.miaixz.bus.core.Provider, Serializable
All Known Implementing Classes:
FallbackProvider, MethodProvider, RequestProvider

public interface Provider extends org.miaixz.bus.core.Provider
Defines the contract for a limiter provider, which is responsible for executing limiting rules. This interface extends Provider and specifies methods for retrieving the limiting strategy and processing method invocations under limiting rules.
Since:
Java 17+
Author:
Kimi Liu
  • Method Summary

    Modifier and Type
    Method
    Description
    get()
    Retrieves the limiting strategy associated with this provider.
    process(Object bean, Method method, Object[] args)
    Processes a method invocation according to the limiting rules defined by this provider.
    default Object
    Returns the type of this provider, which is EnumValue.Povider.LIMITER.
  • Method Details

    • get

      Retrieves the limiting strategy associated with this provider.
      Returns:
      The StrategyMode representing the limiting strategy.
    • process

      Object process(Object bean, Method method, Object[] args)
      Processes a method invocation according to the limiting rules defined by this provider. This method is typically called before the actual method execution to apply rate limiting, circuit breaking, or other control mechanisms.
      Parameters:
      bean - The target object on which the method is invoked.
      method - The Method being invoked.
      args - The arguments passed to the method invocation.
      Returns:
      The result of the method invocation after applying limiting rules, or a fallback value.
    • type

      default Object type()
      Returns the type of this provider, which is EnumValue.Povider.LIMITER.
      Specified by:
      type in interface org.miaixz.bus.core.Provider
      Returns:
      The provider type.