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