Destroying instance of a bean

When bean is being unloaded, then reference to its instance is just dropped. However, if bean class implements UnregisterAware interface, then kernel calls beforeUnregister() method. This is very useful in case which bean acquires some resources during initialization and should release them now.


This method will not be called if bean was not initialized fully (bean initialization step was note passed)!