Skip to content

Treat start/stop Lifecycle of beans like the init/destroy events [SPR-2325] #7014

Closed
@spring-projects-issues

Description

@spring-projects-issues

Michael Kanaley opened SPR-2325 and commented

Spring 2.0 now supports beans implementing the Lifecycle interface. I would like to see the start/stop functionality treated identically to that of init/destroy in the following ways:

  • declarative specification of start/stop methods.
    The bean element in the Spring XML configuration has init-method and destroy-method. I would like to see start-method and stop-method added so that beans are not required to implement any Spring interface to use this feature.

  • preserve start/stop order
    When initializing, beans are initialized by taking dependencies into consideration. Currently the implementation of start/stop does not take order into consideration so no two Lifecycle beans could rely on any order of being started. The start order should be the same as the init order. The stop order should be the reverse of the init order.


Affects: 2.0 RC2

Issue Links:

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions