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 | 0 | { |
27 | 0 | this.invocation = invocation; |
28 | 0 | } |
29 | |
|
30 | |
public Object execute() throws MuleException |
31 | |
{ |
32 | |
try |
33 | |
{ |
34 | 0 | result = invocation.proceed(); |
35 | 0 | return result; |
36 | |
} |
37 | 0 | catch (MuleException e) |
38 | |
{ |
39 | 0 | throw e; |
40 | |
} |
41 | 0 | catch (Throwable e) |
42 | |
{ |
43 | 0 | throw new InterceptorException(e); |
44 | |
} |
45 | |
} |
46 | |
|
47 | |
public Object getResult() |
48 | |
{ |
49 | 0 | return result; |
50 | |
} |
51 | |
|
52 | |
} |