ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/concurrent/CannotExecuteHandler.java
Revision: 1.1
Committed: Wed May 14 21:30:45 2003 UTC (21 years ago) by tim
Branch: MAIN
Log Message:
Moved main source rooted at . to ./src/main
Moved test source rooted at ./etc/testcases to ./src/test

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     * @revised $Date: 2003/02/26 10:48:09 $
14     * @editor $Author: jozart $
15     */
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     }