接口的使用
java.util.concurrent.RejectedExecutionHandler
使用 RejectedExecutionHandler 的包
-
RejectedExecutionHandler 在 java.util.concurrent 中的用法
修饰符和类型类描述static class抛出RejectedExecutionException的被拒绝任务的处理程序。static class被拒绝任务的处理程序直接在execute方法的调用线程中运行被拒绝的任务,除非执行程序已关闭,在这种情况下任务将被丢弃。static class被拒绝任务的处理程序会丢弃最早的未处理请求,然后重试execute,除非执行程序已关闭,在这种情况下任务将被丢弃。static class被拒绝任务的处理程序,它默默地丢弃被拒绝的任务。java.util.concurrent 中的方法,参数类型为 RejectedExecutionHandler修饰符和类型方法描述voidThreadPoolExecutor.setRejectedExecutionHandler(RejectedExecutionHandler handler) 为不可执行的任务设置一个新的处理程序。java.util.concurrent 中的构造函数,参数类型为 RejectedExecutionHandler修饰符构造方法描述ScheduledThreadPoolExecutor(int corePoolSize, RejectedExecutionHandler handler) 使用给定的初始参数创建一个新的ScheduledThreadPoolExecutor。ScheduledThreadPoolExecutor(int corePoolSize, ThreadFactory threadFactory, RejectedExecutionHandler handler) 使用给定的初始参数创建一个新的ScheduledThreadPoolExecutor。ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, RejectedExecutionHandler handler) 使用给定的初始参数和 默认线程工厂 创建一个新的ThreadPoolExecutor。ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory, RejectedExecutionHandler handler) 使用给定的初始参数创建一个新的ThreadPoolExecutor。