public class EnvironmentVariablesPreProcessor extends VariablePreProcessorImpl
ConfigurationPreProcessor
implementation that supports substitution of system properties
before configuration is un-marshalled.
This ConfigurationPreProcessor can be activated by the setting or appending to the bootstrap property "preProcessors" to be environmentVariables and making sure the required jars are available on the classpath.
The following properties can be specified in the bootstrap.properties to control the behaviour of the variable substitution;
Property | Default | Mandatory | Description |
---|---|---|---|
"environment-variables.varprefix" | "${" | No | The value here will be prepended to the system property to search for in the configuration to be switched out. |
"environment-variables.varpostfix" | "}" | No | The value here will be appended to the system property to search for in the configuration to be switched out. |
"environment-variables.impl" | SIMPLE | No | The substitution engine that will perform the variable substitution. defaults to SIMPLE
(Constants.DEFAULT_VAR_SUB_IMPL ). |
preProcessors=environmentVariables
Then all available environment variables (such as COMPUTERNAME
(windows only)), provided they are marked as
${COMPUTERNAME}
) will be replaced within the adapter.xml as it is read in, but before the Adapter itself is
unmarshalled.Constructor and Description |
---|
EnvironmentVariablesPreProcessor(BootstrapProperties bootstrapProperties) |
EnvironmentVariablesPreProcessor(KeyValuePairSet kvps) |
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
expand(java.lang.String xml) |
process, process
getBootstrapProperties, getConfiguration, getProperties, setBootstrapProperties, setConfiguration, setProperties
public EnvironmentVariablesPreProcessor(BootstrapProperties bootstrapProperties)
public EnvironmentVariablesPreProcessor(KeyValuePairSet kvps)
protected java.lang.String expand(java.lang.String xml) throws CoreException
expand
in class VariablePreProcessorImpl
CoreException