Search in sources :

Example 1 with GlobalConfigImpl

use of com.tencent.polaris.factory.config.global.GlobalConfigImpl in project polaris-java by polarismesh.

the class ConfigurationImpl method setDefault.

@Override
public void setDefault(Object defaultObject) {
    if (null == global) {
        global = new GlobalConfigImpl();
    }
    if (null == consumer) {
        consumer = new ConsumerConfigImpl();
    }
    if (null == provider) {
        provider = new ProviderConfigImpl();
    }
    if (null == configFile) {
        configFile = new ConfigFileConfigImpl();
    }
    if (null != defaultObject) {
        Configuration configuration = (Configuration) defaultObject;
        global.setDefault(configuration.getGlobal());
        consumer.setDefault(configuration.getConsumer());
        provider.setDefault(configuration.getProvider());
        configFile.setDefault(configuration.getConfigFile());
    }
}
Also used : ConfigFileConfigImpl(com.tencent.polaris.factory.config.configuration.ConfigFileConfigImpl) Configuration(com.tencent.polaris.api.config.Configuration) GlobalConfigImpl(com.tencent.polaris.factory.config.global.GlobalConfigImpl) ConsumerConfigImpl(com.tencent.polaris.factory.config.consumer.ConsumerConfigImpl) ProviderConfigImpl(com.tencent.polaris.factory.config.provider.ProviderConfigImpl)

Aggregations

Configuration (com.tencent.polaris.api.config.Configuration)1 ConfigFileConfigImpl (com.tencent.polaris.factory.config.configuration.ConfigFileConfigImpl)1 ConsumerConfigImpl (com.tencent.polaris.factory.config.consumer.ConsumerConfigImpl)1 GlobalConfigImpl (com.tencent.polaris.factory.config.global.GlobalConfigImpl)1 ProviderConfigImpl (com.tencent.polaris.factory.config.provider.ProviderConfigImpl)1