| RejectedExecutionException.java |
1 /*
2 * %W% %E%
3 *
4 * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
5 * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6 */
7
8 package java.util.concurrent;
9
10 /**
11 * Exception thrown by an {@link Executor} when a task cannot be
12 * accepted for execution.
13 *
14 * @since 1.5
15 * @author Doug Lea
16 */
17 public class RejectedExecutionException extends RuntimeException {
18 private static final long serialVersionUID = -375805702767069545L;
19
20 /**
21 * Constructs a <tt>RejectedExecutionException</tt> with no detail message.
22 * The cause is not initialized, and may subsequently be
23 * initialized by a call to {@link #initCause(Throwable) initCause}.
24 */
25 public RejectedExecutionException() { }
26
27 /**
28 * Constructs a <tt>RejectedExecutionException</tt> with the
29 * specified detail message. The cause is not initialized, and may
30 * subsequently be initialized by a call to {@link
31 * #initCause(Throwable) initCause}.
32 *
33 * @param message the detail message
34 */
35 public RejectedExecutionException(String message) {
36 super(message);
37 }
38
39 /**
40 * Constructs a <tt>RejectedExecutionException</tt> with the
41 * specified detail message and cause.
42 *
43 * @param message the detail message
44 * @param cause the cause (which is saved for later retrieval by the
45 * {@link #getCause()} method)
46 */
47 public RejectedExecutionException(String message, Throwable cause) {
48 super(message, cause);
49 }
50
51 /**
52 * Constructs a <tt>RejectedExecutionException</tt> with the
53 * specified cause. The detail message is set to: <pre> (cause ==
54 * null ? null : cause.toString())</pre> (which typically contains
55 * the class and detail message of <tt>cause</tt>).
56 *
57 * @param cause the cause (which is saved for later retrieval by the
58 * {@link #getCause()} method)
59 */
60 public RejectedExecutionException(Throwable cause) {
61 super(cause);
62 }
63 }
64