Class TreePathDynamicConfiguration

java.lang.Object
org.apache.dubbo.common.config.configcenter.AbstractDynamicConfiguration
org.apache.dubbo.common.config.configcenter.TreePathDynamicConfiguration
All Implemented Interfaces:
AutoCloseable, DynamicConfiguration, Configuration

public abstract class TreePathDynamicConfiguration extends AbstractDynamicConfiguration
An abstract implementation of DynamicConfiguration is like "tree-structure" path :
  • invalid reference
    "file"
  • invalid reference
    "zookeeper"
Since:
2.7.8
See Also:
  • Field Details

    • CONFIG_ROOT_PATH_PARAM_NAME

      public static final String CONFIG_ROOT_PATH_PARAM_NAME
      The parameter name of URL for the config root path
      See Also:
    • CONFIG_BASE_PATH_PARAM_NAME

      public static final String CONFIG_BASE_PATH_PARAM_NAME
      The parameter name of URL for the config base path
      See Also:
    • DEFAULT_CONFIG_BASE_PATH

      public static final String DEFAULT_CONFIG_BASE_PATH
      The default value of parameter of URL for the config base path
      See Also:
  • Constructor Details

    • TreePathDynamicConfiguration

      public TreePathDynamicConfiguration(URL url)
    • TreePathDynamicConfiguration

      public TreePathDynamicConfiguration(String rootPath, String threadPoolPrefixName, int threadPoolSize, long keepAliveTime, String group, long timeout)
  • Method Details

    • publishConfig

      public final boolean publishConfig(String key, String group, String content)
      Description copied from interface: DynamicConfiguration
      Publish Config mapped to the given key and the given group.
      Parameters:
      key - the key to represent a configuration
      group - the group where the key belongs to
      content - the content of configuration
      Returns:
      true if success, or false
    • addListener

      public final void addListener(String key, String group, ConfigurationListener listener)
      Description copied from interface: DynamicConfiguration
      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.
      Specified by:
      addListener in interface DynamicConfiguration
      Overrides:
      addListener in class AbstractDynamicConfiguration
      Parameters:
      key - the key to represent a configuration
      group - the group where the key belongs to
      listener - configuration listener
    • removeListener

      public final void removeListener(String key, String group, ConfigurationListener listener)
      Description copied from interface: DynamicConfiguration
      Stops one listener from listening to value changes in the specified key.
      Specified by:
      removeListener in interface DynamicConfiguration
      Overrides:
      removeListener in class AbstractDynamicConfiguration
      Parameters:
      key - the key to represent a configuration
      group - the group where the key belongs to
      listener - configuration listener