public interface DestructionAwareBeanPostProcessor extends BeanPostProcessor
BeanPostProcessor
that adds a before-destruction callback.
The typical usage will be to invoke custom destruction callbacks on specific bean types, matching corresponding initialization callbacks.
Modifier and Type | Method and Description |
---|---|
void |
postProcessBeforeDestruction(Object bean,
String beanName)
Apply this BeanPostProcessor to the given bean instance before
its destruction.
|
postProcessAfterInitialization, postProcessBeforeInitialization
void postProcessBeforeDestruction(Object bean, String beanName) throws BeansException
Like DisposableBean's destroy
and a custom destroy method,
this callback just applies to singleton beans in the factory (including
inner beans).
bean
- the bean instance to be destroyedbeanName
- the name of the beanBeansException
- in case of errorsDisposableBean
,
AbstractBeanDefinition.setDestroyMethodName(java.lang.String)