接口 GovernanceRuleRepository

    • 方法详细资料

      • 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 configuration
        group - the group where the key belongs to
        listener - 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 configuration
        group - the group where the key belongs to
        listener - 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 configuration
        group - 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 configuration
        group - the group where the key belongs to
        timeout - 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