[jboss-user] [JBoss Cache: Core Edition] - Re: ExpirationAlgorithm - Eviction Policy

thangamani_r do-not-reply at jboss.com
Tue Feb 24 03:56:11 EST 2009


Hi Manik,
 The javadoc mentions about expiration config being set programatically.

Cache cache;
  |  Fqn fqn1 = Fqn.fromString("/node/1");
  |  Long future = new Long(System.currentTimeMillis() + 2000);
  |  cache.put(fqn1, ExpirationConfiguration.EXPIRATION_KEY, future);
  |  cache.put(fqn1, "foo");
  |  assertTrue(cache.get(fqn1) != null);
  |  
  |  Thread.sleep(5000); // 5 seconds
  |  assertTrue(cache.get(fqn1) == null);

I would like to know if it is possible to set it programatically only ?

 or can we set it through the config file. What would be the setting in the config file. Is there any example for the config file setting?

Even the programatic approach as mentioned in the docs does not evict the node..

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

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



More information about the jboss-user mailing list