KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > transaction > Status


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 package javax.transaction;
25
26 /**
27  * The Status interface defines static variables used for transaction
28  * status codes.
29  */

30
31 public interface Status {
32     /**
33      * A transaction is associated with the target object and it is in the
34      * active state. An implementation returns this status after a
35      * transaction has been started and prior to a Coordinator issuing
36      * any prepares, unless the transaction has been marked for rollback.
37      */

38     public final static int STATUS_ACTIVE = 0;
39
40     /**
41      * A transaction is associated with the target object and it has been
42      * marked for rollback, perhaps as a result of a setRollbackOnly operation.
43      */

44     public final static int STATUS_MARKED_ROLLBACK = 1;
45
46     /**
47      * A transaction is associated with the target object and it has been
48      * prepared. That is, all subordinates have agreed to commit. The
49      * target object may be waiting for instructions from a superior as to how
50      * to proceed.
51      */

52     public final static int STATUS_PREPARED = 2;
53  
54     /**
55      * A transaction is associated with the target object and it has been
56      * committed. It is likely that heuristics exist; otherwise, the
57      * transaction would have been destroyed and NoTransaction returned.
58      */

59     public final static int STATUS_COMMITTED = 3;
60
61     /**
62      * A transaction is associated with the target object and the outcome
63      * has been determined to be rollback. It is likely that heuristics exist;
64      * otherwise, the transaction would have been destroyed and NoTransaction
65      * returned.
66      */

67     public final static int STATUS_ROLLEDBACK = 4;
68
69     /**
70      * A transaction is associated with the target object but its
71      * current status cannot be determined. This is a transient condition
72      * and a subsequent invocation will ultimately return a different status.
73      */

74     public final static int STATUS_UNKNOWN = 5;
75
76     /**
77      * No transaction is currently associated with the target object. This
78      * will occur after a transaction has completed.
79      */

80     public final static int STATUS_NO_TRANSACTION = 6;
81
82     /**
83      * A transaction is associated with the target object and it is in the
84      * process of preparing. An implementation returns this status if it
85      * has started preparing, but has not yet completed the process. The
86      * likely reason for this is that the implementation is probably
87      * waiting for responses to prepare from one or more
88      * Resources.
89      */

90     public final static int STATUS_PREPARING = 7;
91
92     /**
93      * A transaction is associated with the target object and it is in the
94      * process of committing. An implementation returns this status if it
95      * has decided to commit but has not yet completed the committing process.
96      * This occurs because the implementation is probably waiting for
97      * responses from one or more Resources.
98      */

99     public final static int STATUS_COMMITTING = 8;
100
101     /**
102      * A transaction is associated with the target object and it is in the
103      * process of rolling back. An implementation returns this status if
104      * it has decided to rollback but has not yet completed the process.
105      * The implementation is probably waiting for responses from one or more
106      * Resources.
107      */

108     public final static int STATUS_ROLLING_BACK = 9;
109 }
110
Popular Tags