1 package test.crispy.example.interceptor;
2
3 import net.sf.crispy.Interceptor;
4 import net.sf.crispy.InterceptorContext;
5
6 public class TestInterceptor2 implements Interceptor {
7
8 public static final String RESULT = "Result-TestInterceptor2";
9
10 private boolean interruptInvocation = true;
11
12 public TestInterceptor2() { }
13 public TestInterceptor2(boolean pvInterruptInvocation) {
14 interruptInvocation = pvInterruptInvocation;
15 }
16
17 public boolean getInterruptInvocation() { return interruptInvocation; }
18
19
20 public void beforeMethodInvocation(InterceptorContext pvInterceptorContext) {
21 pvInterceptorContext.setResult(RESULT);
22 pvInterceptorContext.setInterruptInvocation(interruptInvocation);
23 }
24
25 public void afterMethodInvocation(InterceptorContext pvInterceptorContext) {}
26 public void onError(Throwable pvThrowable) {}
27 public void beforeNewInstance(Class pvInterfaceClass) { }
28 public void afterNewInstance(Class pvInterfaceClass, Object pvProxyObject) { }
29
30 }