Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
spring-projects-issues opened this issue Aug 10, 2007 · 1 comment
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Aug 10, 2007

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

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

Since 2.5.2, we already follow the bean dependencies graph when propagating start/stop. So traditional bean references or depends-on specifications should work fine for defining lifecycle dependencies as well... This seems to be of sufficient power - and more natural than relying on the Ordered interface for this specific purpose.

Juergen

@spring-projects-issues spring-projects-issues added type: enhancement A general enhancement in: core Issues in core modules (aop, beans, core, context, expression) labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 2.5.2 milestone Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants