KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > resource > spi > LocalTransactionException


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.resource.spi;
25
26 /**
27  * A <code>LocalTransactionException</code> represents various
28  * error conditions related to the local transaction management contract.
29  * The Java Transaction API specification specifies the
30  * <code>javax.transaction.xa.XAException</code> class for exceptions
31  * related to XAResource based transaction management contract.
32  *
33  * <p>The <code>LocalTransactionException</code> is used for the local
34  * transaction management contract to indicate the following common
35  * error conditions:
36  * <UL>
37  * <LI>Invalid transaction context when a transaction operation is executed.
38  * For example, calling <code>commit</code> method on
39  * <code>LocalTransaction</code> object without an active
40  * local transaction is an error condition.
41  * <LI>Transaction is rolled back instead of getting committed during a
42  * <code>commit</code> method call on the <code>LocalTransaction</code>
43  * object.
44  * <LI>An attempt to start a local transaction from the same thread on a
45  * <code>ManagedConnection</code> that is already associated with
46  * an active local transaction.
47  * <LI>Any resource adapter or resource manager specific error conditions
48  * related to local transaction management. Examples are violation of
49  * integrity of resources, deadlock detection, communication failure
50  * during transaction completion, retry required or any internal error
51  * in a resource manager.
52  * </UL>
53  *
54  * @version 1.0
55  * @author Rahul Sharma
56  * @author Ram Jeyaraman
57  */

58
59 public class LocalTransactionException
60         extends javax.resource.ResourceException JavaDoc {
61
62     /**
63      * Constructs a new instance with null as its detail message.
64      */

65     public LocalTransactionException() { super(); }
66
67     /**
68      * Constructs a new instance with the specified detail message.
69      *
70      * @param message the detail message.
71      */

72     public LocalTransactionException(String JavaDoc message) {
73     super(message);
74     }
75
76     /**
77      * Constructs a new throwable with the specified cause.
78      *
79      * @param cause a chained exception of type <code>Throwable</code>.
80      */

81     public LocalTransactionException(Throwable JavaDoc cause) {
82     super(cause);
83     }
84
85     /**
86      * Constructs a new throwable with the specified detail message and cause.
87      *
88      * @param message the detail message.
89      *
90      * @param cause a chained exception of type <code>Throwable</code>.
91      */

92     public LocalTransactionException(String JavaDoc message, Throwable JavaDoc cause) {
93     super(message, cause);
94     }
95
96     /**
97      * Constructs a new throwable with the specified detail message and
98      * an error code.
99      *
100      * @param message a description of the exception.
101      * @param errorCode a string specifying the vendor specific error code.
102      */

103     public LocalTransactionException(String JavaDoc message, String JavaDoc errorCode) {
104     super(message, errorCode);
105     }
106 }
107
Popular Tags