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