public class CountingRejectedExecutionHandler extends Object implements RejectedExecutionHandler
Constructor and Description |
---|
CountingRejectedExecutionHandler(RejectedExecutionHandler delegate)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
long |
getRejectedTaskCount()
Returns the rejected task count.
|
static CountingRejectedExecutionHandler |
newAbortPolicy()
Returns a counting handler for rejected tasks that throws a RejectedExecutionException.
|
static CountingRejectedExecutionHandler |
newCallerRunsPolicy()
Returns a counting handler for rejected tasks that runs the rejected task directly in the
calling thread of the execute method, unless the executor has been shut down, in which case
the task is discarded.
|
static CountingRejectedExecutionHandler |
newCallerWaitsPolicy()
Returns a counting handler for rejected tasks that blocks on the
ThreadPoolExecutor 's backing queue until it can add the task to the queue. |
void |
rejectedExecution(Runnable task,
ThreadPoolExecutor executor) |
public CountingRejectedExecutionHandler(RejectedExecutionHandler delegate)
delegate
- the backing RejectedExecutionHandler.public void rejectedExecution(Runnable task, ThreadPoolExecutor executor)
rejectedExecution
in interface RejectedExecutionHandler
public long getRejectedTaskCount()
public static CountingRejectedExecutionHandler newCallerRunsPolicy()
public static CountingRejectedExecutionHandler newAbortPolicy()
public static CountingRejectedExecutionHandler newCallerWaitsPolicy()
ThreadPoolExecutor
's backing queue until it can add the task to the queue.Copyright © 2019 OpenDaylight. All rights reserved.