2V0-72.22PSE · Question #54
Which two statements are true concerning the BeanPostProcessor Extension point? (Choose two.)
The correct answer is B. Custom BeanPostProcessors can be implemented for Spring applications. D. BeanPostProcessors are called during the initialization phase of a bean life cycle. B and D are correct because BeanPostProcessor is a standard Spring extension point that developers can implement in custom classes (B), and it operates specifically during the initialization phase of the bean lifecycle - invoked both before (postProcessBeforeInitialization) and…
Question
Which two statements are true concerning the BeanPostProcessor Extension point? (Choose two.)
Options
- ABeanPostProcessors are called before the dependencies have been injected.
- BCustom BeanPostProcessors can be implemented for Spring applications.
- CBeanPostProcessors are called before the BeanFactoryPostProcessors.
- DBeanPostProcessors are called during the initialization phase of a bean life cycle.
- EBeanPostProcessors cannot be ordered in a Spring Boot application.
How the community answered
(29 responses)- A3% (1)
- B72% (21)
- C10% (3)
- E14% (4)
Explanation
B and D are correct because BeanPostProcessor is a standard Spring extension point that developers can implement in custom classes (B), and it operates specifically during the initialization phase of the bean lifecycle - invoked both before (postProcessBeforeInitialization) and after (postProcessAfterInitialization) a bean's init method runs (D).
Why the distractors are wrong:
- A is false - by the time
BeanPostProcessoris called, dependency injection has already occurred; it hooks into initialization, not population. - C is false -
BeanFactoryPostProcessorruns beforeBeanPostProcessor; factory-level processing happens first, then individual bean initialization. - E is false -
BeanPostProcessorimplementations can be ordered using theOrderedinterface or@Orderannotation, even in Spring Boot.
Memory tip: Think of the bean lifecycle in three stages - Instantiate → Populate (inject) → Initialize - and remember that BeanFactoryPostProcessor sounds "bigger" and runs earlier (factory level), while BeanPostProcessor is "smaller" and wraps each bean's init call. The word "Post" in both names refers to after bean definition loading, not after injection.
Topics
Community Discussion
No community discussion yet for this question.