Interface ApplicationContextConfiguration

All Superinterfaces:
BeanContextConfiguration
All Known Implementing Classes:
DefaultApplicationContextBuilder, Micronaut

public interface ApplicationContextConfiguration extends BeanContextConfiguration
An interface for configuring an application context.
Since:
1.0
Author:
Zachary Klein, graemerocher
  • Method Details

    • getContextConfigurer

      default Optional<ApplicationContextConfigurer> getContextConfigurer()
      Returns:
      The context configurer.
      Since:
      4.5.0
    • getEnvironments

      @NonNull @NonNull List<String> getEnvironments()
      Returns:
      The environment names
    • getDeduceEnvironments

      default Optional<Boolean> getDeduceEnvironments()
      If set to true (the default is true) 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 to true 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

      default List<String> 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

      @Nullable default @Nullable List<String> getEnvironmentVariableIncludes()
      Returns:
      The environment variables to include in configuration
    • getEnvironmentVariableExcludes

      @Nullable default @Nullable List<String> getEnvironmentVariableExcludes()
      Returns:
      The environment variables to exclude from configuration
    • getConversionService

      default Optional<MutableConversionService> getConversionService()
      The optional conversion service to use.
      Returns:
      The conversion service
    • getResourceLoader

      @NonNull default @NonNull ClassPathResourceLoader getResourceLoader()
      The class path resource loader to use.
      Returns:
      The classpath resource loader
    • getOverrideConfigLocations

      @Nullable default @Nullable List<String> 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

      @Nullable default @Nullable Boolean isBootstrapEnvironmentEnabled()