KickJava   Java API By Example, From Geeks To Geeks.

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


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  * This exception is thrown by a <code>WorkManager</code> to indicate that
28  * a submitted <code>Work</code> instance has completed with an exception.
29  *
30  * <p>This could be thrown only after the execution of a
31  * <code>Work</code> instance has started (that is, after a thread has
32  * been allocated for <code>Work</code> execution). The allocated thread sets
33  * up an execution context (if it has been specified), and then calls
34  * <code>Work.run()</code>.
35  *
36  * <p>Any exception thrown during execution context setup or during
37  * <code>Work</code> execution (that is, during <code>Work.run()</code>) is
38  * chained within this exception.
39  *
40  * <p>An associated error code indicates the nature of the error condition.
41  * Possible error codes are <code>WorkException.TX_RECREATE_FAILED</code>,
42  * <code>WorkException.TX_CONCURRENT_WORK_DISALLOWED</code> or
43  * <code>WorkException.UNDEFINED</code>.
44  *
45  * @version 1.0
46  * @author Ram Jeyaraman
47  */

48 public class WorkCompletedException extends WorkException JavaDoc {
49
50     /**
51      * Constructs a new instance with null as its detail message.
52      */

53     public WorkCompletedException() { super(); }
54
55     /**
56      * Constructs a new instance with the specified detail message.
57      *
58      * @param message the detail message.
59      */

60     public WorkCompletedException(String JavaDoc message) {
61     super(message);
62     }
63
64     /**
65      * Constructs a new throwable with the specified cause.
66      *
67      * @param cause a chained exception of type
68      * <code>Throwable</code>.
69      */

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

82     public WorkCompletedException(String JavaDoc message, Throwable JavaDoc cause) {
83     super(message, cause);
84     }
85
86     /**
87      * Constructs a new throwable with the specified detail message and
88      * an error code.
89      *
90      * @param message a description of the exception.
91      * @param errorCode a string specifying the vendor specific error code.
92      */

93     public WorkCompletedException(String JavaDoc message, String JavaDoc errorCode) {
94     super(message, errorCode);
95     }
96 }
97
Popular Tags