ehcache.xml 4.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <!--
  2. ~ Hibernate, Relational Persistence for Idiomatic Java
  3. ~
  4. ~ License: GNU Lesser General Public License (LGPL), version 2.1 or later.
  5. ~ See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
  6. -->
  7. <ehcache>
  8. <!-- Sets the path to the directory where cache .data files are created.
  9. If the path is a Java System Property it is replaced by
  10. its value in the running VM.
  11. The following properties are translated:
  12. user.home - User's home directory
  13. user.dir - User's current working directory
  14. java.io.tmpdir - Default temp file path -->
  15. <diskStore path="java.io.tmpdir"/>
  16. <!--Default Cache configuration. These will applied to caches programmatically created through
  17. the CacheManager.
  18. The following attributes are required for defaultCache:
  19. maxInMemory - Sets the maximum number of objects that will be created in memory
  20. eternal - Sets whether elements are eternal. If eternal, timeouts are ignored and the element
  21. is never expired.
  22. timeToIdleSeconds - Sets the time to idle for an element before it expires. Is only used
  23. if the element is not eternal. Idle time is now - last accessed time
  24. timeToLiveSeconds - Sets the time to live for an element before it expires. Is only used
  25. if the element is not eternal. TTL is now - creation time
  26. overflowToDisk - Sets whether elements can overflow to disk when the in-memory cache
  27. has reached the maxInMemory limit.
  28. -->
  29. <defaultCache
  30. maxElementsInMemory="10000"
  31. eternal="false"
  32. timeToIdleSeconds="120"
  33. timeToLiveSeconds="120"
  34. overflowToDisk="true"
  35. />
  36. <!--Predefined caches. Add your cache configuration settings here.
  37. If you do not have a configuration for your cache a WARNING will be issued when the
  38. CacheManager starts
  39. The following attributes are required for defaultCache:
  40. name - Sets the name of the cache. This is used to identify the cache. It must be unique.
  41. maxInMemory - Sets the maximum number of objects that will be created in memory
  42. eternal - Sets whether elements are eternal. If eternal, timeouts are ignored and the element
  43. is never expired.
  44. timeToIdleSeconds - Sets the time to idle for an element before it expires. Is only used
  45. if the element is not eternal. Idle time is now - last accessed time
  46. timeToLiveSeconds - Sets the time to live for an element before it expires. Is only used
  47. if the element is not eternal. TTL is now - creation time
  48. overflowToDisk - Sets whether elements can overflow to disk when the in-memory cache
  49. has reached the maxInMemory limit.
  50. -->
  51. <!-- Sample cache named sampleCache1
  52. This cache contains a maximum in memory of 10000 elements, and will expire
  53. an element if it is idle for more than 5 minutes and lives for more than
  54. 10 minutes.
  55. If there are more than 10000 elements it will overflow to the
  56. disk cache, which in this configuration will go to wherever java.io.tmp is
  57. defined on your system. On a standard Linux system this will be /tmp"
  58. -->
  59. <cache name="sampleCache1"
  60. maxElementsInMemory="10000"
  61. eternal="false"
  62. timeToIdleSeconds="300"
  63. timeToLiveSeconds="600"
  64. overflowToDisk="true"
  65. />
  66. <!-- Sample cache named sampleCache2
  67. This cache contains 1000 elements. Elements will always be held in memory.
  68. They are not expired. -->
  69. <cache name="sampleCache2"
  70. maxElementsInMemory="1000"
  71. eternal="true"
  72. timeToIdleSeconds="0"
  73. timeToLiveSeconds="0"
  74. overflowToDisk="false"
  75. /> -->
  76. <!-- Place configuration for your caches following -->
  77. </ehcache>