I almost forgot to tell the main problem:
at the end of the execution of this code, the boolean shouldbefalse is true, revealing that the node isn't evicted from the cache...
Not sure (haven't checked) but I think there might be some step you're missing in activating the region and eviction policy. If you have debug on, you should be seeing some sort of periodic logging indicating it's working.
Thanks for your reply genman.
Indeed, there has to be something i am missing but i cannot see what...(and where...)
The thread in charge of the eviction process doesn't seem to be running, since there is nothing in the log.
So if you (or anyone) has already done this before, please tell me how to do it properly, i would be very grateful!
If you're looking for an example on how to create eviction regions programatically with latest JBoss Cache, I'd suggest you check out EJB3 trunk (http://anonsvn.jboss.org/repos/jbossas/projects/ejb3/trunk/) and have a look to org.jboss.ejb3.cache.tree.StatefulTreeCache where we create an eviction region per EJB programatically.
I cannot find the subpackage /tree in http://anonsvn.jboss.org/repos/jbossas/projects/ejb3/trunk/cache/src/main/java/org/jboss/ejb3/cache/), it seems it doesn't exist... has it been moved? Can you tell me the new location please?
There are other java classes in org.jboss.ejb3.cache, but none seems to deal with eviction policies.
Anyway thank you very much for your help!
Ok i will look at it!