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