O'Reilly logo

Pivotal Certified Professional Spring Developer Exam: A Study Guide by Iuliana Cosmina

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The log is the same as when the destroy method is specified using the destroy-method attribute. The DisposableBeanAdapter will call the destroy() method, so it will not be depicted again.

Also, you probably also suspect that if ComplexBean makes use of the @PreDestroy annotation, the dirty work will be done by a bean post processor. Further below you can see the implementation, configuration, and log:

import javax.annotation.PreDestroy;
public class ComplexBean {    private SimpleBean simpleBean1;    private SimpleBean simpleBean2;
    public ComplexBean(SimpleBean simpleBean1) {        logger.info("Stage 1: Calling the constructor.");        this.simpleBean1 = simpleBean1;    }
    @Required    public void setSimpleBean2(SimpleBean simpleBean2) ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required