• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Written by Doug Lea with assistance from members of JCP JSR-166
3  * Expert Group and released to the public domain, as explained at
4  * http://creativecommons.org/publicdomain/zero/1.0/
5  */
6 
7 package java.util.concurrent;
8 
9 /**
10  * Exception thrown by an {@link Executor} when a task cannot be
11  * accepted for execution.
12  *
13  * @since 1.5
14  * @author Doug Lea
15  */
16 public class RejectedExecutionException extends RuntimeException {
17     private static final long serialVersionUID = -375805702767069545L;
18 
19     /**
20      * Constructs a {@code RejectedExecutionException} 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      */
RejectedExecutionException()24     public RejectedExecutionException() { }
25 
26     /**
27      * Constructs a {@code RejectedExecutionException} with the
28      * specified detail message. The cause is not initialized, and may
29      * subsequently be initialized by a call to {@link
30      * #initCause(Throwable) initCause}.
31      *
32      * @param message the detail message
33      */
RejectedExecutionException(String message)34     public RejectedExecutionException(String message) {
35         super(message);
36     }
37 
38     /**
39      * Constructs a {@code RejectedExecutionException} with the
40      * specified detail message and cause.
41      *
42      * @param  message the detail message
43      * @param  cause the cause (which is saved for later retrieval by the
44      *         {@link #getCause()} method)
45      */
RejectedExecutionException(String message, Throwable cause)46     public RejectedExecutionException(String message, Throwable cause) {
47         super(message, cause);
48     }
49 
50     /**
51      * Constructs a {@code RejectedExecutionException} with the
52      * specified cause.  The detail message is set to {@code (cause ==
53      * null ? null : cause.toString())} (which typically contains
54      * the class and detail message of {@code cause}).
55      *
56      * @param  cause the cause (which is saved for later retrieval by the
57      *         {@link #getCause()} method)
58      */
RejectedExecutionException(Throwable cause)59     public RejectedExecutionException(Throwable cause) {
60         super(cause);
61     }
62 }
63