Search in sources :

Example 1 with SystemPropertyConfigSource

use of fish.payara.nucleus.microprofile.config.source.SystemPropertyConfigSource in project Payara by payara.

the class ConfigProviderResolverImpl method getDefaultSources.

List<ConfigSource> getDefaultSources() {
    LinkedList<ConfigSource> sources = new LinkedList<>();
    String appName = null;
    String moduleName = null;
    ComponentInvocation currentInvocation = invocationManager.getCurrentInvocation();
    if (currentInvocation == null) {
        ApplicationInfo info = getAppInfo(Thread.currentThread().getContextClassLoader());
        if (info != null) {
            appName = info.getName();
            moduleName = appName;
        }
    } else {
        appName = currentInvocation.getAppName();
        moduleName = currentInvocation.getModuleName();
    }
    String serverName = context.getInstanceName();
    String configName = context.getConfigBean().getConfig().getName();
    sources.add(new DomainConfigSource());
    sources.add(new ClusterConfigSource());
    sources.add(new ConfigConfigSource(configName));
    sources.add(new ServerConfigSource(serverName));
    sources.add(new EnvironmentConfigSource());
    sources.add(new SystemPropertyConfigSource());
    sources.add(new JNDIConfigSource());
    sources.add(new PayaraServerProperties());
    sources.add(new SecretsDirConfigSource());
    if (appName != null) {
        sources.add(new ApplicationConfigSource(appName));
        sources.add(new ModuleConfigSource(appName, moduleName));
        for (Properties props : getDeployedApplicationProperties(appName)) {
            sources.add(new PropertiesConfigSource(props, appName));
        }
    }
    return sources;
}
Also used : PropertiesConfigSource(fish.payara.nucleus.microprofile.config.source.PropertiesConfigSource) ComponentInvocation(org.glassfish.api.invocation.ComponentInvocation) ApplicationInfo(org.glassfish.internal.data.ApplicationInfo) ClusterConfigSource(fish.payara.nucleus.microprofile.config.source.ClusterConfigSource) EnvironmentConfigSource(fish.payara.nucleus.microprofile.config.source.EnvironmentConfigSource) PayaraServerProperties(fish.payara.nucleus.microprofile.config.source.PayaraServerProperties) PayaraServerProperties(fish.payara.nucleus.microprofile.config.source.PayaraServerProperties) Properties(java.util.Properties) LinkedList(java.util.LinkedList) ServerConfigSource(fish.payara.nucleus.microprofile.config.source.ServerConfigSource) SystemPropertyConfigSource(fish.payara.nucleus.microprofile.config.source.SystemPropertyConfigSource) ServerConfigSource(fish.payara.nucleus.microprofile.config.source.ServerConfigSource) ConfigSource(org.eclipse.microprofile.config.spi.ConfigSource) ModuleConfigSource(fish.payara.nucleus.microprofile.config.source.ModuleConfigSource) ConfigConfigSource(fish.payara.nucleus.microprofile.config.source.ConfigConfigSource) EnvironmentConfigSource(fish.payara.nucleus.microprofile.config.source.EnvironmentConfigSource) SecretsDirConfigSource(fish.payara.nucleus.microprofile.config.source.SecretsDirConfigSource) ApplicationConfigSource(fish.payara.nucleus.microprofile.config.source.ApplicationConfigSource) ClusterConfigSource(fish.payara.nucleus.microprofile.config.source.ClusterConfigSource) JNDIConfigSource(fish.payara.nucleus.microprofile.config.source.JNDIConfigSource) PropertiesConfigSource(fish.payara.nucleus.microprofile.config.source.PropertiesConfigSource) DomainConfigSource(fish.payara.nucleus.microprofile.config.source.DomainConfigSource) ModuleConfigSource(fish.payara.nucleus.microprofile.config.source.ModuleConfigSource) ConfigConfigSource(fish.payara.nucleus.microprofile.config.source.ConfigConfigSource) DomainConfigSource(fish.payara.nucleus.microprofile.config.source.DomainConfigSource) SystemPropertyConfigSource(fish.payara.nucleus.microprofile.config.source.SystemPropertyConfigSource) SecretsDirConfigSource(fish.payara.nucleus.microprofile.config.source.SecretsDirConfigSource) ApplicationConfigSource(fish.payara.nucleus.microprofile.config.source.ApplicationConfigSource) JNDIConfigSource(fish.payara.nucleus.microprofile.config.source.JNDIConfigSource)

Aggregations

ApplicationConfigSource (fish.payara.nucleus.microprofile.config.source.ApplicationConfigSource)1 ClusterConfigSource (fish.payara.nucleus.microprofile.config.source.ClusterConfigSource)1 ConfigConfigSource (fish.payara.nucleus.microprofile.config.source.ConfigConfigSource)1 DomainConfigSource (fish.payara.nucleus.microprofile.config.source.DomainConfigSource)1 EnvironmentConfigSource (fish.payara.nucleus.microprofile.config.source.EnvironmentConfigSource)1 JNDIConfigSource (fish.payara.nucleus.microprofile.config.source.JNDIConfigSource)1 ModuleConfigSource (fish.payara.nucleus.microprofile.config.source.ModuleConfigSource)1 PayaraServerProperties (fish.payara.nucleus.microprofile.config.source.PayaraServerProperties)1 PropertiesConfigSource (fish.payara.nucleus.microprofile.config.source.PropertiesConfigSource)1 SecretsDirConfigSource (fish.payara.nucleus.microprofile.config.source.SecretsDirConfigSource)1 ServerConfigSource (fish.payara.nucleus.microprofile.config.source.ServerConfigSource)1 SystemPropertyConfigSource (fish.payara.nucleus.microprofile.config.source.SystemPropertyConfigSource)1 LinkedList (java.util.LinkedList)1 Properties (java.util.Properties)1 ConfigSource (org.eclipse.microprofile.config.spi.ConfigSource)1 ComponentInvocation (org.glassfish.api.invocation.ComponentInvocation)1 ApplicationInfo (org.glassfish.internal.data.ApplicationInfo)1