Name

RejectedExecutionException

Synopsis

An exception of this type is thrown by an Executor when it cannot accept a task for execution. When a ThreadPoolExecutor cannot accept a task, it attempts to invoke a RejectedExecutionHandler. ThreadPoolExecutor defines several nested implementations of that handler interface that can handle the rejected task without throwing an exception of this type.

java.util.concurrent.RejectedExecutionException

Figure 16-88. java.util.concurrent.RejectedExecutionException

public class RejectedExecutionException extends RuntimeException {
// Public Constructors
     public RejectedExecutionException( );  
     public RejectedExecutionException(Throwable cause);  
     public RejectedExecutionException(String message);  
     public RejectedExecutionException(String message, Throwable cause);  
}

Get Java in a Nutshell, 5th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.