Changeset 805

Show
Ignore:
Timestamp:
08/13/07 17:15:37 (1 year ago)
Author:
mikey
Message:

added net.stubbles.util.cache.stubXJConfCacheStrategy

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/cache

    • Property svn:ignore changed from
      *.cache
      users.csv
      default
      to
      *.cache
      users.csv
      default
      xjconf
  • trunk/config/xml/cache.xml

    r742 r805  
    99      <defaultStrategy ttl="86400" maxSize="-1" gcProbability="1" /> 
    1010    </fileContainer> 
     11    <fileContainer id="xjconf"> 
     12      <cfg:stubConfig name="cacheDirectory" method="getCachePath" /> 
     13      <xjConfStrategy maxSize="-1" gcProbability="1"> 
     14        <cfg:stubConfig name="configDirectory" method="getConfigPath" append="/xml" /> 
     15      </xjConfStrategy> 
     16    </fileContainer> 
    1117  </cache> 
    1218</xj:configuration> 
  • trunk/src/main/resources/xjconf/cache.xml

    r742 r805  
    22<defines> 
    33  <namespace uri="http://stubbles.net/util/cache"> 
    4     <tag name="cache" type="net.stubbles.util.cache.stubCache" /> 
    5     <abstractTag name="container" abstractType="net.stubbles.util.cache.stubCacheContainer" setter="addContainer" concreteTypeAttribute="type"> 
    6       <constructor> 
    7         <attribute name="id" type="string" /> 
    8       </constructor> 
    9     </abstractTag> 
    10     <tag name="fileContainer" type="net.stubbles.util.cache.stubFileCacheContainer" setter="addContainer"> 
    11       <constructor> 
    12         <attribute name="id" type="string" /> 
    13       </constructor> 
    14     </tag> 
    15     <tag name="cacheDirectory" type="string" /> 
    16     <abstractTag name="strategy" abstractType="net.stubbles.util.cache.stubCacheStrategy" setter="setStrategy" concreteTypeAttribute="type" /> 
    17     <tag name="defaultStrategy" type="net.stubbles.util.cache.stubDefaultCacheStrategy" setter="setStrategy"> 
    18       <constructor> 
    19         <attribute name="ttl" type="int" /> 
    20         <attribute name="maxSize" type="int" /> 
    21         <attribute name="gcProbability" type="int" /> 
    22       </constructor> 
    23     </tag> 
     4    <tag name="cache" type="net.stubbles.util.cache.stubCache" /> 
     5    <abstractTag name="container" abstractType="net.stubbles.util.cache.stubCacheContainer" setter="addContainer" concreteTypeAttribute="type"> 
     6      <constructor> 
     7        <attribute name="id" type="string" /> 
     8      </constructor> 
     9    </abstractTag> 
     10    <tag name="fileContainer" type="net.stubbles.util.cache.stubFileCacheContainer" setter="addContainer"> 
     11      <constructor> 
     12        <attribute name="id" type="string" /> 
     13      </constructor> 
     14    </tag> 
     15    <tag name="cacheDirectory" type="string" /> 
     16    <abstractTag name="strategy" abstractType="net.stubbles.util.cache.stubCacheStrategy" setter="setStrategy" concreteTypeAttribute="type" /> 
     17    <tag name="defaultStrategy" type="net.stubbles.util.cache.stubDefaultCacheStrategy" setter="setStrategy"> 
     18      <constructor> 
     19        <attribute name="ttl" type="int" /> 
     20        <attribute name="maxSize" type="int" /> 
     21        <attribute name="gcProbability" type="int" /> 
     22      </constructor> 
     23    </tag> 
     24    <tag name="xjConfStrategy" type="net.stubbles.util.cache.stubXJConfCacheStrategy" setter="setStrategy"> 
     25      <constructor> 
     26        <attribute name="maxSize" type="int" /> 
     27        <attribute name="gcProbability" type="int" /> 
     28      </constructor> 
     29      <tag name="configDirectory" type="string" /> 
     30    </tag> 
    2431  </namespace> 
    2532</defines> 
  • trunk/src/test/php/net/stubbles/integration/CacheTestCase.php

    r742 r805  
    2626        $cacheContainer = stubCache::factory('default'); 
    2727        $this->assertIsA($cacheContainer, 'stubFileCacheContainer'); 
     28        $this->assertTrue(stubCache::has('xjconf')); 
     29        $cacheContainer = stubCache::factory('xjconf'); 
     30        $this->assertIsA($cacheContainer, 'stubFileCacheContainer'); 
    2831    } 
    2932} 
  • trunk/src/test/php/net/stubbles/util/UtilTestSuite.php

    r780 r805  
    3131        $this->addTestFile($dir . '/cache/stubAbstractCacheContainerTestCase.php'); 
    3232        $this->addTestFile($dir . '/cache/stubFileCacheContainerTestCase.php'); 
     33        $this->addTestFile($dir . '/cache/stubXJConfCacheStrategyTestCase.php'); 
    3334 
    3435        // datespan