01: /*
02: * Copyright (c) 2006 Your Corporation. All Rights Reserved.
03: */
04:
05: package com.technoetic.xplanner.db;
06:
07: import java.util.Arrays;
08: import java.util.Collections;
09: import java.util.List;
10: import java.util.Map;
11:
12: import com.technoetic.xplanner.domain.Person;
13:
14: /**
15: * User: mprokopowicz
16: * Date: Mar 31, 2006
17: * Time: 4:03:21 PM
18: */
19: public class CacheInvalidateForPersonAnywhereInAttrListInterceptor
20: extends MethodCacheInvalidateInterceptor {
21:
22: public CacheInvalidateForPersonAnywhereInAttrListInterceptor(
23: Map cacheMap) {
24: super (cacheMap);
25: }
26:
27: public List getMethodCacheKey(Object args[]) {
28: for (int i = 0; i < args.length; i++) {
29: Object arg = args[i];
30: if (arg instanceof Person) {
31: return Arrays.asList(new Object[] { new Integer(
32: ((Person) arg).getId()) });
33: }
34: }
35: return Collections.EMPTY_LIST;
36: }
37: }
|