Thu, 11 Jul 2019 00:03:18 +0100
Added tag jdk8u222-b10 for changeset d44170c2cece
duke@1 | 1 | /* |
ohair@158 | 2 | * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved. |
duke@1 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
duke@1 | 4 | * |
duke@1 | 5 | * This code is free software; you can redistribute it and/or modify it |
duke@1 | 6 | * under the terms of the GNU General Public License version 2 only, as |
ohair@158 | 7 | * published by the Free Software Foundation. Oracle designates this |
duke@1 | 8 | * particular file as subject to the "Classpath" exception as provided |
ohair@158 | 9 | * by Oracle in the LICENSE file that accompanied this code. |
duke@1 | 10 | * |
duke@1 | 11 | * This code is distributed in the hope that it will be useful, but WITHOUT |
duke@1 | 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
duke@1 | 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
duke@1 | 14 | * version 2 for more details (a copy is included in the LICENSE file that |
duke@1 | 15 | * accompanied this code). |
duke@1 | 16 | * |
duke@1 | 17 | * You should have received a copy of the GNU General Public License version |
duke@1 | 18 | * 2 along with this work; if not, write to the Free Software Foundation, |
duke@1 | 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
duke@1 | 20 | * |
ohair@158 | 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
ohair@158 | 22 | * or visit www.oracle.com if you need additional information or have any |
ohair@158 | 23 | * questions. |
duke@1 | 24 | */ |
duke@1 | 25 | |
duke@1 | 26 | package javax.transaction.xa; |
duke@1 | 27 | |
duke@1 | 28 | /** |
duke@1 | 29 | * The XAException is thrown by the Resource Manager (RM) to inform the |
duke@1 | 30 | * Transaction Manager of an error encountered by the involved transaction. |
duke@1 | 31 | * |
duke@1 | 32 | */ |
duke@1 | 33 | public class XAException extends java.lang.Exception { |
duke@1 | 34 | |
duke@1 | 35 | /** |
duke@1 | 36 | * The error code with which to create the SystemException. |
duke@1 | 37 | * |
duke@1 | 38 | * @serial The error code for the exception |
duke@1 | 39 | */ |
duke@1 | 40 | |
duke@1 | 41 | public int errorCode; |
duke@1 | 42 | |
duke@1 | 43 | /** |
duke@1 | 44 | * Create an XAException. |
duke@1 | 45 | */ |
duke@1 | 46 | public XAException() |
duke@1 | 47 | { |
duke@1 | 48 | super(); |
duke@1 | 49 | } |
duke@1 | 50 | |
duke@1 | 51 | /** |
duke@1 | 52 | * Create an XAException with a given string. |
duke@1 | 53 | * |
duke@1 | 54 | * @param s The <code>String</code> object containing the exception |
duke@1 | 55 | * message. |
duke@1 | 56 | */ |
duke@1 | 57 | public XAException(String s) |
duke@1 | 58 | { |
duke@1 | 59 | super(s); |
duke@1 | 60 | } |
duke@1 | 61 | |
duke@1 | 62 | /** |
duke@1 | 63 | * Create an XAException with a given error code. |
duke@1 | 64 | * |
duke@1 | 65 | * @param errcode The error code identifying the exception. |
duke@1 | 66 | */ |
duke@1 | 67 | public XAException(int errcode) |
duke@1 | 68 | { |
duke@1 | 69 | super(); |
duke@1 | 70 | errorCode = errcode; |
duke@1 | 71 | } |
duke@1 | 72 | |
duke@1 | 73 | /** |
duke@1 | 74 | * The inclusive lower bound of the rollback codes. |
duke@1 | 75 | */ |
duke@1 | 76 | public final static int XA_RBBASE = 100; |
duke@1 | 77 | |
duke@1 | 78 | /** |
duke@1 | 79 | * Indicates that the rollback was caused by an unspecified reason. |
duke@1 | 80 | */ |
duke@1 | 81 | public final static int XA_RBROLLBACK = XA_RBBASE; |
duke@1 | 82 | |
duke@1 | 83 | /** |
duke@1 | 84 | * Indicates that the rollback was caused by a communication failure. |
duke@1 | 85 | */ |
duke@1 | 86 | public final static int XA_RBCOMMFAIL = XA_RBBASE + 1; |
duke@1 | 87 | |
duke@1 | 88 | /** |
duke@1 | 89 | * A deadlock was detected. |
duke@1 | 90 | */ |
duke@1 | 91 | public final static int XA_RBDEADLOCK = XA_RBBASE + 2; |
duke@1 | 92 | |
duke@1 | 93 | /** |
duke@1 | 94 | * A condition that violates the integrity of the resource was detected. |
duke@1 | 95 | */ |
duke@1 | 96 | public final static int XA_RBINTEGRITY = XA_RBBASE + 3; |
duke@1 | 97 | |
duke@1 | 98 | /** |
duke@1 | 99 | * The resource manager rolled back the transaction branch for a reason |
duke@1 | 100 | * not on this list. |
duke@1 | 101 | */ |
duke@1 | 102 | public final static int XA_RBOTHER = XA_RBBASE + 4; |
duke@1 | 103 | |
duke@1 | 104 | /** |
duke@1 | 105 | * A protocol error occurred in the resource manager. |
duke@1 | 106 | */ |
duke@1 | 107 | public final static int XA_RBPROTO = XA_RBBASE + 5; |
duke@1 | 108 | |
duke@1 | 109 | /** |
duke@1 | 110 | * A transaction branch took too long. |
duke@1 | 111 | */ |
duke@1 | 112 | public final static int XA_RBTIMEOUT = XA_RBBASE + 6; |
duke@1 | 113 | |
duke@1 | 114 | /** |
duke@1 | 115 | * May retry the transaction branch. |
duke@1 | 116 | */ |
duke@1 | 117 | public final static int XA_RBTRANSIENT = XA_RBBASE + 7; |
duke@1 | 118 | |
duke@1 | 119 | /** |
duke@1 | 120 | * The inclusive upper bound of the rollback error code. |
duke@1 | 121 | */ |
duke@1 | 122 | public final static int XA_RBEND = XA_RBTRANSIENT; |
duke@1 | 123 | |
duke@1 | 124 | /** |
duke@1 | 125 | * Resumption must occur where the suspension occurred. |
duke@1 | 126 | */ |
duke@1 | 127 | public final static int XA_NOMIGRATE = 9; |
duke@1 | 128 | |
duke@1 | 129 | /** |
duke@1 | 130 | * The transaction branch may have been heuristically completed. |
duke@1 | 131 | */ |
duke@1 | 132 | public final static int XA_HEURHAZ = 8; |
duke@1 | 133 | |
duke@1 | 134 | /** |
duke@1 | 135 | * The transaction branch has been heuristically committed. |
duke@1 | 136 | */ |
duke@1 | 137 | public final static int XA_HEURCOM = 7; |
duke@1 | 138 | |
duke@1 | 139 | /** |
duke@1 | 140 | * The transaction branch has been heuristically rolled back. |
duke@1 | 141 | */ |
duke@1 | 142 | public final static int XA_HEURRB = 6; |
duke@1 | 143 | |
duke@1 | 144 | /** |
duke@1 | 145 | * The transaction branch has been heuristically committed and |
duke@1 | 146 | * rolled back. |
duke@1 | 147 | */ |
duke@1 | 148 | public final static int XA_HEURMIX = 5; |
duke@1 | 149 | |
duke@1 | 150 | /** |
duke@1 | 151 | * Routine returned with no effect and may be reissued. |
duke@1 | 152 | */ |
duke@1 | 153 | public final static int XA_RETRY = 4; |
duke@1 | 154 | |
duke@1 | 155 | /** |
duke@1 | 156 | * The transaction branch was read-only and has been committed. |
duke@1 | 157 | */ |
duke@1 | 158 | public final static int XA_RDONLY = 3; |
duke@1 | 159 | |
duke@1 | 160 | /** |
duke@1 | 161 | * There is an asynchronous operation already outstanding. |
duke@1 | 162 | */ |
duke@1 | 163 | public final static int XAER_ASYNC = -2; |
duke@1 | 164 | |
duke@1 | 165 | /** |
duke@1 | 166 | * A resource manager error has occurred in the transaction branch. |
duke@1 | 167 | */ |
duke@1 | 168 | public final static int XAER_RMERR = -3; |
duke@1 | 169 | |
duke@1 | 170 | /** |
duke@1 | 171 | * The XID is not valid. |
duke@1 | 172 | */ |
duke@1 | 173 | public final static int XAER_NOTA = -4; |
duke@1 | 174 | |
duke@1 | 175 | /** |
duke@1 | 176 | * Invalid arguments were given. |
duke@1 | 177 | */ |
duke@1 | 178 | public final static int XAER_INVAL = -5; |
duke@1 | 179 | |
duke@1 | 180 | /** |
duke@1 | 181 | * Routine was invoked in an inproper context. |
duke@1 | 182 | */ |
duke@1 | 183 | public final static int XAER_PROTO = -6; |
duke@1 | 184 | |
duke@1 | 185 | /** |
duke@1 | 186 | * Resource manager is unavailable. |
duke@1 | 187 | */ |
duke@1 | 188 | public final static int XAER_RMFAIL = -7; |
duke@1 | 189 | |
duke@1 | 190 | /** |
duke@1 | 191 | * The XID already exists. |
duke@1 | 192 | */ |
duke@1 | 193 | public final static int XAER_DUPID = -8; |
duke@1 | 194 | |
duke@1 | 195 | /** |
duke@1 | 196 | * The resource manager is doing work outside a global transaction. |
duke@1 | 197 | */ |
duke@1 | 198 | public final static int XAER_OUTSIDE = -9; |
duke@1 | 199 | |
duke@1 | 200 | |
duke@1 | 201 | } |