Skip to content

Fire Lifecycle callbacks respecting Ordered interface [SPR-3755] #8436

Closed
@spring-projects-issues

Description

@spring-projects-issues

Ben Rowlands opened SPR-3755 and commented

Some active components (ie, those that are started/stopped) have strict Lifecycle ordering requirements with respect to other components.

For example, a JMS message listener container should be started after any components used by the listener are started (otherwise we may receive messages from the container before these dependent components are started).

For example client transports used by the service will need to be started before the server is started. The shutdown order should be reversed so the input to the server is shutdown before the client transports are stopped (so any in flight messages can be flushed out before shutdown).

The only way to achieve this at the moment is to introduce a custom lifecycle interface (and propagate start/stop manually). Ideally we'd use the Ordered mix-in interface with Lifecycle to provide richer control over inter-component ordering (which should be reversed upon shutdown).

This is related to #7014


1 votes, 1 watchers

Metadata

Metadata

Assignees

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