java.lang.Object
org.miaixz.bus.limiter.metric.StrategyManager
Manages and provides access to different limiting strategy implementations. This class acts as a registry for
Provider instances, mapping each StrategyMode to its corresponding provider responsible for executing
that strategy.- Since:
- Java 17+
- Author:
- Kimi Liu
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidAdds aProviderto the strategy manager.static Providerget(StrategyMode strategyMode) Retrieves theProviderresponsible for executing a specificStrategyMode.
-
Constructor Details
-
StrategyManager
public StrategyManager()
-
-
Method Details
-
add
Adds aProviderto the strategy manager. The provider is registered under its associatedStrategyMode.- Parameters:
provider- TheProviderinstance to be added.
-
get
Retrieves theProviderresponsible for executing a specificStrategyMode.- Parameters:
strategyMode- TheStrategyModefor which to retrieve the provider.- Returns:
- The
Providerinstance associated with the given strategy mode, ornullif not found.
-