1 |
| |
2 |
| |
3 |
| |
4 |
| |
5 |
| |
6 |
| |
7 |
| |
8 |
| package org.jboss.cache.pojo.interceptors; |
9 |
| |
10 |
| import org.jboss.aop.joinpoint.Invocation; |
11 |
| import org.jboss.aop.joinpoint.MethodInvocation; |
12 |
| import org.jboss.aop.metadata.SimpleMetaData; |
13 |
| |
14 |
| |
15 |
| |
16 |
| |
17 |
| |
18 |
| |
19 |
| |
20 |
| public class PojoBeginInterceptor extends AbstractInterceptor |
21 |
| { |
22 |
| private static ThreadLocal REPLICATE_FINAL = new ThreadLocal(); |
23 |
| |
24 |
429
| public void setReplicateFinalField(String isTrue)
|
25 |
| { |
26 |
429
| REPLICATE_FINAL.set(Boolean.valueOf(isTrue));
|
27 |
| } |
28 |
| |
29 |
0
| private static void reset()
|
30 |
| { |
31 |
0
| REPLICATE_FINAL.set(Boolean.FALSE);
|
32 |
| } |
33 |
| |
34 |
18860
| public static boolean getReplicateFinalField()
|
35 |
| { |
36 |
8048
| if (REPLICATE_FINAL.get() == null) return false;
|
37 |
| |
38 |
10812
| return (Boolean) REPLICATE_FINAL.get();
|
39 |
| } |
40 |
| |
41 |
25842
| public Object invoke(Invocation in) throws Throwable
|
42 |
| { |
43 |
25842
| if (!(in instanceof MethodInvocation))
|
44 |
| { |
45 |
0
| throw new IllegalArgumentException("BeginInterceptor.invoke(): invocation not MethodInvocation");
|
46 |
| } |
47 |
25842
| MethodInvocation invocation = (MethodInvocation) in;
|
48 |
| |
49 |
25842
| SimpleMetaData simple = new SimpleMetaData();
|
50 |
25842
| invocation.setMetaData(simple);
|
51 |
| |
52 |
25842
| try
|
53 |
| { |
54 |
25842
| log.debug("**** Entering method: **** " + invocation.getMethod());
|
55 |
25842
| return invocation.invokeNext();
|
56 |
| } |
57 |
| finally |
58 |
| { |
59 |
| |
60 |
25842
| log.debug("Leaving method: " + invocation.getMethod());
|
61 |
| } |
62 |
| } |
63 |
| } |