I am developping a web app with JCS 1.3 caching.
I need to edit the DiskPath of the Indexed Disk Auxiliary Cache at runtime from a JVM property.
Do you know a way to do this ?
I managed to create the AuxiliaryCache object but I don't know how to connect it with all my regions defined in cache.ccf.
Here is the code creating the disk cache :
IndexedDiskCacheAttributes indexedCacheAttr = new IndexedDiskCacheAttributes();
indexedCacheAttr.setMaxKeySize(10000);
indexedCacheAttr.setMaxRecycleBinSize(10000);
indexedCacheAttr.setMaxPurgatorySize(10000);
indexedCacheAttr.setOptimizeAtRemoveCount(5000);
String cacheDir = System.getProperty("xxxxx");
if (cacheDir == null || cacheDir.trim().length() == 0) {
log.error("error:JCSManager xxxx.");
} else {
indexedCacheAttr.setDiskPath(cacheDir);
}
IndexedDiskCacheManager indexedCacheManager =
IndexedDiskCacheManager.getInstance(indexedCacheAttr);
// instance du cache disque
AuxiliaryCache auxCache = indexedCacheManager.getCache(region);
To get a region I use the following :
JCS cache = JCS.getInstance(region);
An idea please ?