How to implement Self Populating EHcache?

前端 未结 2 839
野性不改
野性不改 2020-12-20 06:50

Could you please give me the steps to implement SelfPouplatingEhcache.

Regards, Raju

2条回答
  •  Happy的楠姐
    2020-12-20 07:44

    SelfPopulatingCache cacheStatus = new SelfPopulatingCache(ehcache, new CacheEntryFactory() {
            @Override
            public Object createEntry(Object key) throws Exception {
                if (key.toString().equals(FLAG1)) {
                     return true;
                } else if (key.toString().equals(FLAG2)) {
                    return false;
                }
                return null;
            }
         });
    

提交回复
热议问题