|
1 | 1 | /*
|
2 |
| - * Copyright 2010-2022 the original author or authors. |
| 2 | + * Copyright 2010-2023 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
|
54 | 54 | import org.mybatis.spring.transaction.SpringManagedTransactionFactory;
|
55 | 55 | import org.springframework.beans.factory.FactoryBean;
|
56 | 56 | import org.springframework.beans.factory.InitializingBean;
|
57 |
| -import org.springframework.context.ApplicationEvent; |
58 | 57 | import org.springframework.context.ApplicationListener;
|
59 | 58 | import org.springframework.context.ConfigurableApplicationContext;
|
60 | 59 | import org.springframework.context.event.ContextRefreshedEvent;
|
|
87 | 86 | * @see #setDataSource
|
88 | 87 | */
|
89 | 88 | public class SqlSessionFactoryBean
|
90 |
| - implements FactoryBean<SqlSessionFactory>, InitializingBean, ApplicationListener<ApplicationEvent> { |
| 89 | + implements FactoryBean<SqlSessionFactory>, InitializingBean, ApplicationListener<ContextRefreshedEvent> { |
91 | 90 |
|
92 | 91 | private static final Logger LOGGER = LoggerFactory.getLogger(SqlSessionFactoryBean.class);
|
93 | 92 |
|
@@ -658,8 +657,8 @@ public boolean isSingleton() {
|
658 | 657 | * {@inheritDoc}
|
659 | 658 | */
|
660 | 659 | @Override
|
661 |
| - public void onApplicationEvent(ApplicationEvent event) { |
662 |
| - if (failFast && event instanceof ContextRefreshedEvent) { |
| 660 | + public void onApplicationEvent(ContextRefreshedEvent event) { |
| 661 | + if (failFast) { |
663 | 662 | // fail-fast -> check all statements are completed
|
664 | 663 | this.sqlSessionFactory.getConfiguration().getMappedStatementNames();
|
665 | 664 | }
|
|
0 commit comments