Skip to content

PostConstruct and PreDestroy in Factory beans #11943

Closed Answered by graemerocher
karlmuscat asked this question in Q&A
Discussion options

You must be logged in to vote

write an @EventListener void onShutdown(Shutdown event) and invoke it yourself. You will have more control over shutdown this way. If you need actual graceful shutdown (ie waiting for threads to stop) implement GracefulShutdownCapable in your factory.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@karlmuscat
Comment options

@graemerocher
Comment options

@karlmuscat
Comment options

@graemerocher
Comment options

Answer selected by karlmuscat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants