Search code examples
cachingjboss-cache

JBossCache evict() versus removeNode()


Reading JBossCache documentation, there are different policies for eviction

JBoss Cache also ships with RemoveOnEvictActionPolicy, which calls Cache.removeNode() for each node that needs to be evicted, instead of Cache.evict().

I've checked the documentation and API but can't figure out the difference between the two.

Does anyone know such a difference?


Solution

  • Looking at the RemoveNodeCommand() and EvictCommand()...

    removeNode() removes the node and the nodes children if it has any.

    evict() removes the data from a node but does not remove children. Only if the node is a leaf does it remove the node as well.

    (version 3.1.0.GA)