parent
8b2f7f0e64
commit
f3d6d1e43b
@ -0,0 +1,26 @@
|
|||||||
|
package com.ruoyi.common.enums;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
import java.util.concurrent.RejectedExecutionHandler;
|
||||||
|
import java.util.concurrent.ThreadPoolExecutor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 线程池 拒绝策略 泛型
|
||||||
|
*
|
||||||
|
* @author Lion Li
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum ThreadPoolRejectedPolicy {
|
||||||
|
|
||||||
|
CALLER_RUNS_POLICY("等待", ThreadPoolExecutor.CallerRunsPolicy.class),
|
||||||
|
DISCARD_OLDEST_POLICY("放弃最旧的", ThreadPoolExecutor.DiscardOldestPolicy.class),
|
||||||
|
DISCARD_POLICY("丢弃", ThreadPoolExecutor.DiscardPolicy.class),
|
||||||
|
ABORT_POLICY("中止", ThreadPoolExecutor.AbortPolicy.class);
|
||||||
|
|
||||||
|
private final String name;
|
||||||
|
private final Class<? extends RejectedExecutionHandler> clazz;
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Reference in new issue