|
8 | 8 | import io.ebean.Database; |
9 | 9 | import javax.annotation.Nonnull; |
10 | 10 | import lombok.extern.slf4j.Slf4j; |
11 | | -import org.springframework.beans.factory.annotation.Autowired; |
12 | 11 | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
13 | | -import org.springframework.context.ApplicationContext; |
14 | 12 | import org.springframework.context.annotation.Bean; |
15 | 13 | import org.springframework.context.annotation.Configuration; |
16 | | -import org.springframework.context.annotation.DependsOn; |
17 | 14 |
|
18 | 15 | @Slf4j |
19 | 16 | @Configuration |
20 | 17 | public class RestoreIndicesConfig { |
21 | | - @Autowired ApplicationContext applicationContext; |
22 | 18 |
|
23 | 19 | @Bean(name = "restoreIndices") |
24 | | - @DependsOn({ |
25 | | - "ebeanServer", |
26 | | - "entityService", |
27 | | - "systemMetadataService", |
28 | | - "searchService", |
29 | | - "graphService" |
30 | | - }) |
31 | 20 | @ConditionalOnProperty(name = "entityService.impl", havingValue = "ebean", matchIfMissing = true) |
32 | 21 | @Nonnull |
33 | | - public RestoreIndices createInstance() { |
34 | | - final Database ebeanServer = applicationContext.getBean(Database.class); |
35 | | - final EntityService<?> entityService = applicationContext.getBean(EntityService.class); |
36 | | - final SystemMetadataService systemMetadataService = |
37 | | - applicationContext.getBean(SystemMetadataService.class); |
38 | | - final EntitySearchService entitySearchService = |
39 | | - applicationContext.getBean(EntitySearchService.class); |
40 | | - final GraphService graphService = applicationContext.getBean(GraphService.class); |
41 | | - |
| 22 | + public RestoreIndices createInstance( |
| 23 | + final Database ebeanServer, |
| 24 | + final EntityService<?> entityService, |
| 25 | + final EntitySearchService entitySearchService, |
| 26 | + final GraphService graphService, |
| 27 | + final SystemMetadataService systemMetadataService) { |
42 | 28 | return new RestoreIndices( |
43 | 29 | ebeanServer, entityService, systemMetadataService, entitySearchService, graphService); |
44 | 30 | } |
|
0 commit comments