<?xml version="1.0" encoding="utf-8"?>
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="ehcache.xsd">
<diskStore path="java.io.tmpdir" />
<defaultCache maxElementsInMemory="1000" eternal="false"
timeToIdleSeconds="600" timeToLiveSeconds="600" overflowToDisk="true"
memoryStoreEvictionPolicy="LRU" />

<cache name="aaa" maxElementsInMemory="5000" eternal="false"
timeToLiveSeconds="7200" timeToIdleSeconds="7200" overflowToDisk="true" />
</ehcache>

private static CacheManager cacheManager = null;

private static Cache ehcache = null;
static {
cacheManager = CacheManager.create();
ehcache = cacheManager.getCache("aaa");
}

 

Element element = new Element("shaoer", list);
ehcache.put(element);

......................

 

相关文章:

  • 2021-10-03
  • 2021-12-09
  • 2022-02-04
  • 2022-12-23
  • 2021-12-14
  • 2022-12-23
猜你喜欢
  • 2021-05-19
  • 2021-10-14
  • 2022-01-22
  • 2022-02-01
  • 2021-06-02
  • 2021-12-16
  • 2021-07-27
相关资源
相似解决方案