public class SimpleEnvironmentVariablesProvider extends Object implements EnvironmentVariablesProvider
Environment
only if includeCurrentEnvironment is set to true (default). The
environmentProperties
option provides the ability to override any specific
values on an as needed basis.Constructor and Description |
---|
SimpleEnvironmentVariablesProvider(org.springframework.core.env.Environment environment) |
Modifier and Type | Method and Description |
---|---|
Map<String,String> |
getEnvironmentVariables(org.springframework.batch.item.ExecutionContext executionContext)
Provides a
Map of Strings to be used as environment variables. |
void |
setEnvironmentProperties(Map<String,String> environmentProperties) |
void |
setIncludeCurrentEnvironment(boolean includeCurrentEnvironment)
Establishes if current environment variables will be included as a part of the
provider.
|
public SimpleEnvironmentVariablesProvider(org.springframework.core.env.Environment environment)
environment
- The Environment
for this contextpublic void setEnvironmentProperties(Map<String,String> environmentProperties)
environmentProperties
- a Map
of properties used to override any
values configured in the current Environment
public void setIncludeCurrentEnvironment(boolean includeCurrentEnvironment)
includeCurrentEnvironment
- true(default) include local environment
properties. False do not include current environment properties.public Map<String,String> getEnvironmentVariables(org.springframework.batch.item.ExecutionContext executionContext)
EnvironmentVariablesProvider
Map
of Strings to be used as environment variables. This method
will be called for each worker step. For example, if there are 5 partitions, this
method will be called 5 times.getEnvironmentVariables
in interface EnvironmentVariablesProvider
executionContext
- the ExecutionContext
associated with the worker's
stepMap
of values to be used as environment variablesCopyright © 2021 Pivotal Software, Inc.. All rights reserved.