2018-07-06 15:30:00 +02:00
|
|
|
package com.eu.habbo.threading;
|
|
|
|
|
2020-05-04 22:24:09 +02:00
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.LoggerFactory;
|
2018-07-06 15:30:00 +02:00
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.util.concurrent.ScheduledThreadPoolExecutor;
|
|
|
|
import java.util.concurrent.ThreadFactory;
|
|
|
|
|
2019-05-26 20:14:53 +02:00
|
|
|
public class HabboExecutorService extends ScheduledThreadPoolExecutor {
|
2020-05-04 22:24:09 +02:00
|
|
|
private static final Logger LOGGER = LoggerFactory.getLogger(HabboExecutorService.class);
|
|
|
|
|
2019-05-26 20:14:53 +02:00
|
|
|
public HabboExecutorService(int corePoolSize, ThreadFactory threadFactory) {
|
2018-07-06 15:30:00 +02:00
|
|
|
super(corePoolSize, threadFactory);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2019-05-26 20:14:53 +02:00
|
|
|
protected void afterExecute(Runnable r, Throwable t) {
|
2018-07-06 15:30:00 +02:00
|
|
|
super.afterExecute(r, t);
|
|
|
|
|
2019-05-26 20:14:53 +02:00
|
|
|
if (t != null && !(t instanceof IOException)) {
|
2020-05-04 22:24:09 +02:00
|
|
|
LOGGER.error("Error in HabboExecutorService", t);
|
2018-07-06 15:30:00 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|