PostConstruct and PreDestroy in Factory beans #11943
-
Can someone explain why
In the above, the log lines are never printed. Is there another way how to do this? |
Beta Was this translation helpful? Give feedback.
Answered by
graemerocher
Jul 14, 2025
Replies: 1 comment 4 replies
-
The factory beans are not processed for the pre/post annotations |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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) implementGracefulShutdownCapable
in your factory.