Browse Source

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

pull/23217/head
Juergen Hoeller 15 years ago
parent
commit
9508f41a91
  1. 19
      org.springframework.beans/src/main/java/org/springframework/beans/factory/annotation/InitDestroyAnnotationBeanPostProcessor.java

19
org.springframework.beans/src/main/java/org/springframework/beans/factory/annotation/InitDestroyAnnotationBeanPostProcessor.java

@ -16,6 +16,8 @@ @@ -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; @@ -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 @@ -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.
*/

Loading…
Cancel
Save