提交 9508f41a 编写于 作者: J Juergen Hoeller

made InitDestroyAnnotationBeanPostProcessor's logger field transient (SPR-5962)

上级 d4c16e91
......@@ -16,6 +16,8 @@
package org.springframework.beans.factory.annotation;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.Serializable;
import java.lang.annotation.Annotation;
import java.lang.reflect.InvocationTargetException;
......@@ -66,13 +68,11 @@ import org.springframework.util.ReflectionUtils;
* @since 2.5
* @see #setInitAnnotationType
* @see #setDestroyAnnotationType
* @see org.springframework.context.annotation.CommonAnnotationBeanPostProcessor
*/
public class InitDestroyAnnotationBeanPostProcessor
implements DestructionAwareBeanPostProcessor, MergedBeanDefinitionPostProcessor, PriorityOrdered, Serializable {
/** Logger available to subclasses */
protected final Log logger = LogFactory.getLog(getClass());
protected transient Log logger = LogFactory.getLog(getClass());
private Class<? extends Annotation> initAnnotationType;
......@@ -224,6 +224,19 @@ public class InitDestroyAnnotationBeanPostProcessor
}
//---------------------------------------------------------------------
// Serialization support
//---------------------------------------------------------------------
private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException {
// Rely on default serialization; just initialize state after deserialization.
ois.defaultReadObject();
// Initialize transient fields.
this.logger = LogFactory.getLog(getClass());
}
/**
* Class representing information about annotated init and destroy methods.
*/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册