KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > transaction > xa > XAException


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.xa;
25
26 /**
27  * The XAException is thrown by the Resource Manager (RM) to inform the
28  * Transaction Manager of an error encountered by the involved
29  * transaction.
30  */

31 public class XAException extends java.lang.Exception JavaDoc {
32
33     /**
34     * The error code with which to create the SystemException.
35     *
36     * @serial The error code for the exception.
37      */

38
39     public int errorCode;
40
41     /**
42      * Create an XAException.
43      */

44     public XAException()
45     {
46         super();
47     }
48     
49     /**
50      * Create an XAException with a given string.
51      *
52      * @param s The <code>String</code> object containing the exception
53      * message.
54      */

55     public XAException(String JavaDoc s)
56     {
57         super(s);
58     }
59     
60     /**
61      * Create an XAException with a given error code.
62      *
63      * @param errcode The error code identifying the exception.
64      */

65     public XAException(int errcode)
66     {
67         super();
68         errorCode = errcode;
69     }
70
71     /**
72      * The inclusive lower bound of the rollback codes.
73      */

74     public final static int XA_RBBASE = 100;
75
76     /**
77      * Indicates that the rollback was caused by an unspecified reason.
78      */

79     public final static int XA_RBROLLBACK = XA_RBBASE;
80
81     /**
82      * Indicates that the rollback was caused by a communication failure.
83      */

84     public final static int XA_RBCOMMFAIL = XA_RBBASE + 1;
85
86     /**
87      * A deadlock was detected.
88      */

89     public final static int XA_RBDEADLOCK = XA_RBBASE + 2;
90
91     /**
92      * A condition that violates the integrity of the resource was detected.
93      */

94     public final static int XA_RBINTEGRITY = XA_RBBASE + 3;
95
96     /**
97      * The resource manager rolled back the transaction branch for a reason
98      * not on this list.
99      */

100     public final static int XA_RBOTHER = XA_RBBASE + 4;
101
102     /**
103      * A protocol error occurred in the resource manager.
104      */

105     public final static int XA_RBPROTO = XA_RBBASE + 5;
106
107     /**
108      * A transaction branch took too long.
109      */

110     public final static int XA_RBTIMEOUT = XA_RBBASE + 6;
111
112     /**
113      * May retry the transaction branch.
114      */

115     public final static int XA_RBTRANSIENT = XA_RBBASE + 7;
116
117     /**
118      * The inclusive upper bound of the rollback error code.
119      */

120     public final static int XA_RBEND = XA_RBTRANSIENT;
121
122     /**
123      * Resumption must occur where the suspension occurred.
124      */

125     public final static int XA_NOMIGRATE = 9;
126
127     /**
128      * The transaction branch may have been heuristically completed.
129      */

130     public final static int XA_HEURHAZ = 8;
131
132     /**
133      * The transaction branch has been heuristically committed.
134      */

135     public final static int XA_HEURCOM = 7;
136
137     /**
138      * The transaction branch has been heuristically rolled back.
139      */

140     public final static int XA_HEURRB = 6;
141
142     /**
143      * The transaction branch has been heuristically committed and
144      * rolled back.
145      */

146     public final static int XA_HEURMIX = 5;
147
148     /**
149      * Routine returned with no effect and may be reissued.
150      */

151     public final static int XA_RETRY = 4;
152
153     /**
154      * The transaction branch was read-only and has been committed.
155      */

156     public final static int XA_RDONLY = 3;
157
158     /**
159      * There is an asynchronous operation already outstanding.
160      */

161     public final static int XAER_ASYNC = -2;
162
163     /**
164      * A resource manager error has occurred in the transaction branch.
165      */

166     public final static int XAER_RMERR = -3;
167
168     /**
169      * The XID is not valid.
170      */

171     public final static int XAER_NOTA = -4;
172
173     /**
174      * Invalid arguments were given.
175      */

176     public final static int XAER_INVAL = -5;
177
178     /**
179      * Routine was invoked in an improper context.
180      */

181     public final static int XAER_PROTO = -6;
182
183     /**
184      * Resource manager is unavailable.
185      */

186     public final static int XAER_RMFAIL = -7;
187
188     /**
189      * The XID already exists.
190      */

191     public final static int XAER_DUPID = -8;
192
193     /**
194      * The resource manager is doing work outside a global transaction.
195      */

196     public final static int XAER_OUTSIDE = -9;
197
198    
199 }
200
Popular Tags