Is the method @PreDestroy
of a prototype bean called when the bean is garbage collected ?
No, it is not called when the bean is garbage collected but for the bean to be garbage collected it has to be dereferenced first, which would mean it would have to be destroyed and @PreDestroy
be called.
So the method won't be called directly but it has to have been called before being garbage collected