001 /*
002 * Copyright 2000-2001 Sun Microsystems, Inc. All Rights Reserved.
003 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004 *
005 * This code is free software; you can redistribute it and/or modify it
006 * under the terms of the GNU General Public License version 2 only, as
007 * published by the Free Software Foundation. Sun designates this
008 * particular file as subject to the "Classpath" exception as provided
009 * by Sun in the LICENSE file that accompanied this code.
010 *
011 * This code is distributed in the hope that it will be useful, but WITHOUT
012 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
014 * version 2 for more details (a copy is included in the LICENSE file that
015 * accompanied this code).
016 *
017 * You should have received a copy of the GNU General Public License version
018 * 2 along with this work; if not, write to the Free Software Foundation,
019 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020 *
021 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022 * CA 95054 USA or visit www.sun.com if you need additional information or
023 * have any questions.
024 */
025
026 package javax.transaction.xa;
027
028 /**
029 * The XAException is thrown by the Resource Manager (RM) to inform the
030 * Transaction Manager of an error encountered by the involved transaction.
031 *
032 */
033 public class XAException extends java.lang.Exception {
034
035 /**
036 * The error code with which to create the SystemException.
037 *
038 * @serial The error code for the exception
039 */
040
041 public int errorCode;
042
043 /**
044 * Create an XAException.
045 */
046 public XAException() {
047 super ();
048 }
049
050 /**
051 * Create an XAException with a given string.
052 *
053 * @param s The <code>String</code> object containing the exception
054 * message.
055 */
056 public XAException(String s) {
057 super (s);
058 }
059
060 /**
061 * Create an XAException with a given error code.
062 *
063 * @param errcode The error code identifying the exception.
064 */
065 public XAException(int errcode) {
066 super ();
067 errorCode = errcode;
068 }
069
070 /**
071 * The inclusive lower bound of the rollback codes.
072 */
073 public final static int XA_RBBASE = 100;
074
075 /**
076 * Indicates that the rollback was caused by an unspecified reason.
077 */
078 public final static int XA_RBROLLBACK = XA_RBBASE;
079
080 /**
081 * Indicates that the rollback was caused by a communication failure.
082 */
083 public final static int XA_RBCOMMFAIL = XA_RBBASE + 1;
084
085 /**
086 * A deadlock was detected.
087 */
088 public final static int XA_RBDEADLOCK = XA_RBBASE + 2;
089
090 /**
091 * A condition that violates the integrity of the resource was detected.
092 */
093 public final static int XA_RBINTEGRITY = XA_RBBASE + 3;
094
095 /**
096 * The resource manager rolled back the transaction branch for a reason
097 * not on this list.
098 */
099 public final static int XA_RBOTHER = XA_RBBASE + 4;
100
101 /**
102 * A protocol error occurred in the resource manager.
103 */
104 public final static int XA_RBPROTO = XA_RBBASE + 5;
105
106 /**
107 * A transaction branch took too long.
108 */
109 public final static int XA_RBTIMEOUT = XA_RBBASE + 6;
110
111 /**
112 * May retry the transaction branch.
113 */
114 public final static int XA_RBTRANSIENT = XA_RBBASE + 7;
115
116 /**
117 * The inclusive upper bound of the rollback error code.
118 */
119 public final static int XA_RBEND = XA_RBTRANSIENT;
120
121 /**
122 * Resumption must occur where the suspension occurred.
123 */
124 public final static int XA_NOMIGRATE = 9;
125
126 /**
127 * The transaction branch may have been heuristically completed.
128 */
129 public final static int XA_HEURHAZ = 8;
130
131 /**
132 * The transaction branch has been heuristically committed.
133 */
134 public final static int XA_HEURCOM = 7;
135
136 /**
137 * The transaction branch has been heuristically rolled back.
138 */
139 public final static int XA_HEURRB = 6;
140
141 /**
142 * The transaction branch has been heuristically committed and
143 * rolled back.
144 */
145 public final static int XA_HEURMIX = 5;
146
147 /**
148 * Routine returned with no effect and may be reissued.
149 */
150 public final static int XA_RETRY = 4;
151
152 /**
153 * The transaction branch was read-only and has been committed.
154 */
155 public final static int XA_RDONLY = 3;
156
157 /**
158 * There is an asynchronous operation already outstanding.
159 */
160 public final static int XAER_ASYNC = -2;
161
162 /**
163 * A resource manager error has occurred in the transaction branch.
164 */
165 public final static int XAER_RMERR = -3;
166
167 /**
168 * The XID is not valid.
169 */
170 public final static int XAER_NOTA = -4;
171
172 /**
173 * Invalid arguments were given.
174 */
175 public final static int XAER_INVAL = -5;
176
177 /**
178 * Routine was invoked in an inproper context.
179 */
180 public final static int XAER_PROTO = -6;
181
182 /**
183 * Resource manager is unavailable.
184 */
185 public final static int XAER_RMFAIL = -7;
186
187 /**
188 * The XID already exists.
189 */
190 public final static int XAER_DUPID = -8;
191
192 /**
193 * The resource manager is doing work outside a global transaction.
194 */
195 public final static int XAER_OUTSIDE = -9;
196
197 }
|