类 DegradeRuleManager
java.lang.Object
com.alibaba.csp.sentinel.slots.block.degrade.DegradeRuleManager
The rule manager for circuit breaking rules (
DegradeRule).- 作者:
- youji.zj, jialiang.linjl, Eric Zhao
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static List<DegradeRule>getRules()Get existing circuit breaking rules.static Set<DegradeRule>getRulesOfResource(String resource) static booleanstatic booleanisValidRule(DegradeRule rule) static voidloadRules(List<DegradeRule> rules) LoadDegradeRules, former rules will be replaced.static voidregister2Property(SentinelProperty<List<DegradeRule>> property) Listen to theSentinelPropertyforDegradeRules.static booleansetRulesForResource(String resourceName, Set<DegradeRule> rules) Set degrade rules for provided resource.
-
构造器详细资料
-
DegradeRuleManager
public DegradeRuleManager()
-
-
方法详细资料
-
register2Property
Listen to theSentinelPropertyforDegradeRules. The property is the source ofDegradeRules. Degrade rules can also be set byloadRules(List)directly.- 参数:
property- the property to listen.
-
hasConfig
-
getRules
Get existing circuit breaking rules.
Note: DO NOT modify the rules from the returned list directly. The behavior is undefined.
- 返回:
- list of existing circuit breaking rules, or empty list if no rules were loaded
-
getRulesOfResource
-
loadRules
LoadDegradeRules, former rules will be replaced.- 参数:
rules- new rules to load.
-
setRulesForResource
Set degrade rules for provided resource. Former rules of the resource will be replaced.- 参数:
resourceName- valid resource namerules- new rule set to load- 返回:
- whether the rules has actually been updated
- 从以下版本开始:
- 1.5.0
-
isValidRule
-