ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/concurrent/CannotExecuteHandler.java
Revision: 1.2
Committed: Tue May 27 18:10:09 2003 UTC (21 years ago) by jozart
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +2 -2 lines
State: FILE REMOVED
Log Message:
Replaced by RejectedExecutionHandler

File Contents

# User Rev Content
1 tim 1.1 /*
2     * @(#)CannotExecuteHandler.java
3     */
4    
5     package java.util.concurrent;
6    
7     /**
8     * A handler for tasks that cannot be executed by a {@link ThreadedExecutor}.
9     *
10     * @since 1.5
11     *
12     * @spec JSR-166
13 jozart 1.2 * @revised $Date: 2003/05/14 21:30:45 $
14     * @editor $Author: tim $
15 tim 1.1 */
16     public interface CannotExecuteHandler {
17    
18     /**
19     * Method invoked by <tt>ThreadedExecutor</tt> when <tt>execute</tt> cannot
20     * submit a task. This may occur when no more threads or queue slots are
21     * available because their bounds would be exceeded, or upon
22     * shutdown of the Executor. The <tt>isShutdown</tt> parameter can be
23     * used to distinguish between these cases.
24     *
25     * Returns false if <tt>execute</tt> should be retried, else true.
26     * You may alternatively throw an unchecked <tt>CannotExecuteException</tt>,
27     * which will be propagated to the caller of <tt>execute</tt>.
28     *
29     * @param r the runnable task requested to be executed
30     * @param isShutdown true if the ThreadExecutor has been shutdown
31     * @return false if <tt>execute</tt> should be retried, else true
32     * @throws CannotExecuteException if there is no remedy
33     */
34     boolean cannotExecute(Runnable r, boolean isShutdown);
35     }