Grokking Spring Boot
Vote

0% completed

​

Bean Post-Processors

Who calls a method marked @PostConstruct? EmailSender never calls it, and nothing in the booking service mentions it. The container must find the annotation and make the call, yet the core of the container does not read that annotation.

The same question applies to @Autowired on a setter, and later to @Transactional, which makes a method run inside a database transaction although the method contains no transaction code. Each of these annotations is read by a separate object that the container consults for every bean it creates.

Those objects are bean post-processors

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content