Interface to be implemented by beans that want to release resources
on destruction. A BeanFactory is supposed to invoke the destroy
method if it disposes a cached singleton. An application context
is supposed to dispose all of its singletons on close.
An alternative to implementing DisposableBean is specifying a custom
destroy-method, for example in an XML bean definition.
For a list of all bean lifecycle methods, see the