title: Java Caching System(JCS) - Create regions programmatically
body: <p>We are planning to use some caching mechanism in our application, and chosen Java Caching System(JCS) after performing comparison study among many other caching solutions. Every thing is fine when  I use external configuration (cache.ccf) to define cache regions and its properties( like maxlife, ideltime, etc). </p>
  
  <p>But the requirement is changed to have dynamic cache regions, that is we would need to define cache regions and its properties at run time. I am not able to find more details or samples regarding this operation. 
  I successfully created cache regions at run time ( using below method signature).</p>
  
  <pre><code>ICompositeCacheAttributes  cattr=..
  IElementAttributes attr = new ElementAttributes();
  attr.setIsEternal(false);
  attr.setMaxLifeSeconds( maxLife );    
  defineRegion(name,  cattr,attr);
  </code></pre>
  
  <p>But the problem is, IElmentAttributes   does not sets to the cache.  I did research on source of JCS and found <code>attr</code> is never set. It is non used argument!! bit strange</p>
  
  <p>After some more googling, I found below options to set the attributes manually, but still did not work </p>
  
  <pre><code> IElementAttributes attr = new ElementAttributes();
   attr.setIsEternal(false);
   attr.setMaxLifeSeconds( maxLife );
   jcs.setDefaultElementAttributes(attr);
  </code></pre>
  
  <p>All I want is to set maxLifeSeconds for created regions.</p>