diff --git a/org.springframework.aop/src/test/java/org/springframework/aop/aspectj/annotation/AspectProxyFactoryTests.java b/org.springframework.aop/src/test/java/org/springframework/aop/aspectj/annotation/AspectProxyFactoryTests.java index 58c5b3226e0..9665203572b 100644 --- a/org.springframework.aop/src/test/java/org/springframework/aop/aspectj/annotation/AspectProxyFactoryTests.java +++ b/org.springframework.aop/src/test/java/org/springframework/aop/aspectj/annotation/AspectProxyFactoryTests.java @@ -16,15 +16,13 @@ package org.springframework.aop.aspectj.annotation; -import static org.junit.Assert.*; - import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Aspect; +import static org.junit.Assert.*; import org.junit.Test; - import test.aop.PerThisAspect; - +import test.util.SerializationTestUtils; /** * @author Rob Harrop @@ -88,8 +86,10 @@ public final class AspectProxyFactoryTests { proxyFactory.addAspect(aspect); ITestBean proxy = proxyFactory.getProxy(); - assertEquals(target.getAge() * multiple, proxy.getAge()); + + ITestBean serializedProxy = (ITestBean) SerializationTestUtils.serializeAndDeserialize(proxy); + assertEquals(target.getAge() * multiple, serializedProxy.getAge()); } @Test(expected=IllegalArgumentException.class) diff --git a/org.springframework.beans/src/main/java/org/springframework/beans/BeanWrapperImpl.java b/org.springframework.beans/src/main/java/org/springframework/beans/BeanWrapperImpl.java index 14c6dfef773..c11a97acdd8 100644 --- a/org.springframework.beans/src/main/java/org/springframework/beans/BeanWrapperImpl.java +++ b/org.springframework.beans/src/main/java/org/springframework/beans/BeanWrapperImpl.java @@ -101,6 +101,11 @@ public class BeanWrapperImpl extends AbstractPropertyAccessor implements BeanWra private TypeConverterDelegate typeConverterDelegate; + /** + * The security context used for invoking the property methods + */ + private AccessControlContext acc; + /** * Cached introspections results for this object, to prevent encountering * the cost of JavaBeans introspection every time. @@ -112,9 +117,6 @@ public class BeanWrapperImpl extends AbstractPropertyAccessor implements BeanWra */ private Map nestedBeanWrappers; - /** The security context used for invoking the property methods */ - private AccessControlContext acc; - private boolean autoGrowNestedPaths = false; @@ -216,16 +218,6 @@ public class BeanWrapperImpl extends AbstractPropertyAccessor implements BeanWra setIntrospectionClass(object.getClass()); } - /** - * Set the security context used during the invocation of the wrapped instance methods. - * Can be null. - * - * @param acc - */ - public void setSecurityContext(AccessControlContext acc) { - this.acc = acc; - } - public final Object getWrappedInstance() { return this.object; } @@ -274,6 +266,22 @@ public class BeanWrapperImpl extends AbstractPropertyAccessor implements BeanWra return this.autoGrowNestedPaths; } + /** + * Set the security context used during the invocation of the wrapped instance methods. + * Can be null. + */ + public void setSecurityContext(AccessControlContext acc) { + this.acc = acc; + } + + /** + * Return the security context used during the invocation of the wrapped instance methods. + * Can be null. + */ + public AccessControlContext getSecurityContext() { + return this.acc; + } + /** * Set the class to introspect. * Needs to be called when the target object changes. diff --git a/org.springframework.beans/src/main/java/org/springframework/beans/factory/config/ObjectFactoryCreatingFactoryBean.java b/org.springframework.beans/src/main/java/org/springframework/beans/factory/config/ObjectFactoryCreatingFactoryBean.java index f3301b5ef56..2a682a67559 100644 --- a/org.springframework.beans/src/main/java/org/springframework/beans/factory/config/ObjectFactoryCreatingFactoryBean.java +++ b/org.springframework.beans/src/main/java/org/springframework/beans/factory/config/ObjectFactoryCreatingFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2010 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -91,7 +91,7 @@ import org.springframework.util.Assert; * @see org.springframework.beans.factory.ObjectFactory * @see ServiceLocatorFactoryBean */ -public class ObjectFactoryCreatingFactoryBean extends AbstractFactoryBean { +public class ObjectFactoryCreatingFactoryBean extends AbstractFactoryBean { private String targetBeanName; @@ -123,7 +123,7 @@ public class ObjectFactoryCreatingFactoryBean extends AbstractFactoryBean { } @Override - protected Object createInstance() { + protected ObjectFactory createInstance() { return new ObjectFactory() { public Object getObject() throws BeansException { return getTargetBean(targetBeanName); diff --git a/org.springframework.context/src/main/java/org/springframework/scheduling/annotation/Scheduled.java b/org.springframework.context/src/main/java/org/springframework/scheduling/annotation/Scheduled.java index b1832076183..d0e2e289ba9 100644 --- a/org.springframework.context/src/main/java/org/springframework/scheduling/annotation/Scheduled.java +++ b/org.springframework.context/src/main/java/org/springframework/scheduling/annotation/Scheduled.java @@ -26,7 +26,7 @@ import java.lang.annotation.Target; * Annotation that marks a method to be scheduled. Exactly one of the * cron, fixedDelay, or fixedRate * attributes must be provided. - * + * *

The annotated method must expect no arguments and have a * void return type. * @@ -45,7 +45,6 @@ public @interface Scheduled { * triggers on the second as well as minute, hour, day of month, month * and day of week. e.g. "0 * * * * MON-FRI" means once * per minute on weekdays (at the top of the minute - the 0th second). - * * @return an expression that can be parsed to a cron schedule */ String cron() default ""; @@ -53,14 +52,12 @@ public @interface Scheduled { /** * Execute the annotated method with a fixed period between the end * of the last invocation and the start of the next. - * * @return the delay in milliseconds */ long fixedDelay() default -1; /** * Execute the annotated method with a fixed period between invocations. - * * @return the period in milliseconds */ long fixedRate() default -1;