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 |
| |
13 |
| |
14 |
| |
15 |
| |
16 |
| |
17 |
| |
18 |
| |
19 |
| public class PojoEventInterceptor extends AbstractInterceptor |
20 |
| { |
21 |
0
| public Object invoke(Invocation in) throws Throwable
|
22 |
| { |
23 |
0
| if (!(in instanceof MethodInvocation))
|
24 |
| { |
25 |
0
| throw new IllegalArgumentException("PojoEventInterceptor.invoke(): invocation not MethodInvocation");
|
26 |
| } |
27 |
0
| MethodInvocation invocation = (MethodInvocation) in;
|
28 |
0
| try
|
29 |
| { |
30 |
0
| System.out.println("**** Entering method: **** " + invocation.getMethod());
|
31 |
0
| return invocation.invokeNext();
|
32 |
| } |
33 |
| finally |
34 |
| { |
35 |
0
| System.out.println("Leaving method: " + invocation.getMethod());
|
36 |
| } |
37 |
| } |
38 |
| } |