1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
package org.mule.transport.jms.xa; |
8 | |
|
9 | |
import java.lang.reflect.InvocationHandler; |
10 | |
import java.lang.reflect.InvocationTargetException; |
11 | |
import java.lang.reflect.Method; |
12 | |
|
13 | |
public class ConsumerProducerInvocationHandler implements InvocationHandler |
14 | |
{ |
15 | |
|
16 | |
private Object target; |
17 | |
|
18 | |
public ConsumerProducerInvocationHandler(SessionInvocationHandler sessionInvocationHandler, Object target) |
19 | 0 | { |
20 | 0 | this.target = target; |
21 | 0 | } |
22 | |
|
23 | |
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable |
24 | |
{ |
25 | |
try |
26 | |
{ |
27 | 0 | return method.invoke(target, args); |
28 | |
} |
29 | 0 | catch (InvocationTargetException e) |
30 | |
{ |
31 | 0 | throw e.getCause(); |
32 | |
} |
33 | |
} |
34 | |
|
35 | |
} |