Skip to content

Reference manual - document interactions / ordering when using multiple styles of bean lifecycle [SPR-3775] #8455

Closed
@spring-projects-issues

Description

@spring-projects-issues

Chris Lee opened SPR-3775 and commented

There are three styles for controlling bean lifecycle behaviour: InitializingBean/DisposableBean, bean methods names, and (new in 2.1) @PostConstruct and @PreDestroy.

The reference manual should document what happens when you 'mix' these options, specifically any side-effects and the order of applicability.

A use-case for this would be concrete inheritance - take, for example, DaoSupport which implements InitializingBean. It may well be that, on a given project, Spring is configured to call an init() method by default. What happens when a subclass of DaoSupport is initialized? In what order are afterPropertiesSet() and init() called? Any side-effects, recommendations, or warnings?


Affects: 2.0.6, 2.1 M3

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions