List of usage examples for org.springframework.beans.factory.support DisposableBeanAdapter DisposableBeanAdapter
private DisposableBeanAdapter(Object bean, String beanName, boolean invokeDisposableBean, boolean nonPublicAccessAllowed, @Nullable String destroyMethodName, @Nullable List<DestructionAwareBeanPostProcessor> postProcessors)
From source file:org.springframework.beans.factory.support.DisposableBeanAdapter.java
/** * Serializes a copy of the state of this class, * filtering out non-serializable BeanPostProcessors. */// www. j ava2 s . c o m protected Object writeReplace() { List<DestructionAwareBeanPostProcessor> serializablePostProcessors = null; if (this.beanPostProcessors != null) { serializablePostProcessors = new ArrayList<>(); for (DestructionAwareBeanPostProcessor postProcessor : this.beanPostProcessors) { if (postProcessor instanceof Serializable) { serializablePostProcessors.add(postProcessor); } } } return new DisposableBeanAdapter(this.bean, this.beanName, this.invokeDisposableBean, this.nonPublicAccessAllowed, this.destroyMethodName, serializablePostProcessors); }