1
2
3
4
5
6
7
8
9
10
11 package org.mule.tck.testmodels.mule;
12
13 import org.mule.transaction.lookup.GenericTransactionManagerLookupFactory;
14
15 import java.lang.reflect.InvocationHandler;
16 import java.lang.reflect.Method;
17 import java.lang.reflect.Proxy;
18
19 import javax.transaction.TransactionManager;
20
21
22
23
24 public class TestTransactionManagerFactory extends GenericTransactionManagerLookupFactory
25 {
26 public TransactionManager create() throws Exception
27 {
28 return (TransactionManager) Proxy.newProxyInstance(getClass().getClassLoader(),
29 new Class[] {TransactionManager.class},
30 new InternalInvocationHandler());
31 }
32
33 public void initialise()
34 {
35
36 }
37
38 public class InternalInvocationHandler implements InvocationHandler
39 {
40 public TestTransactionManagerFactory getParent()
41 {
42 return TestTransactionManagerFactory.this;
43 }
44
45 public Object invoke (Object proxy, Method method, Object[] args) throws Throwable
46 {
47 return null;
48 }
49
50 }
51 }