diff --git a/build.third_step1.gradle b/build.third_step1.gradle index ad905a76c..c429fd885 100644 --- a/build.third_step1.gradle +++ b/build.third_step1.gradle @@ -31,6 +31,7 @@ sourceSets{ "${srcDir}/fine-poi/src", "${srcDir}/fine-quartz/src", "${srcDir}/fine-commons-io/src", + "${srcDir}/fine-portlet-api/src", "${srcDir}/fine-commons-fileupload/src", "${srcDir}/fine-commons-lang3/src", "${srcDir}/fine-commons-collections4/src" @@ -78,6 +79,7 @@ task copyFiles(type:Copy,dependsOn:'compileJava'){ with dataContent.call("${srcDir}/fine-poi/src") with dataContent.call("${srcDir}/fine-quartz/src") with dataContent.call("${srcDir}/fine-commons-io/src") + with dataContent.call("${srcDir}/fine-portlet-api/src") with dataContent.call("${srcDir}/fine-commons-fileupload/src") into "${classesDir}" } diff --git a/fine-commons-fileupload/lib/javax.servlet-api-3.0.1.jar b/fine-commons-fileupload/lib/javax.servlet-api-3.0.1.jar new file mode 100644 index 000000000..4e2edcc9d Binary files /dev/null and b/fine-commons-fileupload/lib/javax.servlet-api-3.0.1.jar differ diff --git a/fine-commons-fileupload/src/com/fr/third/org/apache/commons/fileupload/portlet/PortletFileUpload.java b/fine-commons-fileupload/src/com/fr/third/org/apache/commons/fileupload/portlet/PortletFileUpload.java index d8cddda00..4202acee6 100755 --- a/fine-commons-fileupload/src/com/fr/third/org/apache/commons/fileupload/portlet/PortletFileUpload.java +++ b/fine-commons-fileupload/src/com/fr/third/org/apache/commons/fileupload/portlet/PortletFileUpload.java @@ -19,7 +19,7 @@ package com.fr.third.org.apache.commons.fileupload.portlet; import java.io.IOException; import java.util.List; -import javax.portlet.ActionRequest; +import com.fr.third.javax.portlet.ActionRequest; import com.fr.third.org.apache.commons.fileupload.FileItemFactory; import com.fr.third.org.apache.commons.fileupload.FileItemIterator; diff --git a/fine-commons-fileupload/src/com/fr/third/org/apache/commons/fileupload/portlet/PortletRequestContext.java b/fine-commons-fileupload/src/com/fr/third/org/apache/commons/fileupload/portlet/PortletRequestContext.java index d4cfd0a4e..d784994fc 100755 --- a/fine-commons-fileupload/src/com/fr/third/org/apache/commons/fileupload/portlet/PortletRequestContext.java +++ b/fine-commons-fileupload/src/com/fr/third/org/apache/commons/fileupload/portlet/PortletRequestContext.java @@ -18,7 +18,7 @@ package com.fr.third.org.apache.commons.fileupload.portlet; import java.io.InputStream; import java.io.IOException; -import javax.portlet.ActionRequest; +import com.fr.third.javax.portlet.ActionRequest; import com.fr.third.org.apache.commons.fileupload.RequestContext; /** diff --git a/fine-commons-fileupload/src/com/fr/third/org/apache/commons/fileupload/servlet/FileCleanerCleanup.java b/fine-commons-fileupload/src/com/fr/third/org/apache/commons/fileupload/servlet/FileCleanerCleanup.java index c1270a181..a545410ca 100755 --- a/fine-commons-fileupload/src/com/fr/third/org/apache/commons/fileupload/servlet/FileCleanerCleanup.java +++ b/fine-commons-fileupload/src/com/fr/third/org/apache/commons/fileupload/servlet/FileCleanerCleanup.java @@ -24,7 +24,7 @@ import com.fr.third.org.apache.commons.io.FileCleaner; /** * A servlet context listener, which ensures that the - * {@link org.apache.commons.io.FileCleaner FileCleaner's} + * {@link com.fr.third.org.apache.commons.io.FileCleaner FileCleaner's} * reaper thread is terminated, * when the web application is destroyed. */ diff --git a/fine-spring/fine-spring.iml b/fine-spring/fine-spring.iml index f7a68fea2..13858cac5 100644 --- a/fine-spring/fine-spring.iml +++ b/fine-spring/fine-spring.iml @@ -8,5 +8,12 @@ + + + + + + + \ No newline at end of file diff --git a/fine-spring/lib/commons-logging-1.2.jar b/fine-spring/lib/commons-logging-1.2.jar new file mode 100644 index 000000000..93a3b9f6d Binary files /dev/null and b/fine-spring/lib/commons-logging-1.2.jar differ diff --git a/fine-spring/src/com/fr/third/springframework/aop/aspectj/AspectJProxyFactory.java b/fine-spring/src/com/fr/third/springframework/aop/aspectj/AspectJProxyFactory.java index 4981e8a5d..f86660b29 100644 --- a/fine-spring/src/com/fr/third/springframework/aop/aspectj/AspectJProxyFactory.java +++ b/fine-spring/src/com/fr/third/springframework/aop/aspectj/AspectJProxyFactory.java @@ -20,7 +20,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import com.fr.third.aspectj.lang.annotation.AspectMetadata; import com.fr.third.aspectj.lang.reflect.PerClauseKind; import com.fr.third.springframework.aop.Advisor; @@ -91,7 +90,7 @@ public class AspectJProxyFactory extends ProxyCreatorSupport { public void addAspect(Object aspectInstance) { Class aspectClass = aspectInstance.getClass(); String aspectName = aspectClass.getName(); - com.fr.third.aspectj.lang.annotation.AspectMetadata am = createAspectMetadata(aspectClass, aspectName); + AspectMetadata am = createAspectMetadata(aspectClass, aspectName); if (am.getAjType().getPerClause().getKind() != PerClauseKind.SINGLETON) { throw new IllegalArgumentException( "Aspect class [" + aspectClass.getName() + "] does not define a singleton aspect"); diff --git a/fine-spring/src/com/fr/third/springframework/aop/aspectj/AspectMetadata.java b/fine-spring/src/com/fr/third/springframework/aop/aspectj/AspectMetadata.java index cdbbb5e63..4e7f3f0c9 100644 --- a/fine-spring/src/com/fr/third/springframework/aop/aspectj/AspectMetadata.java +++ b/fine-spring/src/com/fr/third/springframework/aop/aspectj/AspectMetadata.java @@ -14,17 +14,16 @@ * limitations under the License. */ -package com.fr.third.aspectj.lang.annotation; +package com.fr.third.springframework.aop.aspectj; import com.fr.third.aspectj.lang.reflect.AjType; import com.fr.third.aspectj.lang.reflect.AjTypeSystem; import com.fr.third.aspectj.lang.reflect.PerClauseKind; import com.fr.third.springframework.aop.Pointcut; -import com.fr.third.springframework.aop.aspectj.AspectJExpressionPointcut; -import com.fr.third.springframework.aop.aspectj.TypePatternClassFilter; import com.fr.third.springframework.aop.framework.AopConfigException; import com.fr.third.springframework.aop.support.ComposablePointcut; +import org.aspectj.lang.annotation.Aspect; /** * Metadata for an AspectJ aspect class, with an additional Spring AOP pointcut @@ -37,7 +36,7 @@ import com.fr.third.springframework.aop.support.ComposablePointcut; * @author Rod Johnson * @author Juergen Hoeller * @since 2.0 - * @see com.fr.third.aspectj.AspectJExpressionPointcut + * @see com.fr.third.springframework.aop.aspectj.AspectJExpressionPointcut */ public class AspectMetadata { diff --git a/fine-spring/src/com/fr/third/springframework/aop/aspectj/BeanFactoryAspectInstanceFactory.java b/fine-spring/src/com/fr/third/springframework/aop/aspectj/BeanFactoryAspectInstanceFactory.java index 461945967..92e214320 100644 --- a/fine-spring/src/com/fr/third/springframework/aop/aspectj/BeanFactoryAspectInstanceFactory.java +++ b/fine-spring/src/com/fr/third/springframework/aop/aspectj/BeanFactoryAspectInstanceFactory.java @@ -16,7 +16,6 @@ package com.fr.third.springframework.aop.aspectj; -import com.fr.third.aspectj.lang.annotation.AspectMetadata; import com.fr.third.springframework.beans.factory.BeanFactory; import com.fr.third.springframework.beans.factory.config.ConfigurableBeanFactory; import com.fr.third.springframework.core.Ordered; diff --git a/fine-spring/src/com/fr/third/springframework/aop/aspectj/BeanFactoryAspectJAdvisorsBuilder.java b/fine-spring/src/com/fr/third/springframework/aop/aspectj/BeanFactoryAspectJAdvisorsBuilder.java index 11f00856f..065157935 100644 --- a/fine-spring/src/com/fr/third/springframework/aop/aspectj/BeanFactoryAspectJAdvisorsBuilder.java +++ b/fine-spring/src/com/fr/third/springframework/aop/aspectj/BeanFactoryAspectJAdvisorsBuilder.java @@ -22,7 +22,6 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; -import com.fr.third.aspectj.lang.annotation.AspectMetadata; import com.fr.third.aspectj.lang.reflect.PerClauseKind; import com.fr.third.springframework.aop.Advisor; diff --git a/fine-spring/src/com/fr/third/springframework/aop/aspectj/InstantiationModelAwarePointcutAdvisorImpl.java b/fine-spring/src/com/fr/third/springframework/aop/aspectj/InstantiationModelAwarePointcutAdvisorImpl.java index 4d0653572..d18fc2da5 100644 --- a/fine-spring/src/com/fr/third/springframework/aop/aspectj/InstantiationModelAwarePointcutAdvisorImpl.java +++ b/fine-spring/src/com/fr/third/springframework/aop/aspectj/InstantiationModelAwarePointcutAdvisorImpl.java @@ -16,256 +16,249 @@ package com.fr.third.springframework.aop.aspectj; -import java.lang.reflect.Method; - -import org.aopalliance.aop.Advice; import com.fr.third.aspectj.lang.reflect.PerClauseKind; - import com.fr.third.springframework.aop.Pointcut; import com.fr.third.springframework.aop.support.DynamicMethodMatcherPointcut; import com.fr.third.springframework.aop.support.Pointcuts; +import org.aopalliance.aop.Advice; -import static com.fr.third.springframework.aop.aspectj.AbstractAspectJAdvisorFactory.AspectJAnnotationType.AtAfter; -import static com.fr.third.springframework.aop.aspectj.AbstractAspectJAdvisorFactory.AspectJAnnotationType.AtAfterReturning; -import static com.fr.third.springframework.aop.aspectj.AbstractAspectJAdvisorFactory.AspectJAnnotationType.AtAfterThrowing; -import static com.fr.third.springframework.aop.aspectj.AbstractAspectJAdvisorFactory.AspectJAnnotationType.AtAround; -import static com.fr.third.springframework.aop.aspectj.AbstractAspectJAdvisorFactory.AspectJAnnotationType.AtPointcut; +import java.lang.reflect.Method; /** - * Internal implementation of AspectJPointcutAdvisor. - * Note that there will be one instance of this advisor for each target method. + * Internal implementation of AspectJPointcutAdvisor. Note that there will be one instance of this + * advisor for each target method. * * @author Rod Johnson * @author Juergen Hoeller * @since 2.0 */ class InstantiationModelAwarePointcutAdvisorImpl - implements InstantiationModelAwarePointcutAdvisor, AspectJPrecedenceInformation { - - private final AspectJExpressionPointcut declaredPointcut; - - private Pointcut pointcut; - - private final MetadataAwareAspectInstanceFactory aspectInstanceFactory; - - private final Method method; - - private final boolean lazy; - - private final AspectJAdvisorFactory atAspectJAdvisorFactory; - - private Advice instantiatedAdvice; - - private int declarationOrder; - - private String aspectName; - - private Boolean isBeforeAdvice; - - private Boolean isAfterAdvice; - - - public InstantiationModelAwarePointcutAdvisorImpl(AspectJAdvisorFactory af, AspectJExpressionPointcut ajexp, - MetadataAwareAspectInstanceFactory aif, Method method, int declarationOrderInAspect, String aspectName) { - - this.declaredPointcut = ajexp; - this.method = method; - this.atAspectJAdvisorFactory = af; - this.aspectInstanceFactory = aif; - this.declarationOrder = declarationOrderInAspect; - this.aspectName = aspectName; - - if (aif.getAspectMetadata().isLazilyInstantiated()) { - // Static part of the pointcut is a lazy type. - Pointcut preInstantiationPointcut = - Pointcuts.union(aif.getAspectMetadata().getPerClausePointcut(), this.declaredPointcut); - - // Make it dynamic: must mutate from pre-instantiation to post-instantiation state. - // If it's not a dynamic pointcut, it may be optimized out - // by the Spring AOP infrastructure after the first evaluation. - this.pointcut = new PerTargetInstantiationModelPointcut(this.declaredPointcut, preInstantiationPointcut, aif); - this.lazy = true; - } - else { - // A singleton aspect. - this.instantiatedAdvice = instantiateAdvice(this.declaredPointcut); - this.pointcut = declaredPointcut; - this.lazy = false; - } - } - - - /** - * The pointcut for Spring AOP to use. Actual behaviour of the pointcut will change - * depending on the state of the advice. - */ - @Override - public Pointcut getPointcut() { - return this.pointcut; - } - - /** - * This is only of interest for Spring AOP: AspectJ instantiation semantics - * are much richer. In AspectJ terminology, all a return of {@code true} - * means here is that the aspect is not a SINGLETON. - */ - @Override - public boolean isPerInstance() { - return (getAspectMetadata().getAjType().getPerClause().getKind() != PerClauseKind.SINGLETON); - } - - /** - * Return the AspectJ AspectMetadata for this advisor. - */ - public com.fr.third.aspectj.lang.annotation.AspectMetadata getAspectMetadata() { - return this.aspectInstanceFactory.getAspectMetadata(); - } - - /** - * Lazily instantiate advice if necessary. - */ - @Override - public synchronized Advice getAdvice() { - if (this.instantiatedAdvice == null) { - this.instantiatedAdvice = instantiateAdvice(this.declaredPointcut); - } - return this.instantiatedAdvice; - } - - @Override - public boolean isLazy() { - return this.lazy; - } - - @Override - public synchronized boolean isAdviceInstantiated() { - return (this.instantiatedAdvice != null); - } - - - private Advice instantiateAdvice(AspectJExpressionPointcut pcut) { - return this.atAspectJAdvisorFactory.getAdvice( - this.method, pcut, this.aspectInstanceFactory, this.declarationOrder, this.aspectName); - } - - public MetadataAwareAspectInstanceFactory getAspectInstanceFactory() { - return this.aspectInstanceFactory; - } - - public AspectJExpressionPointcut getDeclaredPointcut() { - return this.declaredPointcut; - } - - @Override - public int getOrder() { - return this.aspectInstanceFactory.getOrder(); - } - - @Override - public String getAspectName() { - return this.aspectName; - } - - @Override - public int getDeclarationOrder() { - return this.declarationOrder; - } - - @Override - public boolean isBeforeAdvice() { - if (this.isBeforeAdvice == null) { - determineAdviceType(); - } - return this.isBeforeAdvice; - } - - @Override - public boolean isAfterAdvice() { - if (this.isAfterAdvice == null) { - determineAdviceType(); - } - return this.isAfterAdvice; - } - - /** - * Duplicates some logic from getAdvice, but importantly does not force - * creation of the advice. - */ - private void determineAdviceType() { - AbstractAspectJAdvisorFactory.AspectJAnnotation aspectJAnnotation = - AbstractAspectJAdvisorFactory.findAspectJAnnotationOnMethod(this.method); - if (aspectJAnnotation == null) { - this.isBeforeAdvice = false; - this.isAfterAdvice = false; - } - else { - switch (aspectJAnnotation.getAnnotationType()) { - case AtAfter: - case AtAfterReturning: - case AtAfterThrowing: - this.isAfterAdvice = true; - this.isBeforeAdvice = false; - break; - case AtAround: - case AtPointcut: - this.isAfterAdvice = false; - this.isBeforeAdvice = false; - break; - case AtBefore: - this.isAfterAdvice = false; - this.isBeforeAdvice = true; - } - } - } - - - @Override - public String toString() { - return "InstantiationModelAwarePointcutAdvisor: expression [" + getDeclaredPointcut().getExpression() + - "]; advice method [" + this.method + "]; perClauseKind=" + - this.aspectInstanceFactory.getAspectMetadata().getAjType().getPerClause().getKind(); - - } - - - /** - * Pointcut implementation that changes its behaviour when the advice is instantiated. - * Note that this is a dynamic pointcut. Otherwise it might - * be optimized out if it does not at first match statically. - */ - private class PerTargetInstantiationModelPointcut extends DynamicMethodMatcherPointcut { - - private final AspectJExpressionPointcut declaredPointcut; - - private final Pointcut preInstantiationPointcut; - - private LazySingletonAspectInstanceFactoryDecorator aspectInstanceFactory; - - private PerTargetInstantiationModelPointcut(AspectJExpressionPointcut declaredPointcut, - Pointcut preInstantiationPointcut, MetadataAwareAspectInstanceFactory aspectInstanceFactory) { - this.declaredPointcut = declaredPointcut; - this.preInstantiationPointcut = preInstantiationPointcut; - if (aspectInstanceFactory instanceof LazySingletonAspectInstanceFactoryDecorator) { - this.aspectInstanceFactory = (LazySingletonAspectInstanceFactoryDecorator) aspectInstanceFactory; - } - } - - @Override - public boolean matches(Method method, Class targetClass) { - // We're either instantiated and matching on declared pointcut, or uninstantiated matching on either pointcut - return (isAspectMaterialized() && this.declaredPointcut.matches(method, targetClass)) || - this.preInstantiationPointcut.getMethodMatcher().matches(method, targetClass); - } - - @Override - public boolean matches(Method method, Class targetClass, Object[] args) { - // This can match only on declared pointcut. - return (isAspectMaterialized() && this.declaredPointcut.matches(method, targetClass)); - } - - private boolean isAspectMaterialized() { - return (this.aspectInstanceFactory == null || this.aspectInstanceFactory.isMaterialized()); - } - } - + implements InstantiationModelAwarePointcutAdvisor, AspectJPrecedenceInformation { + + private final AspectJExpressionPointcut declaredPointcut; + + private Pointcut pointcut; + + private final MetadataAwareAspectInstanceFactory aspectInstanceFactory; + + private final Method method; + + private final boolean lazy; + + private final AspectJAdvisorFactory atAspectJAdvisorFactory; + + private Advice instantiatedAdvice; + + private int declarationOrder; + + private String aspectName; + + private Boolean isBeforeAdvice; + + private Boolean isAfterAdvice; + + public InstantiationModelAwarePointcutAdvisorImpl( + AspectJAdvisorFactory af, + AspectJExpressionPointcut ajexp, + MetadataAwareAspectInstanceFactory aif, + Method method, + int declarationOrderInAspect, + String aspectName) { + + this.declaredPointcut = ajexp; + this.method = method; + this.atAspectJAdvisorFactory = af; + this.aspectInstanceFactory = aif; + this.declarationOrder = declarationOrderInAspect; + this.aspectName = aspectName; + + if (aif.getAspectMetadata().isLazilyInstantiated()) { + // Static part of the pointcut is a lazy type. + Pointcut preInstantiationPointcut = + Pointcuts.union(aif.getAspectMetadata().getPerClausePointcut(), this.declaredPointcut); + + // Make it dynamic: must mutate from pre-instantiation to post-instantiation state. + // If it's not a dynamic pointcut, it may be optimized out + // by the Spring AOP infrastructure after the first evaluation. + this.pointcut = + new PerTargetInstantiationModelPointcut( + this.declaredPointcut, preInstantiationPointcut, aif); + this.lazy = true; + } else { + // A singleton aspect. + this.instantiatedAdvice = instantiateAdvice(this.declaredPointcut); + this.pointcut = declaredPointcut; + this.lazy = false; + } + } + + /** + * The pointcut for Spring AOP to use. Actual behaviour of the pointcut will change depending on + * the state of the advice. + */ + @Override + public Pointcut getPointcut() { + return this.pointcut; + } + + /** + * This is only of interest for Spring AOP: AspectJ instantiation semantics are much richer. In + * AspectJ terminology, all a return of {@code true} means here is that the aspect is not a + * SINGLETON. + */ + @Override + public boolean isPerInstance() { + return (getAspectMetadata().getAjType().getPerClause().getKind() != PerClauseKind.SINGLETON); + } + + /** Return the AspectJ AspectMetadata for this advisor. */ + public AspectMetadata getAspectMetadata() { + return this.aspectInstanceFactory.getAspectMetadata(); + } + + /** Lazily instantiate advice if necessary. */ + @Override + public synchronized Advice getAdvice() { + if (this.instantiatedAdvice == null) { + this.instantiatedAdvice = instantiateAdvice(this.declaredPointcut); + } + return this.instantiatedAdvice; + } + + @Override + public boolean isLazy() { + return this.lazy; + } + + @Override + public synchronized boolean isAdviceInstantiated() { + return (this.instantiatedAdvice != null); + } + + private Advice instantiateAdvice(AspectJExpressionPointcut pcut) { + return this.atAspectJAdvisorFactory.getAdvice( + this.method, pcut, this.aspectInstanceFactory, this.declarationOrder, this.aspectName); + } + + public MetadataAwareAspectInstanceFactory getAspectInstanceFactory() { + return this.aspectInstanceFactory; + } + + public AspectJExpressionPointcut getDeclaredPointcut() { + return this.declaredPointcut; + } + + @Override + public int getOrder() { + return this.aspectInstanceFactory.getOrder(); + } + + @Override + public String getAspectName() { + return this.aspectName; + } + + @Override + public int getDeclarationOrder() { + return this.declarationOrder; + } + + @Override + public boolean isBeforeAdvice() { + if (this.isBeforeAdvice == null) { + determineAdviceType(); + } + return this.isBeforeAdvice; + } + + @Override + public boolean isAfterAdvice() { + if (this.isAfterAdvice == null) { + determineAdviceType(); + } + return this.isAfterAdvice; + } + + /** + * Duplicates some logic from getAdvice, but importantly does not force creation of the advice. + */ + private void determineAdviceType() { + AbstractAspectJAdvisorFactory.AspectJAnnotation aspectJAnnotation = + AbstractAspectJAdvisorFactory.findAspectJAnnotationOnMethod(this.method); + if (aspectJAnnotation == null) { + this.isBeforeAdvice = false; + this.isAfterAdvice = false; + } else { + switch (aspectJAnnotation.getAnnotationType()) { + case AtAfter: + case AtAfterReturning: + case AtAfterThrowing: + this.isAfterAdvice = true; + this.isBeforeAdvice = false; + break; + case AtAround: + case AtPointcut: + this.isAfterAdvice = false; + this.isBeforeAdvice = false; + break; + case AtBefore: + this.isAfterAdvice = false; + this.isBeforeAdvice = true; + } + } + } + + @Override + public String toString() { + return "InstantiationModelAwarePointcutAdvisor: expression [" + + getDeclaredPointcut().getExpression() + + "]; advice method [" + + this.method + + "]; perClauseKind=" + + this.aspectInstanceFactory.getAspectMetadata().getAjType().getPerClause().getKind(); + } + + /** + * Pointcut implementation that changes its behaviour when the advice is instantiated. Note that + * this is a dynamic pointcut. Otherwise it might be optimized out if it does not at first + * match statically. + */ + private class PerTargetInstantiationModelPointcut extends DynamicMethodMatcherPointcut { + + private final AspectJExpressionPointcut declaredPointcut; + + private final Pointcut preInstantiationPointcut; + + private LazySingletonAspectInstanceFactoryDecorator aspectInstanceFactory; + + private PerTargetInstantiationModelPointcut( + AspectJExpressionPointcut declaredPointcut, + Pointcut preInstantiationPointcut, + MetadataAwareAspectInstanceFactory aspectInstanceFactory) { + this.declaredPointcut = declaredPointcut; + this.preInstantiationPointcut = preInstantiationPointcut; + if (aspectInstanceFactory instanceof LazySingletonAspectInstanceFactoryDecorator) { + this.aspectInstanceFactory = + (LazySingletonAspectInstanceFactoryDecorator) aspectInstanceFactory; + } + } + + @Override + public boolean matches(Method method, Class targetClass) { + // We're either instantiated and matching on declared pointcut, or uninstantiated matching on + // either pointcut + return (isAspectMaterialized() && this.declaredPointcut.matches(method, targetClass)) + || this.preInstantiationPointcut.getMethodMatcher().matches(method, targetClass); + } + + @Override + public boolean matches(Method method, Class targetClass, Object[] args) { + // This can match only on declared pointcut. + return (isAspectMaterialized() && this.declaredPointcut.matches(method, targetClass)); + } + + private boolean isAspectMaterialized() { + return (this.aspectInstanceFactory == null || this.aspectInstanceFactory.isMaterialized()); + } + } } diff --git a/fine-spring/src/com/fr/third/springframework/aop/aspectj/LazySingletonAspectInstanceFactoryDecorator.java b/fine-spring/src/com/fr/third/springframework/aop/aspectj/LazySingletonAspectInstanceFactoryDecorator.java index 5d6c0b584..5a04eadee 100644 --- a/fine-spring/src/com/fr/third/springframework/aop/aspectj/LazySingletonAspectInstanceFactoryDecorator.java +++ b/fine-spring/src/com/fr/third/springframework/aop/aspectj/LazySingletonAspectInstanceFactoryDecorator.java @@ -16,7 +16,6 @@ package com.fr.third.springframework.aop.aspectj; -import com.fr.third.aspectj.lang.annotation.AspectMetadata; import com.fr.third.springframework.util.Assert; /** diff --git a/fine-spring/src/com/fr/third/springframework/aop/aspectj/MetadataAwareAspectInstanceFactory.java b/fine-spring/src/com/fr/third/springframework/aop/aspectj/MetadataAwareAspectInstanceFactory.java index df862bb21..e8e3c107c 100644 --- a/fine-spring/src/com/fr/third/springframework/aop/aspectj/MetadataAwareAspectInstanceFactory.java +++ b/fine-spring/src/com/fr/third/springframework/aop/aspectj/MetadataAwareAspectInstanceFactory.java @@ -16,10 +16,9 @@ package com.fr.third.springframework.aop.aspectj; -import com.fr.third.aspectj.lang.annotation.AspectMetadata; /** - * Subinterface of {@link com.fr.third.aspectj.AspectInstanceFactory} + * Subinterface of {@link com.fr.third.springframework.aop.aspectj.AspectInstanceFactory} * that returns {@link AspectMetadata} associated with AspectJ-annotated classes. * *

Ideally, AspectInstanceFactory would include this method itself, but because diff --git a/fine-spring/src/com/fr/third/springframework/aop/aspectj/SimpleMetadataAwareAspectInstanceFactory.java b/fine-spring/src/com/fr/third/springframework/aop/aspectj/SimpleMetadataAwareAspectInstanceFactory.java index f5f31424a..fd49ce1a9 100644 --- a/fine-spring/src/com/fr/third/springframework/aop/aspectj/SimpleMetadataAwareAspectInstanceFactory.java +++ b/fine-spring/src/com/fr/third/springframework/aop/aspectj/SimpleMetadataAwareAspectInstanceFactory.java @@ -16,7 +16,6 @@ package com.fr.third.springframework.aop.aspectj; -import com.fr.third.aspectj.lang.annotation.AspectMetadata; import com.fr.third.springframework.core.Ordered; import com.fr.third.springframework.core.annotation.AnnotationUtils; import com.fr.third.springframework.core.annotation.Order; @@ -42,12 +41,12 @@ public class SimpleMetadataAwareAspectInstanceFactory extends SimpleAspectInstan */ public SimpleMetadataAwareAspectInstanceFactory(Class aspectClass, String aspectName) { super(aspectClass); - this.metadata = new com.fr.third.aspectj.lang.annotation.AspectMetadata(aspectClass, aspectName); + this.metadata = new AspectMetadata(aspectClass, aspectName); } @Override - public final com.fr.third.aspectj.lang.annotation.AspectMetadata getAspectMetadata() { + public final AspectMetadata getAspectMetadata() { return this.metadata; } diff --git a/fine-spring/src/com/fr/third/springframework/aop/aspectj/SingletonMetadataAwareAspectInstanceFactory.java b/fine-spring/src/com/fr/third/springframework/aop/aspectj/SingletonMetadataAwareAspectInstanceFactory.java index dd4826776..e476b9d75 100644 --- a/fine-spring/src/com/fr/third/springframework/aop/aspectj/SingletonMetadataAwareAspectInstanceFactory.java +++ b/fine-spring/src/com/fr/third/springframework/aop/aspectj/SingletonMetadataAwareAspectInstanceFactory.java @@ -16,7 +16,6 @@ package com.fr.third.springframework.aop.aspectj; -import com.fr.third.aspectj.lang.annotation.AspectMetadata; import com.fr.third.springframework.core.Ordered; import com.fr.third.springframework.core.annotation.AnnotationUtils; import com.fr.third.springframework.core.annotation.Order; diff --git a/fine-spring/src/com/fr/third/springframework/core/io/ContextResource.java b/fine-spring/src/com/fr/third/springframework/core/io/ContextResource.java index 5bb698276..dcbdf066e 100644 --- a/fine-spring/src/com/fr/third/springframework/core/io/ContextResource.java +++ b/fine-spring/src/com/fr/third/springframework/core/io/ContextResource.java @@ -19,7 +19,7 @@ package com.fr.third.springframework.core.io; /** * Extended interface for a resource that is loaded from an enclosing * 'context', e.g. from a {@link javax.servlet.ServletContext} or a - * {@link javax.portlet.PortletContext} but also from plain classpath paths + * {@link com.fr.third.javax.portlet.PortletContext} but also from plain classpath paths * or relative file system paths (specified without an explicit prefix, * hence applying relative to the local {@link ResourceLoader}'s context). * diff --git a/fine-spring/src/com/fr/third/springframework/web/bind/annotation/ExceptionHandler.java b/fine-spring/src/com/fr/third/springframework/web/bind/annotation/ExceptionHandler.java index 9626ab443..3582c8216 100644 --- a/fine-spring/src/com/fr/third/springframework/web/bind/annotation/ExceptionHandler.java +++ b/fine-spring/src/com/fr/third/springframework/web/bind/annotation/ExceptionHandler.java @@ -37,13 +37,13 @@ import java.lang.annotation.Target; *

  • Request and/or response objects (Servlet API or Portlet API). * You may choose any specific request/response type, e.g. * {@link javax.servlet.ServletRequest} / {@link javax.servlet.http.HttpServletRequest} - * or {@link javax.portlet.PortletRequest} / {@link javax.portlet.ActionRequest} / - * {@link javax.portlet.RenderRequest}. Note that in the Portlet case, + * or {@link com.fr.third.javax.portlet.PortletRequest} / {@link com.fr.third.javax.portlet.ActionRequest} / + * {@link com.fr.third.javax.portlet.RenderRequest}. Note that in the Portlet case, * an explicitly declared action/render argument is also used for mapping * specific request types onto a handler method (in case of no other * information given that differentiates between action and render requests). *
  • Session object (Servlet API or Portlet API): either - * {@link javax.servlet.http.HttpSession} or {@link javax.portlet.PortletSession}. + * {@link javax.servlet.http.HttpSession} or {@link com.fr.third.javax.portlet.PortletSession}. * An argument of this type will enforce the presence of a corresponding session. * As a consequence, such an argument will never be {@code null}. * Note that session access may not be thread-safe, in particular in a @@ -88,7 +88,7 @@ import java.lang.annotation.Target; *
  • {@code void} if the method handles the response itself (by * writing the response content directly, declaring an argument of type * {@link javax.servlet.ServletResponse} / {@link javax.servlet.http.HttpServletResponse} - * / {@link javax.portlet.RenderResponse} for that purpose) + * / {@link com.fr.third.javax.portlet.RenderResponse} for that purpose) * or if the view name is supposed to be implicitly determined through a * {@link com.fr.third.springframework.web.servlet.RequestToViewNameTranslator} * (not declaring a response argument in the handler method signature; diff --git a/fine-spring/src/com/fr/third/springframework/web/bind/annotation/RequestMapping.java b/fine-spring/src/com/fr/third/springframework/web/bind/annotation/RequestMapping.java index c1d1f7263..66468aea0 100644 --- a/fine-spring/src/com/fr/third/springframework/web/bind/annotation/RequestMapping.java +++ b/fine-spring/src/com/fr/third/springframework/web/bind/annotation/RequestMapping.java @@ -46,13 +46,13 @@ import java.util.concurrent.Callable; *
  • Request and/or response objects (Servlet API or Portlet API). * You may choose any specific request/response type, e.g. * {@link javax.servlet.ServletRequest} / {@link javax.servlet.http.HttpServletRequest} - * or {@link javax.portlet.PortletRequest} / {@link javax.portlet.ActionRequest} / - * {@link javax.portlet.RenderRequest}. Note that in the Portlet case, + * or {@link com.fr.third.javax.portlet.PortletRequest} / {@link com.fr.third.javax.portlet.ActionRequest} / + * {@link com.fr.third.javax.portlet.RenderRequest}. Note that in the Portlet case, * an explicitly declared action/render argument is also used for mapping * specific request types onto a handler method (in case of no other * information given that differentiates between action and render requests). *
  • Session object (Servlet API or Portlet API): either - * {@link javax.servlet.http.HttpSession} or {@link javax.portlet.PortletSession}. + * {@link javax.servlet.http.HttpSession} or {@link com.fr.third.javax.portlet.PortletSession}. * An argument of this type will enforce the presence of a corresponding session. * As a consequence, such an argument will never be {@code null}. * Note that session access may not be thread-safe, in particular in a @@ -207,7 +207,7 @@ import java.util.concurrent.Callable; *
  • {@code void} if the method handles the response itself (by * writing the response content directly, declaring an argument of type * {@link javax.servlet.ServletResponse} / {@link javax.servlet.http.HttpServletResponse} - * / {@link javax.portlet.RenderResponse} for that purpose) + * / {@link com.fr.third.javax.portlet.RenderResponse} for that purpose) * or if the view name is supposed to be implicitly determined through a * {@link com.fr.third.springframework.web.servlet.RequestToViewNameTranslator} * (not declaring a response argument in the handler method signature; diff --git a/fine-spring/src/com/fr/third/springframework/web/context/request/FacesRequestAttributes.java b/fine-spring/src/com/fr/third/springframework/web/context/request/FacesRequestAttributes.java index c210c0fec..736803405 100644 --- a/fine-spring/src/com/fr/third/springframework/web/context/request/FacesRequestAttributes.java +++ b/fine-spring/src/com/fr/third/springframework/web/context/request/FacesRequestAttributes.java @@ -20,7 +20,7 @@ import java.lang.reflect.Method; import java.util.Map; import javax.faces.context.ExternalContext; import javax.faces.context.FacesContext; -import javax.portlet.PortletSession; +import com.fr.third.javax.portlet.PortletSession; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; diff --git a/fine-spring/src/com/fr/third/springframework/web/context/request/NativeWebRequest.java b/fine-spring/src/com/fr/third/springframework/web/context/request/NativeWebRequest.java index 6d37b11c0..28cc7551d 100644 --- a/fine-spring/src/com/fr/third/springframework/web/context/request/NativeWebRequest.java +++ b/fine-spring/src/com/fr/third/springframework/web/context/request/NativeWebRequest.java @@ -31,16 +31,16 @@ public interface NativeWebRequest extends WebRequest { /** * Return the underlying native request object, if available. * @see javax.servlet.http.HttpServletRequest - * @see javax.portlet.ActionRequest - * @see javax.portlet.RenderRequest + * @see com.fr.third.javax.portlet.ActionRequest + * @see com.fr.third.javax.portlet.RenderRequest */ Object getNativeRequest(); /** * Return the underlying native response object, if available. * @see javax.servlet.http.HttpServletResponse - * @see javax.portlet.ActionResponse - * @see javax.portlet.RenderResponse + * @see com.fr.third.javax.portlet.ActionResponse + * @see com.fr.third.javax.portlet.RenderResponse */ Object getNativeResponse(); @@ -50,8 +50,8 @@ public interface NativeWebRequest extends WebRequest { * @return the matching request object, or {@code null} if none * of that type is available * @see javax.servlet.http.HttpServletRequest - * @see javax.portlet.ActionRequest - * @see javax.portlet.RenderRequest + * @see com.fr.third.javax.portlet.ActionRequest + * @see com.fr.third.javax.portlet.RenderRequest */ T getNativeRequest(Class requiredType); @@ -61,8 +61,8 @@ public interface NativeWebRequest extends WebRequest { * @return the matching response object, or {@code null} if none * of that type is available * @see javax.servlet.http.HttpServletResponse - * @see javax.portlet.ActionResponse - * @see javax.portlet.RenderResponse + * @see com.fr.third.javax.portlet.ActionResponse + * @see com.fr.third.javax.portlet.RenderResponse */ T getNativeResponse(Class requiredType); diff --git a/fine-spring/src/com/fr/third/springframework/web/multipart/commons/CommonsFileUploadSupport.java b/fine-spring/src/com/fr/third/springframework/web/multipart/commons/CommonsFileUploadSupport.java index 7a4e63f6c..e7b488f7d 100644 --- a/fine-spring/src/com/fr/third/springframework/web/multipart/commons/CommonsFileUploadSupport.java +++ b/fine-spring/src/com/fr/third/springframework/web/multipart/commons/CommonsFileUploadSupport.java @@ -23,10 +23,10 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import org.apache.commons.fileupload.FileItem; -import org.apache.commons.fileupload.FileItemFactory; -import org.apache.commons.fileupload.FileUpload; -import org.apache.commons.fileupload.disk.DiskFileItemFactory; +import com.fr.third.org.apache.commons.fileupload.FileItem; +import com.fr.third.org.apache.commons.fileupload.FileItemFactory; +import com.fr.third.org.apache.commons.fileupload.FileUpload; +import com.fr.third.org.apache.commons.fileupload.disk.DiskFileItemFactory; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -82,7 +82,7 @@ public abstract class CommonsFileUploadSupport { /** - * Return the underlying {@code org.apache.commons.fileupload.disk.DiskFileItemFactory} + * Return the underlying {@code com.fr.third.org.apache.commons.fileupload.disk.DiskFileItemFactory} * instance. There is hardly any need to access this. * @return the underlying DiskFileItemFactory instance */ @@ -91,7 +91,7 @@ public abstract class CommonsFileUploadSupport { } /** - * Return the underlying {@code org.apache.commons.fileupload.FileUpload} + * Return the underlying {@code com.fr.third.org.apache.commons.fileupload.FileUpload} * instance. There is hardly any need to access this. * @return the underlying FileUpload instance */ @@ -103,7 +103,7 @@ public abstract class CommonsFileUploadSupport { * Set the maximum allowed size (in bytes) before uploads are refused. * -1 indicates no limit (the default). * @param maxUploadSize the maximum upload size allowed - * @see org.apache.commons.fileupload.FileUploadBase#setSizeMax + * @see com.fr.third.org.apache.commons.fileupload.FileUploadBase#setSizeMax */ public void setMaxUploadSize(long maxUploadSize) { this.fileUpload.setSizeMax(maxUploadSize); @@ -114,7 +114,7 @@ public abstract class CommonsFileUploadSupport { * Uploaded files will still be received past this amount, but they will not be * stored in memory. Default is 10240, according to Commons FileUpload. * @param maxInMemorySize the maximum in memory size allowed - * @see org.apache.commons.fileupload.disk.DiskFileItemFactory#setSizeThreshold + * @see com.fr.third.org.apache.commons.fileupload.disk.DiskFileItemFactory#setSizeThreshold */ public void setMaxInMemorySize(int maxInMemorySize) { this.fileItemFactory.setSizeThreshold(maxInMemorySize); @@ -132,7 +132,7 @@ public abstract class CommonsFileUploadSupport { * @see javax.servlet.ServletRequest#getCharacterEncoding * @see javax.servlet.ServletRequest#setCharacterEncoding * @see WebUtils#DEFAULT_CHARACTER_ENCODING - * @see org.apache.commons.fileupload.FileUploadBase#setHeaderEncoding + * @see com.fr.third.org.apache.commons.fileupload.FileUploadBase#setHeaderEncoding */ public void setDefaultEncoding(String defaultEncoding) { this.fileUpload.setHeaderEncoding(defaultEncoding); @@ -270,7 +270,7 @@ public abstract class CommonsFileUploadSupport { * potentially holding temporary data on disk. *

    Deletes the underlying Commons FileItem instances. * @param multipartFiles Collection of MultipartFile instances - * @see org.apache.commons.fileupload.FileItem#delete() + * @see com.fr.third.org.apache.commons.fileupload.FileItem#delete() */ protected void cleanupFileItems(MultiValueMap multipartFiles) { for (List files : multipartFiles.values()) { diff --git a/fine-spring/src/com/fr/third/springframework/web/multipart/commons/CommonsMultipartFile.java b/fine-spring/src/com/fr/third/springframework/web/multipart/commons/CommonsMultipartFile.java index 7e37c2255..5d1b510fe 100644 --- a/fine-spring/src/com/fr/third/springframework/web/multipart/commons/CommonsMultipartFile.java +++ b/fine-spring/src/com/fr/third/springframework/web/multipart/commons/CommonsMultipartFile.java @@ -21,9 +21,9 @@ import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.Serializable; -import org.apache.commons.fileupload.FileItem; -import org.apache.commons.fileupload.FileUploadException; -import org.apache.commons.fileupload.disk.DiskFileItem; +import com.fr.third.org.apache.commons.fileupload.FileItem; +import com.fr.third.org.apache.commons.fileupload.FileUploadException; +import com.fr.third.org.apache.commons.fileupload.disk.DiskFileItem; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -57,7 +57,7 @@ public class CommonsMultipartFile implements MultipartFile, Serializable { } /** - * Return the underlying {@code org.apache.commons.fileupload.FileItem} + * Return the underlying {@code com.fr.third.org.apache.commons.fileupload.FileItem} * instance. There is hardly any need to access this. */ public final FileItem getFileItem() { diff --git a/fine-spring/src/com/fr/third/springframework/web/multipart/commons/CommonsMultipartResolver.java b/fine-spring/src/com/fr/third/springframework/web/multipart/commons/CommonsMultipartResolver.java index 441738965..27cc38a58 100644 --- a/fine-spring/src/com/fr/third/springframework/web/multipart/commons/CommonsMultipartResolver.java +++ b/fine-spring/src/com/fr/third/springframework/web/multipart/commons/CommonsMultipartResolver.java @@ -20,12 +20,12 @@ import java.util.List; import javax.servlet.ServletContext; import javax.servlet.http.HttpServletRequest; -import org.apache.commons.fileupload.FileItem; -import org.apache.commons.fileupload.FileItemFactory; -import org.apache.commons.fileupload.FileUpload; -import org.apache.commons.fileupload.FileUploadBase; -import org.apache.commons.fileupload.FileUploadException; -import org.apache.commons.fileupload.servlet.ServletFileUpload; +import com.fr.third.org.apache.commons.fileupload.FileItem; +import com.fr.third.org.apache.commons.fileupload.FileItemFactory; +import com.fr.third.org.apache.commons.fileupload.FileUpload; +import com.fr.third.org.apache.commons.fileupload.FileUploadBase; +import com.fr.third.org.apache.commons.fileupload.FileUploadException; +import com.fr.third.org.apache.commons.fileupload.servlet.ServletFileUpload; import com.fr.third.springframework.util.Assert; import com.fr.third.springframework.web.context.ServletContextAware; @@ -56,8 +56,8 @@ import com.fr.third.springframework.web.util.WebUtils; * @see #CommonsMultipartResolver(ServletContext) * @see #setResolveLazily * @see com.fr.third.springframework.web.portlet.multipart.CommonsPortletMultipartResolver - * @see org.apache.commons.fileupload.servlet.ServletFileUpload - * @see org.apache.commons.fileupload.disk.DiskFileItemFactory + * @see com.fr.third.org.apache.commons.fileupload.servlet.ServletFileUpload + * @see com.fr.third.org.apache.commons.fileupload.disk.DiskFileItemFactory */ public class CommonsMultipartResolver extends CommonsFileUploadSupport implements MultipartResolver, ServletContextAware { @@ -101,7 +101,7 @@ public class CommonsMultipartResolver extends CommonsFileUploadSupport } /** - * Initialize the underlying {@code org.apache.commons.fileupload.servlet.ServletFileUpload} + * Initialize the underlying {@code com.fr.third.org.apache.commons.fileupload.servlet.ServletFileUpload} * instance. Can be overridden to use a custom subclass, e.g. for testing purposes. * @param fileItemFactory the Commons FileItemFactory to use * @return the new ServletFileUpload instance