01: /*
02: * Written by Doug Lea with assistance from members of JCP JSR-166
03: * Expert Group and released to the public domain, as explained at
04: * http://creativecommons.org/licenses/publicdomain
05: */
06:
07: package java.util.concurrent;
08:
09: /**
10: * Exception thrown when attempting to retrieve the result of a task
11: * that aborted by throwing an exception. This exception can be
12: * inspected using the {@link #getCause()} method.
13: *
14: * @see Future
15: * @since 1.5
16: * @author Doug Lea
17: */
18: public class ExecutionException extends Exception {
19: private static final long serialVersionUID = 7830266012832686185L;
20:
21: /**
22: * Constructs a <tt>ExecutionException</tt> with no detail message.
23: * The cause is not initialized, and may subsequently be
24: * initialized by a call to {@link #initCause(Throwable) initCause}.
25: */
26: protected ExecutionException() {
27: }
28:
29: /**
30: * Constructs a <tt>ExecutionException</tt> with the specified detail
31: * message. The cause is not initialized, and may subsequently be
32: * initialized by a call to {@link #initCause(Throwable) initCause}.
33: *
34: * @param message the detail message
35: */
36: protected ExecutionException(String message) {
37: super (message);
38: }
39:
40: /**
41: * Constructs a <tt>ExecutionException</tt> with the specified detail
42: * message and cause.
43: *
44: * @param message the detail message
45: * @param cause the cause (which is saved for later retrieval by the
46: * {@link #getCause()} method)
47: */
48: public ExecutionException(String message, Throwable cause) {
49: super (message, cause);
50: }
51:
52: /**
53: * Constructs a <tt>ExecutionException</tt> with the specified cause.
54: * The detail message is set to:
55: * <pre>
56: * (cause == null ? null : cause.toString())</pre>
57: * (which typically contains the class and detail message of
58: * <tt>cause</tt>).
59: *
60: * @param cause the cause (which is saved for later retrieval by the
61: * {@link #getCause()} method)
62: */
63: public ExecutionException(Throwable cause) {
64: super(cause);
65: }
66: }
|