KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mule > umo > UMOTransaction


1 /*
2  * $Id: UMOTransaction.java 3798 2006-11-04 04:07:14Z aperepel $
3  * --------------------------------------------------------------------------------------
4  * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
5  *
6  * The software in this package is published under the terms of the MuleSource MPL
7  * license, a copy of which has been included with this distribution in the
8  * LICENSE.txt file.
9  */

10
11 package org.mule.umo;
12
13 /**
14  * @author <a HREF="mailto:ross.mason@symphonysoft.com">Ross Mason</a>
15  * @author Guillaume Nodet
16  * @version $Revision: 3798 $
17  */

18 public interface UMOTransaction
19 {
20
21     int STATUS_ACTIVE = 0;
22     int STATUS_MARKED_ROLLBACK = 1;
23     int STATUS_PREPARED = 2;
24     int STATUS_COMMITTED = 3;
25     int STATUS_ROLLEDBACK = 4;
26     int STATUS_UNKNOWN = 5;
27     int STATUS_NO_TRANSACTION = 6;
28     int STATUS_PREPARING = 7;
29     int STATUS_COMMITTING = 8;
30     int STATUS_ROLLING_BACK = 9;
31
32     /**
33      * Begin the transaction.
34      *
35      * @throws TransactionException
36      */

37     void begin() throws TransactionException;
38
39     /**
40      * Commit the transaction
41      *
42      * @throws TransactionException
43      */

44     void commit() throws TransactionException;
45
46     /**
47      * Rollback the transaction
48      *
49      * @throws TransactionException
50      */

51     void rollback() throws TransactionException;
52
53     int getStatus() throws TransactionException;
54
55     boolean isBegun() throws TransactionException;
56
57     boolean isRolledBack() throws TransactionException;
58
59     boolean isCommitted() throws TransactionException;
60
61     Object JavaDoc getResource(Object JavaDoc key);
62
63     boolean hasResource(Object JavaDoc key);
64
65     void bindResource(Object JavaDoc key, Object JavaDoc resource) throws TransactionException;
66
67     void setRollbackOnly() throws TransactionException;
68
69     boolean isRollbackOnly() throws TransactionException;
70 }
71
Popular Tags