public class DiscardWithCancelPolicy
extends java.lang.Object
implements java.util.concurrent.RejectedExecutionHandler
Constructor and Description |
---|
DiscardWithCancelPolicy() |
Modifier and Type | Method and Description |
---|---|
void |
rejectedExecution(java.lang.Runnable runnable,
java.util.concurrent.ThreadPoolExecutor threadPoolExecutor)
Rejects execution of the
Runnable task by canceling it
immediately. |
public void rejectedExecution(java.lang.Runnable runnable, java.util.concurrent.ThreadPoolExecutor threadPoolExecutor)
Runnable
task by canceling it
immediately.
Important: The task can only be canceled if it is a subtype of Future
.
rejectedExecution
in interface java.util.concurrent.RejectedExecutionHandler
runnable
- the taskthreadPoolExecutor
- the executor