OK, eviction policy has this restriction that if you specify the region name from the xml, it needs to be String-based (since there is no way to express Object from xml configuration).
So if you need to evict non-String based fqn, you will have to do it via programmatically yourself. Here is a code snippet that shows you how to do it: | | // ... cache needs to be started first, e.g. | cache_.start(); | | // region name is ignored here. | String xml = "<region name=\"/dummy\">" + | "<attribute name=\"maxNodes\">10000</attribute>" + | "<attribute name=\"timeToLiveSeconds\">4</attribute>" + | "</region>"; | Element element = XmlHelper.stringToElement(xml); | | RegionManager regionManager = cache_.getEvictionRegionManager(); | // Fqn is the region name | Integer ii = new Integer(1); | Fqn fqn = new Fqn(ii); | // create region will also add it to the eviction policy map. | Region region = regionManager.createRegion(fqn, element); | Then | Integer ii = new Integer(1); | Fqn rootfqn = new Fqn(ii); | | Integer in = new Integer(3); | Fqn fqn = new Fqn(rootfqn, in); | cache_.put(fqn, in, in); | will be evicted later. BTW, 1) There is a test case: ProgrammLRUPolicyTest for couple test cases. 2) I am adding this example to the FAQ documentation as well. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3977112#3977112 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3977112 _______________________________________________ jboss-user mailing list [email protected] https://lists.jboss.org/mailman/listinfo/jboss-user
