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.util.PerformanceLogger; |
20 | |
import org.kuali.rice.ksb.api.KsbApiServiceLocator; |
21 | |
|
22 | 0 | public class RuleDelegationCacheProcessorImpl implements RuleDelegationCacheProcessor { |
23 | |
|
24 | 0 | private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(RuleDelegationCacheProcessorImpl.class); |
25 | |
|
26 | |
public void clearRuleDelegationFromCache(Long responsibilityId) { |
27 | 0 | PerformanceLogger logger = new PerformanceLogger(); |
28 | 0 | if (responsibilityId != null) { |
29 | 0 | flushListFromCache(responsibilityId); |
30 | |
} |
31 | 0 | logger.log("Time to notify cache of rule delegation change for responsibility id=" + responsibilityId); |
32 | 0 | } |
33 | |
|
34 | |
protected void flushListFromCache(Long responsibilityId) { |
35 | 0 | String responsibilityIdStr = responsibilityId.toString(); |
36 | 0 | LOG.info("Flushing delegation rules from Cache for responsibilityId='" + responsibilityIdStr ); |
37 | 0 | KsbApiServiceLocator.getCacheAdministrator().flushEntry(getRuleDlgnCacheKey(responsibilityIdStr)); |
38 | 0 | } |
39 | |
|
40 | |
protected String getRuleDlgnCacheKey(String responsibilityIdStr) { |
41 | 0 | return "RuleDlgnCache:" + responsibilityIdStr; |
42 | |
} |
43 | |
|
44 | |
} |