public interface

ConfigurableEnvironment

implements ConfigurablePropertyResolver Environment
org.springframework.core.env.ConfigurableEnvironment
Known Indirect Subclasses

Class Overview

Configuration interface to be implemented by most if not all Environments. Provides facilities for setting active and default profiles as well as accessing the property sources.

Summary

Public Methods
abstract MutablePropertySources getPropertySources()
Return the PropertySources for this environment in mutable form
abstract Map<StringObject> getSystemEnvironment()
Return the value of getenv() if allowed by the current SecurityManager, otherwise return a map implementation that will attempt to access individual keys using calls to getenv(String).
abstract Map<StringObject> getSystemProperties()
Return the value of getProperties() if allowed by the current SecurityManager, otherwise return a map implementation that will attempt to access individual keys using calls to getProperty(String).
abstract void setActiveProfiles(String... profiles)
Specify the set of profiles active for this Environment.
abstract void setDefaultProfiles(String... profiles)
Specify the set of profiles to be made active by default if no other profiles are explicitly made active through setActiveProfiles(String...).
[Expand]
Inherited Methods
From interface org.springframework.core.env.ConfigurablePropertyResolver
From interface org.springframework.core.env.Environment
From interface org.springframework.core.env.PropertyResolver

Public Methods

public abstract MutablePropertySources getPropertySources ()

Also: SpringCore

Return the PropertySources for this environment in mutable form

public abstract Map<StringObject> getSystemEnvironment ()

Also: SpringCore

Return the value of getenv() if allowed by the current SecurityManager, otherwise return a map implementation that will attempt to access individual keys using calls to getenv(String).

Note that most Environment implementations will include this system environment map as a default PropertySource to be searched. Therefore, it is recommended that this method not be used directly unless bypassing other property sources is expressly intended.

Calls to get(Object) on the Map returned will never throw IllegalAccessException; in cases where the SecurityManager forbids access to a property, null will be returned and an INFO-level log message will be issued noting the exception.

public abstract Map<StringObject> getSystemProperties ()

Also: SpringCore

Return the value of getProperties() if allowed by the current SecurityManager, otherwise return a map implementation that will attempt to access individual keys using calls to getProperty(String).

Note that most Environment implementations will include this system properties map as a default PropertySource to be searched. Therefore, it is recommended that this method not be used directly unless bypassing other property sources is expressly intended.

Calls to get(Object) on the Map returned will never throw IllegalAccessException; in cases where the SecurityManager forbids access to a property, null will be returned and an INFO-level log message will be issued noting the exception.

public abstract void setActiveProfiles (String... profiles)

Also: SpringCore

Specify the set of profiles active for this Environment. Profiles are evaluated during container bootstrap to determine whether bean definitions should be registered with the container.

public abstract void setDefaultProfiles (String... profiles)

Also: SpringCore

Specify the set of profiles to be made active by default if no other profiles are explicitly made active through setActiveProfiles(String...).