1
2
3
4
5
6
7
8
9
10
11 package org.mule.api.transaction;
12
13 public interface Transaction
14 {
15
16 int STATUS_ACTIVE = 0;
17 int STATUS_MARKED_ROLLBACK = 1;
18 int STATUS_PREPARED = 2;
19 int STATUS_COMMITTED = 3;
20 int STATUS_ROLLEDBACK = 4;
21 int STATUS_UNKNOWN = 5;
22 int STATUS_NO_TRANSACTION = 6;
23 int STATUS_PREPARING = 7;
24 int STATUS_COMMITTING = 8;
25 int STATUS_ROLLING_BACK = 9;
26
27
28
29
30
31
32 void begin() throws TransactionException;
33
34
35
36
37
38
39 void commit() throws TransactionException;
40
41
42
43
44
45
46 void rollback() throws TransactionException;
47
48 int getStatus() throws TransactionException;
49
50 boolean isBegun() throws TransactionException;
51
52 boolean isRolledBack() throws TransactionException;
53
54 boolean isCommitted() throws TransactionException;
55
56 Object getResource(Object key);
57
58 boolean hasResource(Object key);
59
60 void bindResource(Object key, Object resource) throws TransactionException;
61
62 void setRollbackOnly() throws TransactionException;
63
64 boolean isRollbackOnly() throws TransactionException;
65
66 boolean isXA();
67
68
69
70
71
72
73 void resume() throws TransactionException;
74
75
76
77
78
79
80
81 javax.transaction.Transaction suspend() throws TransactionException;
82 }