uoa-repository-manager-service/src/main/java/eu/dnetlib/repo/manager/config/AsyncConfiguration.java

27 lines
983 B
Java

package eu.dnetlib.repo.manager.config;
import eu.dnetlib.repo.manager.service.ValidatorServiceImpl;
import org.apache.log4j.Logger;
import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.AsyncConfigurer;
import org.springframework.scheduling.annotation.EnableAsync;
import java.lang.reflect.Method;
@Configuration
@EnableAsync
public class AsyncConfiguration implements AsyncConfigurer {
@Override
public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() {
return new AsyncUncaughtExceptionHandler() {
private final Logger logger = Logger.getLogger(getClass());
@Override
public void handleUncaughtException(Throwable throwable, Method method, Object... objects) {
//logger.error("Async error", throwable);
}
};
}
}