[jboss-user] [JBoss Cache: Core Edition] - ExpirationPolicy not working

krishnan366 do-not-reply at jboss.com
Fri Apr 24 08:45:33 EDT 2009


Hi ,
 I am setting up expirationalgorithm in my code as follows 



  | long timeout = 60*1000;
  | Long expTime = new Long(System.currentTimeMillis()+timeout);
  |  ExpirationAlgorithmConfig expirationConfiguration = new ExpirationAlgorithmConfig();
  | 	      expirationConfiguration.setTimeToLive(1000);
  | 	      expirationConfiguration.setExpirationKeyName("expiryTime");
  | 	      
  | 	      EvictionConfig ec = new EvictionConfig();
  | 	      List<EvictionRegionConfig> ercs = new ArrayList<EvictionRegionConfig>();
  | 	      
  | 	      
  | 	      keyNode.put(ExpirationAlgorithmConfig.EXPIRATION_KEY, expTime);
  | 	      EvictionRegionConfig erc = new EvictionRegionConfig(keyNode.getFqn(), expirationConfiguration);
  | 	      
  | 	      ercs.add(erc);
  | 	      ec.setEvictionRegionConfigs(ercs);
  | 	      objCache.getConfiguration().setEvictionConfig(ec);
  | 

1) On setting this , I expect eviction to run after a minute on this node, but it does not .

2) I do not have any settings in my config file for eviction. I do have a Cacheloader setup in my config file. On eviction , will the node get expired and be removed from cacheloader as well ? 

>From the log files 



EvictionRegionConfig{regionFqn=/data/key109, eventQueueSize=null, evictionAlgorithmConfig=ExpirationAlgorithmConfig{expirationKeyName='expiryTime', warnNoExpirationKey=true, timeToLive=1000, maxNodes=-1, minTTL=-1}, evictionActionPolicyClassName='null'}

Is there anything else I am missing for the eviction to run?

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

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



More information about the jboss-user mailing list