Class DiscardWithCancelPolicy

Object
com.liferay.portal.kernel.concurrent.DiscardWithCancelPolicy
All Implemented Interfaces:
RejectedExecutionHandler

public class DiscardWithCancelPolicy extends Object implements RejectedExecutionHandler
Handles rejected tasks by canceling them immediately.

Use this policy for efficiently discarding rejected tasks. Unlike CallerRunsPolicy, this policy maintains the order of tasks in the task queue. Unlike DiscardOldestPolicy and DiscardPolicy, which ultimately call Future.get(), threads do not block waiting for a timeout.

Author:
Shuyang Zhou