Package org.apache.tomcat.util.digester
Class EnvironmentPropertySource
- java.lang.Object
-
- org.apache.tomcat.util.digester.EnvironmentPropertySource
-
- All Implemented Interfaces:
IntrospectionUtils.PropertySource
,IntrospectionUtils.SecurePropertySource
public class EnvironmentPropertySource extends java.lang.Object implements IntrospectionUtils.SecurePropertySource
AIntrospectionUtils.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>
echo "org.apache.tomcat.util.digester.PROPERTY_SOURCE=org.apache.tomcat.util.digester.EnvironmentPropertySource" >> conf/catalina.properties
CATALINA_OPTS
-Dorg.apache.tomcat.util.digester.PROPERTY_SOURCE=org.apache.tomcat.util.digester.EnvironmentPropertySource
-
-
Constructor Summary
Constructors Constructor Description EnvironmentPropertySource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getProperty(java.lang.String key)
java.lang.String
getProperty(java.lang.String key, java.lang.ClassLoader classLoader)
Obtain a property value, checking that code associated with the provided class loader has permission to access the property.
-
-
-
Method Detail
-
getProperty
public java.lang.String getProperty(java.lang.String key)
- Specified by:
getProperty
in interfaceIntrospectionUtils.PropertySource
-
getProperty
public java.lang.String getProperty(java.lang.String key, java.lang.ClassLoader classLoader)
Description copied from interface:IntrospectionUtils.SecurePropertySource
Obtain a property value, checking that code associated with the provided class loader has permission to access the property. If theclassLoader
isnull
or ifclassLoader
does not implementPermissionCheck
then the property value will be looked up without a call toPermissionCheck.check(java.security.Permission)
- Specified by:
getProperty
in interfaceIntrospectionUtils.SecurePropertySource
- Parameters:
key
- The key of the requested propertyclassLoader
- The class loader associated with the code that trigger the property lookup- Returns:
- The property value or
null
if it could not be found or ifPermissionCheck.check(java.security.Permission)
fails
-
-