1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.hr.core.cache;
17
18
19 import org.kuali.hr.core.KPMEConstants;
20 import org.kuali.hr.time.service.base.TkServiceLocator;
21 import org.kuali.rice.core.api.resourceloader.GlobalResourceLoader;
22 import org.kuali.rice.core.impl.cache.DistributedCacheManagerDecorator;
23
24 import java.util.List;
25
26 public class CacheUtils {
27 public static void flushCache(String cacheName) {
28
29 DistributedCacheManagerDecorator distributedCacheManagerDecorator =
30 TkServiceLocator.getDistributedCacheManager();
31 distributedCacheManagerDecorator.getCache(cacheName).clear();
32 }
33
34 public static void flushCaches(List<String> cacheNames) {
35
36 DistributedCacheManagerDecorator distributedCacheManagerDecorator =
37 TkServiceLocator.getDistributedCacheManager();
38 for (String cache : cacheNames) {
39 distributedCacheManagerDecorator.getCache(cache).clear();
40 }
41 }
42 }