KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > resource > spi > work > WorkException


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.work;
25
26 /**
27  * A common base class for all <code>Work</code> processing related exceptions.
28  *
29  * @version 1.0
30  * @author Ram Jeyaraman
31  */

32 public class WorkException extends javax.resource.ResourceException JavaDoc {
33
34
35     /**
36      * Indicates an internal error condition.
37      */

38     public static final String JavaDoc INTERNAL = "-1";
39
40     /**
41      * Undefined error code.
42      */

43     public static final String JavaDoc UNDEFINED = "0";
44
45     /**
46      * Indicates start timeout expiration.
47      */

48     public static final String JavaDoc START_TIMED_OUT = "1";
49
50     /**
51      * Indicates that concurrent work within a transaction is
52      * disallowed. That is, there is already another <code>Work</code>
53      * instance associated with the specified transaction context.
54      */

55     public static final String JavaDoc TX_CONCURRENT_WORK_DISALLOWED = "2";
56
57     /**
58      * Indicates a failure in recreating the specified transaction context.
59      */

60     public static final String JavaDoc TX_RECREATE_FAILED = "3";
61
62     /**
63      * Constructs a new instance with null as its detail message.
64      */

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

72     public WorkException(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
80      * <code>Throwable</code>.
81      */

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

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

105     public WorkException(String JavaDoc message, String JavaDoc errorCode) {
106         super(message, errorCode);
107     }
108 }
109
Popular Tags