类 FlowRuleManager

java.lang.Object
com.alibaba.csp.sentinel.slots.block.flow.FlowRuleManager

public class FlowRuleManager extends Object

One resources can have multiple rules. And these rules take effects in the following order:

  1. requests from specified caller
  2. no specified caller

作者:
jialiang.linjl, Eric Zhao, Weihua
  • 构造器详细资料

    • FlowRuleManager

      public FlowRuleManager()
  • 方法详细资料

    • register2Property

      public static void register2Property(SentinelProperty<List<FlowRule>> property)
      Listen to the SentinelProperty for FlowRules. The property is the source of FlowRules. Flow rules can also be set by loadRules(List) directly.
      参数:
      property - the property to listen.
    • getRules

      public static List<FlowRule> getRules()
      Get a copy of the rules.
      返回:
      a new copy of the rules.
    • loadRules

      public static void loadRules(List<FlowRule> rules)
      Load FlowRules, former rules will be replaced.
      参数:
      rules - new rules to load.
    • hasConfig

      public static boolean hasConfig(String resource)
    • isOtherOrigin

      public static boolean isOtherOrigin(String origin, String resourceName)