Ard Schrijvers wrote:
Yes, this is exactly my point. The extra problem is that the StoreJanitor
never has access to the eviction policy of the cache, and just starts
throwing out entries "at random".

That's incorrect statement. I'd say that StoreJanitor always has access to the eviction policy, with the exception of incorrect cache implementation, such as EHCache:

public class EHDefaultStore implements Store {

    public void free() {
        try {
            final List keys = this.cache.getKeysNoDuplicateCheck();
            if (!keys.isEmpty()) {
                // TODO find a way to get to the LRU one.
                final Serializable key = (Serializable) keys.get(0);


If you were to fix the root of the problem first, many of your other troubles would simply evaporate.

Vadim

Reply via email to