I've been through the forums, wiki, and google, so at last I'm forced to post.
We're setting up a treecache where nodes are created, each with it's own expiration date. Each of these nodes will be leaf-nodes, so there's no problem with expiring a node that has children that aren't ready to expire yet.
There are a few things I've come up against, though, that are giving me headaches with JBoss Cache. The first is that if I create an MBean as in the examples, then that leaves me with no way to get a reference programmatically to the actual TreeCache instance object. I'm looking for that in order to get to the "org.jboss.cache.eviction.RegionManager", so when we add a new node, we can dynamically set its eviction policy.
I've been pointed again and again to this little gem in the TreeCache documentation in section 6.2:
// note this is just to show that a running TreeCache instance must be // retrieved somehow. How it is implemented is up to the implementer. TreeCache cache = getRunningTreeCacheInstance();
In JBossCache 1.4 and earlier, the cache's mbean has an Instance attribute which provides a reference to the instance.