1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.kew.rule.service.impl;
17
18 import org.kuali.rice.kew.rule.service.RuleDelegationCacheProcessor;
19 import org.kuali.rice.kew.service.KEWServiceLocator;
20 import org.kuali.rice.kew.util.PerformanceLogger;
21
22 public class RuleDelegationCacheProcessorImpl implements RuleDelegationCacheProcessor {
23
24 private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(RuleDelegationCacheProcessorImpl.class);
25
26 public void clearRuleDelegationFromCache(Long responsibilityId) {
27 PerformanceLogger logger = new PerformanceLogger();
28 if (responsibilityId != null) {
29 flushListFromCache(responsibilityId);
30 }
31 logger.log("Time to notify cache of rule delegation change for responsibility id=" + responsibilityId);
32 }
33
34 protected void flushListFromCache(Long responsibilityId) {
35 String responsibilityIdStr = responsibilityId.toString();
36 LOG.info("Flushing delegation rules from Cache for responsibilityId='" + responsibilityIdStr );
37 KEWServiceLocator.getCacheAdministrator().flushEntry(getRuleDlgnCacheKey(responsibilityIdStr));
38 }
39
40 protected String getRuleDlgnCacheKey(String responsibilityIdStr) {
41 return "RuleDlgnCache:" + responsibilityIdStr;
42 }
43
44 }