类 DefaultGovernanceRuleRepositoryImpl
- java.lang.Object
-
- org.apache.dubbo.rpc.cluster.governance.DefaultGovernanceRuleRepositoryImpl
-
- 所有已实现的接口:
GovernanceRuleRepository
public class DefaultGovernanceRuleRepositoryImpl extends Object implements GovernanceRuleRepository
-
-
字段概要
-
从接口继承的字段 org.apache.dubbo.rpc.cluster.governance.GovernanceRuleRepository
DEFAULT_GROUP
-
-
构造器概要
构造器 构造器 说明 DefaultGovernanceRuleRepositoryImpl()
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
addListener(String key, String group, ConfigurationListener listener)
Register a configuration listener for a specified key The listener only works for service governance purpose, so the target group would always be the value user specifies at startup or 'dubbo' by default.String
getRule(String key, String group, long timeout)
Get the governance rule mapped to the given key and the given group.void
removeListener(String key, String group, ConfigurationListener listener)
Stops one listener from listening to value changes in the specified key.-
从接口继承的方法 org.apache.dubbo.rpc.cluster.governance.GovernanceRuleRepository
addListener, getRule, removeListener
-
-
-
-
方法详细资料
-
addListener
public void addListener(String key, String group, ConfigurationListener listener)
从接口复制的说明:GovernanceRuleRepository
Register a configuration listener for a specified key The listener only works for service governance purpose, so the target group would always be the value user specifies at startup or 'dubbo' by default. This method will only register listener, which means it will not trigger a notification that contains the current value.- 指定者:
addListener
在接口中GovernanceRuleRepository
- 参数:
key
- the key to represent a configurationgroup
- the group where the key belongs tolistener
- configuration listener
-
removeListener
public void removeListener(String key, String group, ConfigurationListener listener)
从接口复制的说明:GovernanceRuleRepository
Stops one listener from listening to value changes in the specified key.- 指定者:
removeListener
在接口中GovernanceRuleRepository
- 参数:
key
- the key to represent a configurationgroup
- the group where the key belongs tolistener
- configuration listener
-
getRule
public String getRule(String key, String group, long timeout) throws IllegalStateException
从接口复制的说明:GovernanceRuleRepository
Get the governance rule mapped to the given key and the given group. If the rule fails to return after timeout exceeds, IllegalStateException will be thrown.- 指定者:
getRule
在接口中GovernanceRuleRepository
- 参数:
key
- the key to represent a configurationgroup
- the group where the key belongs totimeout
- timeout value for fetching the target config- 返回:
- target configuration mapped to the given key and the given group, IllegalStateException will be thrown if timeout exceeds.
- 抛出:
IllegalStateException
-
-