Hi,

I'm new to this list. So, hello everybody !



I found in the mail list archives the way how to use several "cache.ccf"
files. The code that does it looks more or less like the one at the
bottom. 

Does anybody know how to make this code read AuxiliaryCache definition ?
Using JCS.getInstance(region, cca) method seems to skip it. It works
when I use JCS.getInstance("SessionCache"). However, in the latter
approach I have to copy my configuration to the cache.ccf that is loaded
first. I would like to avoid this, because I'm using third party library
that contains cache.ccf. So I would like to have my own file.

I'm usign JCS 1.2.7.0. I'm forced to use this version.

Thanks for any hints !
jan




CodeSnippet
-----------
Properties props = new Properties(); 
CompositeCacheAttributes cca = new CompositeCacheAttributes(); 
ElementAttributes eca = new ElementAttributes(); 

InputStream is = ResourceReader.getInputStream("jcs.properties");
 
props.load(is); 
PropertySetter.setProperties(cca, props, "jcs.region." + region +
".cacheattributes.");
PropertySetter.setProperties(eca, props, "jcs.region." + region +
".elementattributes."); 

jcsCache = JCS.getInstance("SessionCache", cca);
jcsCache.setDefaultElementAttributes(eca);



jcs.properties files
--------------------
jcs.region.SessionCache=AuxiliarySessionCache
jcs.region.SessionCache.cacheattributes=org.apache.jcs.engine.CompositeC
acheAttributes
jcs.region.SessionCache.cacheattributes.MaxObjects=25000
jcs.region.SessionCache.cacheattributes.MemoryCacheName=org.apache.jcs.e
ngine.memory.lru.LRUMemoryCache
jcs.region.SessionCache.cacheattributes.UseMemoryShrinker=true
jcs.region.SessionCache.cacheattributes.MaxMemoryIdleTimeSeconds=30
jcs.region.SessionCache.cacheattributes.ShrinkerIntervalSeconds=15

jcs.region.SessionCache.elementattributes.IsEternal=false
jcs.region.SessionCache.elementattributes.MaxLifeSeconds=360000
jcs.region.SessionCache.elementattributes.IdleTime=600
jcs.region.SessionCache.elementattributes.IsSpool=true
jcs.region.SessionCache.elementattributes.IsRemote=false
jcs.region.SessionCache.elementattributes.IsLateral=false

# A simple auxiliary cache
jcs.auxiliary.AuxiliarySessionCache=mypackage.JCSAuxiliarySessionCacheFa
ctory
jcs.auxiliary.AuxiliarySessionCache.attributes=mypackage.JCSAuxiliaryCac
heAttributes

---------------------------------------------------------------------
To unsubscribe, e-mail: jcs-users-unsubscr...@jakarta.apache.org
For additional commands, e-mail: jcs-users-h...@jakarta.apache.org

Reply via email to