1,开启异步线程,在启动类上加注解: 2,自定义线程池:
Configuration
public class PromotionConfig {Beanpublic Executor generateExchangeCodeExecutor() {ThreadPoolTaskExecutor executor new ThreadPoolTaskExec…
作用域 作用域案例
public class BeanScopeDemo {AutowiredQualifier("singletonPerson")Person person;AutowiredQualifier("prototypePerson")Person person1;AutowiredQualifier("prototypePerson")Person person2;AutowiredSet<Person&g…