Q: Method used to process bean before initialization callback
Solution: You can process every bean before initialization callback method by implementing the postProcessBeforeInitialization() and methods.
Q: Method used to process bean after initialization callback
Solution: You can process every bean after initialization callback method by implementing the postProcessAfterInitialization() and methods.
Q: Which method is used to gracefully shutdown all the bean processes after closing the spring container?
Solution: ShutdownHook method gracefully shuts down each bean process before closing the container.
Q: Which method is used to register BeanPostProcessor?
Solution: When using a bean factory as your IoC container, bean post processors can only be registered programmatically, or more accurately, via the addBeanPostProcessor() method.
Q: Which Interface for bean Post Processor is used to distinguish between checked beans
Solution: First of all, for the bean post processor to distinguish which beans should be checked, you create a marker interface, StorageConfig, for your target beans to implement.
Q: Which method of bean post processors is used to check path existence
Solution: Moreover, for your bean post processor to check for path existence, it must be able to access the path property. This can be done by adding the getPath() method to this interface.
Q: PathCheckingBeanPostProcessor will not work properly in case of:-
Solution: This is because your bean post processor has a lower priority than CommonAnnotationBeanPostProcessor by default. As a result, the initialization method will be called before your path checking.
Q: Which bean factory post processor externalizes part of the bean configurations into a properties file
Solution: Spring comes with a bean factory post processor called PropertyPlaceholderConfigurer for you to externalize part of the bean configurations into a properties file.
Q: Which interface defines methods for resolving text messages
Solution: MessageSource is an interface that defines several methods for resolving messages.
Q: Which interface is used to listen to certain events
Solution: For a bean to listen to certain events, it must implement the ApplicationListener interface and handle the events in the onApplicationEvent() method.
You Have Score    | /10 |