1
2
3
4
5
6
7
8
9
10 package org.mule.tck.testmodels.mule;
11
12 import org.mule.api.MuleContext;
13 import org.mule.api.transaction.TransactionException;
14 import org.mule.transaction.AbstractSingleResourceTransaction;
15
16 import java.util.concurrent.atomic.AtomicBoolean;
17
18
19
20
21
22 public class TestTransaction extends AbstractSingleResourceTransaction
23 {
24 private AtomicBoolean committed = new AtomicBoolean(false);
25 private AtomicBoolean rolledBack = new AtomicBoolean(false);
26
27 private String testProperty;
28
29 public TestTransaction(MuleContext muleContext)
30 {
31 super(muleContext);
32 }
33
34
35
36
37
38
39
40 protected void doBegin() throws TransactionException
41 {
42
43 }
44
45
46
47
48
49
50
51 protected void doCommit() throws TransactionException
52 {
53 committed.set(true);
54 }
55
56
57
58
59
60
61
62 protected void doRollback() throws TransactionException
63 {
64 rolledBack.set(true);
65 }
66
67 public String getTestProperty()
68 {
69 return testProperty;
70 }
71
72 public void setTestProperty(String testProperty)
73 {
74 this.testProperty = testProperty;
75 }
76 }