接口 GovernanceRuleRepository
-
- 所有已知实现类:
DefaultGovernanceRuleRepositoryImpl
@SPI("default") public interface GovernanceRuleRepository
-
-
字段概要
字段 修饰符和类型 字段 说明 static StringDEFAULT_GROUP
-
方法概要
所有方法 实例方法 抽象方法 默认方法 修饰符和类型 方法 说明 voidaddListener(String key, String group, org.apache.dubbo.common.config.configcenter.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.default voidaddListener(String key, org.apache.dubbo.common.config.configcenter.ConfigurationListener listener)default StringgetRule(String key, String group)Get the governance rule mapped to the given key and the given groupStringgetRule(String key, String group, long timeout)Get the governance rule mapped to the given key and the given group.voidremoveListener(String key, String group, org.apache.dubbo.common.config.configcenter.ConfigurationListener listener)Stops one listener from listening to value changes in the specified key.default voidremoveListener(String key, org.apache.dubbo.common.config.configcenter.ConfigurationListener listener)
-
-
-
方法详细资料
-
addListener
default void addListener(String key, org.apache.dubbo.common.config.configcenter.ConfigurationListener listener)
- 参数:
key- the key to represent a configurationlistener- configuration listener
-
removeListener
default void removeListener(String key, org.apache.dubbo.common.config.configcenter.ConfigurationListener listener)
- 参数:
key- the key to represent a configurationlistener- configuration listener
-
addListener
void addListener(String key, String group, org.apache.dubbo.common.config.configcenter.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. This method will only register listener, which means it will not trigger a notification that contains the current value.- 参数:
key- the key to represent a configurationgroup- the group where the key belongs tolistener- configuration listener
-
removeListener
void removeListener(String key, String group, org.apache.dubbo.common.config.configcenter.ConfigurationListener listener)
Stops one listener from listening to value changes in the specified key.- 参数:
key- the key to represent a configurationgroup- the group where the key belongs tolistener- configuration listener
-
getRule
default String getRule(String key, String group)
Get the governance rule mapped to the given key and the given group- 参数:
key- the key to represent a configurationgroup- the group where the key belongs to- 返回:
- target configuration mapped to the given key and the given group
-
getRule
String getRule(String key, String group, long timeout) throws IllegalStateException
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.- 参数:
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
-
-