Reputation: 1447
Is it possible to inject some properties in ehcache.xml?
For example I have different property files, each belonging to an environment:
my_project_name.local.properties
my_project_name.test.properties
my_project_name.int.properties
my_project_name.prod.properties
each of them containing properties for a different environment.
I'd like to inject in ehcache.xml the property maxByteslocalHeap
as following:
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="ehcache.xsd"
updateCheck="false" monitoring="autodetect"
maxBytesLocalHeap="${my_project.cache.maxBytesLocalHeap}">
.....
</ehcache>
my_project.cache.maxBytesLocalHeap
is defined in each property file shown above and has different values according to the environment where my application is running.
Upvotes: 2
Views: 2911
Reputation: 14500
The short answer is no, across all existing Ehcache version at this time (latest 2.10.2 and 3.1.3).
The long answer to your question depends on the Ehcache version:
${my.prop}
.${my.prop}
. Note that it means with your example, you will not be able to substitute sizing information because the XSD enforces that the value is a strictly positive number. The latest limitation listed here could be lifted - the development team was just not sure it was worth the effort. So if this is something you believe Ehcache should provide, please drop a mail on the ehcache-users google group.
Upvotes: 4