Interface Configurator

All Superinterfaces:
Comparable<Configurator>
All Known Implementing Classes:
AbsentConfigurator, AbstractConfigurator, OverrideConfigurator

public interface Configurator extends Comparable<Configurator>
Configurator. (SPI, Prototype, ThreadSafe)
  • Method Summary

    Modifier and Type
    Method
    Description
    default int
    Sort by host, then by priority 1. the url with a specific host ip should have higher priority than 0.0.0.0 2. if two url has the same host, compare by priority value;
    org.apache.dubbo.common.URL
    configure(org.apache.dubbo.common.URL url)
    Configure the provider url.
    org.apache.dubbo.common.URL
    Get the configurator url.
    toConfigurators(List<org.apache.dubbo.common.URL> urls)
    Convert override urls to map for use when re-refer.
  • Method Details

    • getUrl

      org.apache.dubbo.common.URL getUrl()
      Get the configurator url.
      Returns:
      configurator url.
    • configure

      org.apache.dubbo.common.URL configure(org.apache.dubbo.common.URL url)
      Configure the provider url.
      Parameters:
      url - - old provider url.
      Returns:
      new provider url.
    • toConfigurators

      static Optional<List<Configurator>> toConfigurators(List<org.apache.dubbo.common.URL> urls)
      Convert override urls to map for use when re-refer. Send all rules every time, the urls will be reassembled and calculated URL contract:
      1. override://0.0.0.0/...( or override://ip:port...?anyhost=true)invalid input: '&para1'=value1... means global rules (all of the providers take effect)
      2. override://ip:port...?anyhost=false Special rules (only for a certain provider)
      3. override:// rule is not supported... ,needs to be calculated by registry itself
      4. override://0.0.0.0/ without parameters means clearing the override
      Parameters:
      urls - URL list to convert
      Returns:
      converted configurator list
    • compareTo

      default int compareTo(Configurator o)
      Sort by host, then by priority 1. the url with a specific host ip should have higher priority than 0.0.0.0 2. if two url has the same host, compare by priority value;
      Specified by:
      compareTo in interface Comparable<Configurator>