Class EnvironmentPropertySource

  • All Implemented Interfaces:
    IntrospectionUtils.PropertySource, IntrospectionUtils.SecurePropertySource

    public class EnvironmentPropertySource
    extends java.lang.Object
    implements IntrospectionUtils.SecurePropertySource
    A 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.
    See Also:
    Digester, Tomcat Configuration Reference System Properties
    • 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait