You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have the following situation:
A @ApplicationScoped bean needs to do something when it's closed.
Currently this is done using @PreDestroy.
I have 2 problems with that:
I can't comprehend if @PreDestory is currently even working because when I shutdown Quarkus in my IDE the method it's not executed at all (and yes the bean is instantiated)... This might be related to the dev mode
I would like to replace @PreDestory with AutoCloseable - because that's Standard Java and is better usable in e.g. UnitTests. Can this be done?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I have the following situation:
A
@ApplicationScopedbean needs to do something when it's closed.Currently this is done using
@PreDestroy.I have 2 problems with that:
@PreDestoryis currently even working because when I shutdown Quarkus in my IDE the method it's not executed at all (and yes the bean is instantiated)... This might be related to the dev mode@PreDestorywithAutoCloseable- because that's Standard Java and is better usable in e.g. UnitTests. Can this be done?For comparison: Spring Boot is quite straigh-forward in their docs how this works. I wasn't able to find anything related to this in the Quarkus docs besides that
@PostConstructand@PreDestoryexist.Beta Was this translation helpful? Give feedback.
All reactions