public class EnvironmentPropertySource extends Object implements IntrospectionUtils.SecurePropertySource
IntrospectionUtils.SecurePropertySource
that uses environment variables to resolve expressions.
Usage example:
Configure the certificate with environment variables.
<SSLHostConfig>
<Certificate certificateKeyFile="${CERTIFICATE_KEY_FILE}"
certificateFile="${CERTIFICATE_FILE}"
certificateChainFile="${CERTIFICATE_CHAIN_FILE}"
type="RSA" />
</SSLHostConfig>
How to configure:
echo "org.apache.tomcat.util.digester.PROPERTY_SOURCE=org.apache.tomcat.util.digester.EnvironmentPropertySource" >> conf/catalina.properties
or add this to CATALINA_OPTS
-Dorg.apache.tomcat.util.digester.PROPERTY_SOURCE=org.apache.tomcat.util.digester.EnvironmentPropertySource
NOTE: When configured the PropertySource for resolving expressions
from system properties is still active.Constructor and Description |
---|
EnvironmentPropertySource() |
Modifier and Type | Method and Description |
---|---|
String |
getProperty(String key) |
String |
getProperty(String key,
ClassLoader classLoader)
Obtain a property value, checking that code associated with the
provided class loader has permission to access the property.
|
public String getProperty(String key)
getProperty
in interface IntrospectionUtils.PropertySource
public String getProperty(String key, ClassLoader classLoader)
IntrospectionUtils.SecurePropertySource
classLoader
is null
or if classLoader
does
not implement PermissionCheck
then the property value will be
looked up without a call to
PermissionCheck.check(java.security.Permission)
getProperty
in interface IntrospectionUtils.SecurePropertySource
key
- The key of the requested propertyclassLoader
- The class loader associated with the code that
trigger the property lookupnull
if it could not be found
or if PermissionCheck.check(java.security.Permission)
failsCopyright © 2000-2021 Apache Software Foundation. All Rights Reserved.