@AutoConfiguration
(AutoConfiguration.imports)
@Conditional
—Debug
, —debug
옵션 - 자동 구성 클래스 Condition
결과 로그ConditionEvaluationReport
- 자동 구성 클래스 Condition 결과 빈ListableBeanFacotry
- 등록된 빈 확인@AutoConfiguration
, @Conditional
, @Condition
, @Bean
등 자동 구성 클래스와 조건, 빈 확인
-Ddebug
설정하면 빈 설정 리포트를 로그에서 확인할 수 있다.
Configuration
이 어떤 조건을 만족했기 때문에 구성되었는지 정보를 확인할 수 있다.AopAutoConfiguration matched: - @ConditionalOnProperty(spring.aop.auto=true) matched (OnPropertyCondition)
Configuration
도 확인 가능ConditionEvaluationReport
을 사용하면 된다.
—debug
옵션을 줬을 때와 비슷하게 출력할 수 있다.filter
구문에 조건을 넣어 특정 빈을 제외할 수도 있다.
filter( co → co.getKey().indexOf(”Jmx”) < 0)
@SpringBootApplication
public class SpringbootAcApplication {
@Bean
ApplicationRunner run(ConditionEvaluationReport report) {
return args -> {
report.getConditionAndOutcomesBySource().entrySet().stream()
.filter(co -> co.getValue().isFullMatch())
.forEach(co -> {
System.out.println(co.getKey());
co.getValue().forEach(c -> {
System.out.println("/t" + c.getOutcome());
});
System.out.println();
});
}
}
public static void main(String[] args) { SpringApplication.run(SpringbootAcApplication.class, args); }
}
AopAutoConfiguration
spring.aop.auto = true
인 경우 조건 만족matchIfMissing = true
설정으로 인해 spring.aop.auto라는 프로퍼티가 없어도 조건이 충족된다@AutoConfiguration
@ConditionalOnProperty(prefix = "spring.aop", name = "auto", havingValue = "true", matchIfMissing = true)
public class AopAutoConfiguration { ... }
GenericCacheConfiguration
, NoOpCacheConfiguration
, SimpleCacheConfiguration
LifecycleAutoConfiguartion
PropertyPlaceholderAutoConfiguration
PropertySourcesPlaceholderConfigurer
에 대한 자동 구성.@Value
어노테이션으로 프로퍼티 설정 시 필요TaskExecutionAutoConfiguration
ThreadPoolTaskExecutor
빈이다.coreSize = 8
maxSize = Integer.MAX_VALUE
queueCapacity = Integer.MAX_VALUE
coreSize
개 요청까지는 처리, 추가 작업은 queueCapacity
만큼 대기열에 추가, 대기열이 가득차면 maxSize
만큼 스레드풀에 스레드가 추가된다.HttpMessageConvertersAutoConfiguration
JacsonAutoconfiguration
RestTemplateAutoConfiguration
RestTemplate
관련 설정RestTemplate
대신 RestTemplateBuilder 빈을 자동으로 만들어준다.EmbeddedWebServerFactoryCustomizerAutoConfiguration
DispatcherServletAutoConfiguration
HttpEncodingAutoConfiguration
MultipartAutoConfiguration
WebMvcAutoConfiguration
ErrorMvcAutoConfiguration
WebSocketServletAutoConfiguration
PersistenceExceptionTranslationAutoConfiguration
DataSourceAutoConfiguration
DataSource
관련 설정DataSourceTransactionManagerAutoConfiguration
JdbcTemplateAutoConfiguration
JdbcTemplate
관련 설정TransactionAutoConfiguration