Author: dkulp
Date: Fri Jun 8 18:21:27 2012
New Revision: 1348175
URL: http://svn.apache.org/viewvc?rev=1348175&view=rev
Log:
Merged revisions 1347763 via git cherry-pick from
https://svn.apache.org/repos/asf/cxf/trunk
........
r1347763 | dkulp | 2012-06-07 15:26:00 -0400 (Thu, 07 Jun 2012) | 4 lines
Use configuration from the ehcache config to create the caches
Since the token caches are per-endpoint, use smaller maxes for the heap
to avoid exploding the memory usage.
........
Modified:
cxf/branches/2.5.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/cache/EHCacheReplayCache.java
cxf/branches/2.5.x-fixes/rt/ws/security/src/main/resources/cxf-ehcache.xml
Modified:
cxf/branches/2.5.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/cache/EHCacheReplayCache.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/cache/EHCacheReplayCache.java?rev=1348175&r1=1348174&r2=1348175&view=diff
==============================================================================
---
cxf/branches/2.5.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/cache/EHCacheReplayCache.java
(original)
+++
cxf/branches/2.5.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/cache/EHCacheReplayCache.java
Fri Jun 8 18:21:27 2012
@@ -26,6 +26,7 @@ import net.sf.ehcache.Cache;
import net.sf.ehcache.CacheManager;
import net.sf.ehcache.Ehcache;
import net.sf.ehcache.Element;
+import net.sf.ehcache.config.CacheConfiguration;
import org.apache.cxf.Bus;
import org.apache.cxf.buslifecycle.BusLifeCycleListener;
@@ -52,7 +53,9 @@ public class EHCacheReplayCache implemen
}
cacheManager = EHCacheManagerHolder.getCacheManager(bus,
configFileURL);
- Ehcache newCache = new Cache(key, 50000, true, false, DEFAULT_TTL,
DEFAULT_TTL);
+ CacheConfiguration cc =
EHCacheManagerHolder.getCacheConfiguration(key, cacheManager);
+
+ Ehcache newCache = new Cache(cc);
cache = cacheManager.addCacheIfAbsent(newCache);
}
Modified:
cxf/branches/2.5.x-fixes/rt/ws/security/src/main/resources/cxf-ehcache.xml
URL:
http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/ws/security/src/main/resources/cxf-ehcache.xml?rev=1348175&r1=1348174&r2=1348175&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/ws/security/src/main/resources/cxf-ehcache.xml
(original)
+++ cxf/branches/2.5.x-fixes/rt/ws/security/src/main/resources/cxf-ehcache.xml
Fri Jun 8 18:21:27 2012
@@ -3,7 +3,7 @@
<diskStore path="java.io.tmpdir"/>
<defaultCache
- maxElementsInMemory="50000"
+ maxEntriesLocalHeap="5000"
eternal="false"
timeToIdleSeconds="3600"
timeToLiveSeconds="3600"
@@ -13,4 +13,5 @@
diskExpiryThreadIntervalSeconds="120"
memoryStoreEvictionPolicy="LRU"
/>
+
</ehcache>