package top.quantic.sentry.config;

import top.quantic.sentry.async.ExceptionHandlingAsyncTaskExecutor;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;
import org.springframework.aop.interceptor.SimpleAsyncUncaughtExceptionHandler;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.*;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;

import java.util.concurrent.Executor;

import javax.inject.Inject;

@Configuration
@EnableAsync
@EnableScheduling
public class AsyncConfiguration implements AsyncConfigurer {

    private final Logger log = LoggerFactory.getLogger(AsyncConfiguration.class);

    @Inject
    private JHipsterProperties jHipsterProperties;

    @Override
    @Bean(name = "taskExecutor")
    public Executor getAsyncExecutor() {
        log.debug("Creating Async Task Executor");
        ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
        executor.setCorePoolSize(jHipsterProperties.getAsync().getCorePoolSize());
        executor.setMaxPoolSize(jHipsterProperties.getAsync().getMaxPoolSize());
        executor.setQueueCapacity(jHipsterProperties.getAsync().getQueueCapacity());
        executor.setThreadNamePrefix("sentry-Executor-");
        return new ExceptionHandlingAsyncTaskExecutor(executor);
    }

    @Override
    public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() {
        return new SimpleAsyncUncaughtExceptionHandler();
    }
}

@@ -33,77 +33,8 @@
 g;%0A%0A
-import top.quantic.sentry.async.ExceptionHandlingAsyncTaskExecutor;%0A%0A
 impo
@@ -406,9 +406,152 @@
 ion.
-*
+AsyncConfigurer;%0Aimport org.springframework.scheduling.annotation.EnableAsync;%0Aimport org.springframework.scheduling.annotation.EnableScheduling
 ;%0Aim
@@ -617,32 +617,128 @@
 skExecutor;%0A
-%0A
 import 
+top.quantic.sentry.async.ExceptionHandlingAsyncTaskExecutor;%0A%0Aimport javax.inject.Inject;%0Aimport 
 java.util.co
@@ -758,37 +758,8 @@
 utor
-;%0A%0Aimport javax.inject.Inject
 ;%0A%0A@
@@ -1514,16 +1514,14 @@
 ix(%22
-sentry-E
+task-e
 xecu

Rename async task executor