nerdexam
Broadcom-VMware

2V0-72.22PSE · Question #98

Which two statements about BeanFactoryPostProcessors are true? (Choose two.)

The correct answer is B. Allows for the transformation of Spring bean definitions before the beans are instantiated. D. PropertySourcesPlaceholderConfigurer implements BeanFactoryPostProcessor and is used to. BeanFactoryPostProcessor hooks into the Spring container lifecycle before bean instantiation, allowing it to read and modify bean definitions (the blueprints), not the beans themselves - making B correct and A wrong (A flips the timing to "after," which is backwards). D is…

Core Spring

Question

Which two statements about BeanFactoryPostProcessors are true? (Choose two.)

Options

  • AAllows for the transformation of Spring bean definitions after the beans have been instantiated.
  • BAllows for the transformation of Spring bean definitions before the beans are instantiated.
  • CCreates proxies for the Spring beans that require an extra behavior like transaction management.
  • DPropertySourcesPlaceholderConfigurer implements BeanFactoryPostProcessor and is used to
  • EDetects annotations such as @PostConstruct and @PreDestroy and then invokes appropriate

How the community answered

(42 responses)
  • B
    93% (39)
  • C
    2% (1)
  • E
    5% (2)

Explanation

BeanFactoryPostProcessor hooks into the Spring container lifecycle before bean instantiation, allowing it to read and modify bean definitions (the blueprints), not the beans themselves - making B correct and A wrong (A flips the timing to "after," which is backwards). D is correct because PropertySourcesPlaceholderConfigurer is the canonical real-world implementation: it resolves ${...} property placeholders in bean definitions at that exact pre-instantiation phase.

C is wrong because proxy creation (for transactions, AOP, etc.) is the job of BeanPostProcessor implementations like AbstractAutoProxyCreator - they operate on bean instances, not definitions. E is wrong for the same reason: @PostConstruct/@PreDestroy detection is handled by CommonAnnotationBeanPostProcessor, another BeanPostProcessor, not a BeanFactoryPostProcessor.

Memory tip: Add "Factory" = working with the factory's blueprints (definitions) before anything is built. No "Factory" (BeanPostProcessor) = working on the finished products (instances) after they're built. When you see PropertySourcesPlaceholderConfigurer, remember it must run before beans exist so it can inject property values into the definitions - that anchors both B and D together.

Topics

#BeanFactoryPostProcessor#Bean Lifecycle#Bean Definitions#PropertySourcesPlaceholderConfigurer

Community Discussion

No community discussion yet for this question.

Full 2V0-72.22PSE Practice