[jboss-user] [JBossCache] - cachelistener configuration

confuz do-not-reply at jboss.com
Fri Jul 28 00:12:06 EDT 2006


Hi All,
     How to configure the cache listener in the xml configuration file?

and I tested the POJOCache with 1.4.0.GA use policy and cacheloader like follow

  | <attribute name="EvictionPolicyClass">org.jboss.cache.aop.eviction.AopLRUPolicy</attribute>
  | 
  |       <!-- Specific eviction policy configurations. This is LRU -->
  |       <attribute name="EvictionPolicyConfig">
  |          <config>
  |             <attribute name="wakeUpIntervalSeconds">5</attribute>
  |             <!-- Cache wide default -->
  |             <region name="/_default_">
  |                <attribute name="maxNodes">5000</attribute>
  |                <attribute name="timeToLiveSeconds">1000</attribute>
  |             </region>
  |             <region name="/test">
  |                 <attribute name="maxNodes">500</attribute>
  |                 <attribute name="timeToLiveSeconds">4</attribute>
  |             </region>
  |          </config>
  |       </attribute>
  | 
  | <attribute name="CacheLoaderConfiguration">
  |             <config>
  |                 <passivation>true</passivation>
  |                 <preload></preload>
  | 	 			<shared>false</shared>
  |                 
  |                 <cacheloader>
  |                     <class>org.jboss.cache.loader.jdbm.JdbmCacheLoader</class>
  |                      <properties>
  |                         location=c:/tmp/aop/filetore2
  |                     </properties>
  |                     <async>false</async>
  |                     
  |                     <fetchPersistentState>false</fetchPersistentState>
  |                     <ignoreModifications>false</ignoreModifications>
  |                      <purgeOnStartup>false</purgeOnStartup>
  |                 </cacheloader>
  |                 
  |          </config>
  |     </attribute>
  | 
then i wrote the following test code

  | for(int j = 0; j < 1000; j ++){
  | 				 SamplePojo pojo=new SamplePojo(j, "Hany"+(i*1000+j));
  | 			      pojo.getHobbies().add("Running");
  | 			      pojo.getHobbies().add("Beerathlon");
  | 			      pojo.getHobbies().add("Triathlon");		      
  | 			      cache.putObject("/test/"+(j), pojo);
  | 							}
  | Thread.sleep(6000);
  | 		System.out.println(tester.cache.getObject(Fqn.fromString("/test/3")));
  | 
  | 		
  | 

the last print will be null, why can not retrieve data from cache?

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3961466#3961466

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3961466



More information about the jboss-user mailing list