package com.aionemu.commons.utils.concurrent;
import java.util.concurrent.RejectedExecutionException;
import java.util.concurrent.RejectedExecutionHandler;
import java.util.concurrent.ThreadPoolExecutor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* @author NB4L1
*/
public final class AionRejectedExecutionHandler implements RejectedExecutionHandler {
private static final Logger log = LoggerFactory.getLogger(AionRejectedExecutionHandler.class);
@Override
public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) {
if (executor.isShutdown())
return;
log.warn(r + " from " + executor, new RejectedExecutionException());
if (Thread.currentThread().getPriority() > Thread.NORM_PRIORITY)
new Thread(r).start();
else
r.run();
}
}
순위 | 닉네임 | 포인트 |
---|---|---|
1 |
![]() |
102,949 |
2 |
![]() |
63,733 |
3 |
![]() |
51,771 |
4 |
![]() |
36,923 |
5 |
![]() |
35,011 |
6 |
![]() |
29,470 |
7 |
![]() |
29,077 |
8 |
![]() |
28,199 |
9 |
![]() |
26,731 |
10 |
![]() |
17,020 |