bean

Bean 생성 AnnotationConfigApplicationContext AnnotationConfigApplicationContext 클래스는 어노테이션을 읽어 bean을 등록하는 역할을 담당하고 있다. 그 중에서도 기본 생성자에 포함되어 반드시 호출하게 되어 있는 register라는 메소드를 살펴보았다. /** * Register one or more component classes to be processed. * Note that {@link #refresh()} must be called in order for the context * to fully process the new classes. * @param componentClasses one or more component classe..
Bean 생성 추적해보기 Spring core를 공부해보겠답시고 빌드한 뒤 소스코드를 두서없이 읽고만 있으려니, 진행이 안 되는 느낌이 들었다. 여긴 뭐고 저긴 또 뭔지... 그래서 실제로 앱을 실행한 뒤 추적하는 방법을 사용해보기로 하였다. core에 대해서 공부를 한 덕분에 추적 경로를 만들어서 디버깅을 할 수 있었다. 먼저, Spring boot 2 이상 버전을 사용하여 프로젝트를 생성해보자. @SpringBootApplication public class DemoApplication { public static void main(String[] args) { SpringApplication.run(DemoApplication.class, args); } }main은 위의 코드처럼 생성되었을 것이다..
감동이중요해
'bean' 태그의 글 목록