Package io.micronaut.context
Interface ApplicationContextConfiguration
- All Superinterfaces:
BeanContextConfiguration
- All Known Implementing Classes:
DefaultApplicationContextBuilder
,Micronaut
An interface for configuring an application context.
- Since:
- 1.0
- Author:
- Zachary Klein, graemerocher
-
Method Summary
Modifier and TypeMethodDescriptiondefault Optional<MutableConversionService>
The optional conversion service to use.If set totrue
(the default istrue
) Micronaut will attempt to automatically deduce the environment it is running in using environment variables and/or stack trace inspection.The config locations.default @NonNull ClassPathResourceLoader
The class path resource loader to use.default boolean
The banner is enabled by default.default boolean
If set totrue
Micronaut will attempt to deduce the environment using safe methods like environment variables and the stack trace.default boolean
Whether to load the default set of property sources.default boolean
Methods inherited from interface io.micronaut.context.BeanContextConfiguration
getClassLoader, getEagerInitAnnotated, isAllowEmptyProviders, isEagerInitConfiguration, isEagerInitSingletons
-
Method Details
-
getEnvironments
- Returns:
- The environment names
-
getDeduceEnvironments
If set totrue
(the default istrue
) Micronaut will attempt to automatically deduce the environment it is running in using environment variables and/or stack trace inspection.This method differs from
isDeduceCloudEnvironment()
which controls whether network and/or disk probes are performed to try and automatically establish the Cloud environment.This behaviour controls the automatic activation of, for example, the
Environment.TEST
when running tests.- Returns:
- True if the environments should be deduced
-
isDeduceCloudEnvironment
default boolean isDeduceCloudEnvironment()If set totrue
Micronaut will attempt to deduce the environment using safe methods like environment variables and the stack trace.Enabling this should be done with caution since network probes are required to figure out whether the application is running in certain clouds like GCP.
- Returns:
- True if the environments should be deduced
- Since:
- 4.0.0
-
getDefaultEnvironments
- Returns:
- The default environments to be applied if no other environments are explicitly specified or deduced.
-
isEnableDefaultPropertySources
default boolean isEnableDefaultPropertySources()Whether to load the default set of property sources.- Returns:
- Returns
true
if the default set of property sources should be loaded. - Since:
- 3.7.0
-
isEnvironmentPropertySource
default boolean isEnvironmentPropertySource()- Returns:
- True if environment variables should contribute to configuration
-
getEnvironmentVariableIncludes
- Returns:
- The environment variables to include in configuration
-
getEnvironmentVariableExcludes
- Returns:
- The environment variables to exclude from configuration
-
getConversionService
The optional conversion service to use.- Returns:
- The conversion service
-
getResourceLoader
The class path resource loader to use.- Returns:
- The classpath resource loader
-
getOverrideConfigLocations
The config locations.- Returns:
- The config locations
-
isBannerEnabled
default boolean isBannerEnabled()The banner is enabled by default.- Returns:
- The banner is enabled by default
-
isBootstrapEnvironmentEnabled
-