Java in a Nutshell, 5th Edition [Electronic resources]

نسخه متنی -صفحه : 1191/ 805
نمايش فراداده

ThreadPoolExecutor.DiscardOldestPolicyjava.util.concurrent

Java 5.0

This RejectedExecutionHandler implementation discards the rejected Runnable if the ThreadPoolExecutor has been shut down. Otherwise, it discards the oldest pending task that has not run and tries again to execute( ) the rejected task.

public static class

ThreadPoolExecutor.DiscardOldestPolicy implements RejectedExecutionHandler { // Public Constructors public

DiscardOldestPolicy ( ); // Methods Implementing RejectedExecutionHandler public void

rejectedExecution (Runnable

r , ThreadPoolExecutor

e ); }