Monday, September 13, 2021

@PostConstruct and @Predestroy

 @PostConstruct:  As soon as the bean is created and all the dependency is injected then @PostConstruct would be called.

@PreDestroy: As soon as the bean is removed from the container @Predestroy method is called. We can use where we need to release resources by the bean .


No comments:

Post a Comment

Clean code chapter 3(Robert C.martin)

  Summary: --------  1. Functions should hardly ever be 20 lines long.  2.Keep blocks (inside if, else, while, for, etc.) short.  Ideally, j...