You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
프록시 팩토리 - 적용1
LogTraceAdvice
ProxyFactoryConfigV1
개인정리
정리
다.
빈으로 등록한다.
애플리케이션 로딩 로그

프록시 팩토리 - 적용2
ProxyFactoryConfigV2
애플리케이션 로딩 로그

정리
빈 후처리기
빈 후처리기 - 소개
빈 후처리기 - BeanPostProcessor
빈 후처리기 기능
빈 등록 과정을 빈 후처리기와 함께 살표보자
BasicConfig.class
조회
=> beanA 라는 이름으로 A 타입의 스프링 빈을 찾을 수 있다.
=> B 타입의 객체는 스프링 빈으로 등록한 적이 없기 때문에 스프링 컨테이너에서 찾을 수 없다.
테스트 결과

빈 후처리기 - 예제 코드2
BeanPostProceessor 인터페이스 - 스프링 제공
@PostConstruct같은 초기화가 발생하기 전에 호출되는 포스트 프로세서임@PostConstruct같은 초기화가 발생한 다음에 호출되는 포스트 프로세서BeanPostProcessorTest
AToBPostProcessor
BeanPostProcessor
BeanPostProcessor는 스프링 빈 등록 단계에 개입할 수 있는 시스템 레벨의 기능결과

B b = applicationContext.getBean("beanA", B.class)있다. A 는 스프링 빈으로 등록조차 되지 않는다.
정리
참고 -
@PostConstruct의 비밀@PostConstruct애노테이션이 붙은 초기화 메서드를 한번 호출만 하면 된다.CommonAnnotationBeanPostProcessor라는 빈 후처리기를 자동으로 등록하는데, 여기에서@PostConstruct애노테이션이 붙은 메서드를 호출한다. 따라서 스프링 스스로도 스프링 내부의 기능을 확장하기 위해 빈 후처리기를 사용한다.
All reactions