1
2
3
4
5
6
7
8
9
10
11 package org.mule.module.spring.interceptor;
12
13 import org.mule.api.MuleException;
14 import org.mule.interceptor.RequestContextInvocation;
15 import org.mule.interceptor.InterceptorException;
16
17 import org.aopalliance.intercept.MethodInvocation;
18
19 public class InvocationAdapter extends RequestContextInvocation
20 {
21
22 private MethodInvocation invocation;
23 private Object result;
24
25 public InvocationAdapter(MethodInvocation invocation)
26 {
27 this.invocation = invocation;
28 }
29
30 public Object execute() throws MuleException
31 {
32 try
33 {
34 result = invocation.proceed();
35 return result;
36 }
37 catch (MuleException e)
38 {
39 throw e;
40 }
41 catch (Throwable e)
42 {
43 throw new InterceptorException(e);
44 }
45 }
46
47 public Object getResult()
48 {
49 return result;
50 }
51
52 }