Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
Description
Endpoint properties [1] now support placeholders. These placeholders can be use in other property values to avoid repeating common values.
The general placeholder pattern is ${placeholder.name}
Three types of placeholders shall be separated:
#1 environment placeholders: placeholders for environment variables.
They follow the naming convention ala ANT: ${env.JAVA_HOME} will retrieve the JAVA_HOME env var.
#2 system placeholders: placeholders for system properties
They follow the naming convention: ${system.log4j.configuration} will access the system property "log4j.configuration"
System placeholders might point to environment placeholders.
#3 local placeholders: placeholders defined in one endpoint property file
These do not use any prefixes: ${mytimeout} will be replaced by the value of "mytimeout" placeholder.
Local placeholder values might themselves used the 2 previous placeholders types (env var and sys properties).
mytimeout=${env.TIMEOUT} is valid, and will be replaced by the env variable TIMEOUT.
Local placeholders can be defined in one file, and used in another. If defined twice, the last loaded value will have precedence.
Here are a few examples:
placeholder1=placeholder1-value
test.placeholder1=${placeholder1}
ns-alias.my-service.ode.http.socket.timeout=${system.TestSystemProperty}
ns-alias.my-service.ode.mex.timeout=${env.TEST_DUMMY_ENV_VAR}
See org.apache.ode.utils.HierarchicalPropertiesTest for more.
[1] http://ode.apache.org/user-guide.html#UserGuide-EndpointConfiguration