Class AbstractConfig

java.lang.Object
org.apache.dubbo.config.AbstractConfig
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
AbstractMethodConfig, ApplicationConfig, ConfigCenterConfig, MetadataReportConfig, MetricsConfig, ModuleConfig, MonitorConfig, ProtocolConfig, RegistryConfig, SslConfig, TracingConfig

public abstract class AbstractConfig extends Object implements Serializable
Utility methods and public methods for parsing configuration
See Also:
  • Constructor Details

    • AbstractConfig

      public AbstractConfig()
    • AbstractConfig

      public AbstractConfig(ScopeModel scopeModel)
  • Method Details

    • getTagName

      public static String getTagName(Class<?> cls)
    • getPluralTagName

      public static String getPluralTagName(Class<?> cls)
    • appendParameters

      public static void appendParameters(Map<String,String> parameters, Object config)
    • appendParameters

      public static void appendParameters(Map<String,String> parameters, Object config, String prefix)
    • appendAttributes

      public static void appendAttributes(Map<String,String> parameters, Object config)
      Put attributes of specify 'config' into 'parameters' argument
      Parameters:
      parameters -
      config -
    • appendAttributes

      public static void appendAttributes(Map<String,String> parameters, Object config, String prefix)
    • getApplicationModel

      public ApplicationModel getApplicationModel()
    • getScopeModel

      public ScopeModel getScopeModel()
    • setScopeModel

      public final void setScopeModel(ScopeModel scopeModel)
    • getId

      @Parameter(excluded=true) public String getId()
    • setId

      public void setId(String id)
    • getMetaData

      public Map<String,String> getMetaData()

      The new instance of the AbstractConfig subclass should return empty metadata. The purpose is to get the attributes set by the user instead of the default value when the refresh() method handles attribute overrides.

      The default value of the field should be set in the checkDefault() method, which will be called at the end of refresh(), so that it will not affect the behavior of attribute overrides.

      Should be called after Config was fully initialized.

      Notice! This method should include all properties in the returning map, treat @Parameter differently compared to appendParameters?

      // FIXME: this method should be completely replaced by appendParameters? // -- Url parameter may use key, but props override only use property name. So replace it with appendAttributes().
      See Also:
    • getMetaData

      public Map<String,String> getMetaData(String prefix)
    • getPrefixes

      @Parameter(excluded=true, attribute=false) public List<String> getPrefixes()
    • getTypePrefix

      public static String getTypePrefix(Class<? extends AbstractConfig> cls)
    • getConfigMode

      public ConfigMode getConfigMode()
    • overrideWithConfig

      public void overrideWithConfig(AbstractConfig newOne, boolean overrideAll)
    • refresh

      public void refresh()
      Dubbo config property override
    • isRefreshed

      @Parameter(excluded=true, attribute=false) public boolean isRefreshed()
    • isValid

      @Parameter(excluded=true, attribute=false) public boolean isValid()
      FIXME check @Parameter(required=true) and any conditions that need to match.
    • isDefault

      @Parameter(excluded=true, attribute=false) public Boolean isDefault()
    • setDefault

      public void setDefault(Boolean isDefault)
    • isNeedRefresh

      @Parameter(excluded=true, attribute=false) public boolean isNeedRefresh()
    • setNeedRefresh

      public void setNeedRefresh(boolean needRefresh)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object