1. /*
  2. * @(#)ExecutionException.java 1.3 03/12/19
  3. *
  4. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package java.util.concurrent;
  8. /**
  9. * Exception thrown when attempting to retrieve the result of a task
  10. * that aborted by throwing an exception. This exception can be
  11. * inspected using the {@link #getCause()} method.
  12. *
  13. * @see Future
  14. * @since 1.5
  15. * @author Doug Lea
  16. */
  17. public class ExecutionException extends Exception {
  18. private static final long serialVersionUID = 7830266012832686185L;
  19. /**
  20. * Constructs a <tt>ExecutionException</tt> with no detail message.
  21. * The cause is not initialized, and may subsequently be
  22. * initialized by a call to {@link #initCause(Throwable) initCause}.
  23. */
  24. protected ExecutionException() { }
  25. /**
  26. * Constructs a <tt>ExecutionException</tt> with the specified detail
  27. * message. The cause is not initialized, and may subsequently be
  28. * initialized by a call to {@link #initCause(Throwable) initCause}.
  29. *
  30. * @param message the detail message
  31. */
  32. protected ExecutionException(String message) {
  33. super(message);
  34. }
  35. /**
  36. * Constructs a <tt>ExecutionException</tt> with the specified detail
  37. * message and cause.
  38. *
  39. * @param message the detail message
  40. * @param cause the cause (which is saved for later retrieval by the
  41. * {@link #getCause()} method)
  42. */
  43. public ExecutionException(String message, Throwable cause) {
  44. super(message, cause);
  45. }
  46. /**
  47. * Constructs a <tt>ExecutionException</tt> with the specified cause.
  48. * The detail message is set to:
  49. * <pre>
  50. * (cause == null ? null : cause.toString())</pre>
  51. * (which typically contains the class and detail message of
  52. * <tt>cause</tt>).
  53. *
  54. * @param cause the cause (which is saved for later retrieval by the
  55. * {@link #getCause()} method)
  56. */
  57. public ExecutionException(Throwable cause) {
  58. super(cause);
  59. }
  60. }