01: /*
02: * Copyright (c) 1998-2003 Caucho Technology -- all rights reserved
03: *
04: * This file is part of Resin(R) Open Source
05: *
06: * Each copy or derived work must preserve the copyright notice and this
07: * notice unmodified.
08: *
09: * Resin Open Source is free software; you can redistribute it and/or modify
10: * it under the terms of the GNU General Public License as published by
11: * the Free Software Foundation; either version 2 of the License, or
12: * (at your option) any later version.
13: *
14: * Resin Open Source is distributed in the hope that it will be useful,
15: * but WITHOUT ANY WARRANTY; without even the implied warranty of
16: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
17: * of NON-INFRINGEMENT. See the GNU General Public License for more
18: * details.
19: *
20: * You should have received a copy of the GNU General Public License
21: * along with Resin Open Source; if not, write to the
22: * Free SoftwareFoundation, Inc.
23: * 59 Temple Place, Suite 330
24: * Boston, MA 02111-1307 USA
25: *
26: * @author Scott Ferguson
27: */
28:
29: package javax.transaction.xa;
30:
31: /**
32: * A generic XA exception
33: */
34: public class XAException extends Exception {
35: public final static int XA_RBBASE = 100;
36: public final static int XA_RBROLLBACK = XA_RBBASE;
37: public final static int XA_RBCOMMFAIL = XA_RBBASE + 1;
38: public final static int XA_RBDEADLOCK = XA_RBBASE + 2;
39: public final static int XA_RBINTEGRITY = XA_RBBASE + 3;
40: public final static int XA_RBOTHER = XA_RBBASE + 4;
41: public final static int XA_RBPROTO = XA_RBBASE + 5;
42: public final static int XA_RBTIMEOUT = XA_RBBASE + 6;
43: public final static int XA_RBTRANSIENT = XA_RBBASE + 7;
44: public final static int XA_RBEND = XA_RBBASE + 8;
45:
46: public final static int XA_NOMIGRATE = 9;
47: public final static int XA_HEURHAZ = 8;
48: public final static int XA_HEURCOM = 7;
49: public final static int XA_HEURRB = 6;
50: public final static int XA_HEURMIX = 5;
51: public final static int XA_RDONLY = 3;
52:
53: public final static int XAER_RMERR = -3;
54: public final static int XAER_NOTA = -4;
55: public final static int XAER_INVAL = -5;
56: public final static int XAER_PROTO = -6;
57: public final static int XAER_RMFAIL = -7;
58: public final static int XAER_DUPID = -8;
59: public final static int XAER_OUTSIDE = -9;
60:
61: public int errorCode;
62:
63: /**
64: * Creates an exception
65: */
66: public XAException() {
67: }
68:
69: /**
70: * Creates an exception
71: */
72: public XAException(String msg) {
73: super (msg);
74: }
75:
76: /**
77: * Creates an exception
78: */
79: public XAException(int errCode) {
80: this .errorCode = errCode;
81: }
82:
83: /**
84: * Creates a wrapped exception.
85: */
86: public XAException(Throwable rootCause) {
87: super (rootCause);
88: }
89:
90: /**
91: * Creates a wrapped exception.
92: */
93: public XAException(String msg, Throwable rootCause) {
94: super(msg, rootCause);
95: }
96: }
|