hzzz 7 years ago
parent
commit
de3e0a1d9e
  1. 2
      build.third_step1.gradle
  2. BIN
      fine-commons-fileupload/lib/javax.servlet-api-3.0.1.jar
  3. 2
      fine-commons-fileupload/src/com/fr/third/org/apache/commons/fileupload/portlet/PortletFileUpload.java
  4. 2
      fine-commons-fileupload/src/com/fr/third/org/apache/commons/fileupload/portlet/PortletRequestContext.java
  5. 2
      fine-commons-fileupload/src/com/fr/third/org/apache/commons/fileupload/servlet/FileCleanerCleanup.java
  6. 7
      fine-spring/fine-spring.iml
  7. BIN
      fine-spring/lib/commons-logging-1.2.jar
  8. 3
      fine-spring/src/com/fr/third/springframework/aop/aspectj/AspectJProxyFactory.java
  9. 7
      fine-spring/src/com/fr/third/springframework/aop/aspectj/AspectMetadata.java
  10. 1
      fine-spring/src/com/fr/third/springframework/aop/aspectj/BeanFactoryAspectInstanceFactory.java
  11. 1
      fine-spring/src/com/fr/third/springframework/aop/aspectj/BeanFactoryAspectJAdvisorsBuilder.java
  12. 471
      fine-spring/src/com/fr/third/springframework/aop/aspectj/InstantiationModelAwarePointcutAdvisorImpl.java
  13. 1
      fine-spring/src/com/fr/third/springframework/aop/aspectj/LazySingletonAspectInstanceFactoryDecorator.java
  14. 3
      fine-spring/src/com/fr/third/springframework/aop/aspectj/MetadataAwareAspectInstanceFactory.java
  15. 5
      fine-spring/src/com/fr/third/springframework/aop/aspectj/SimpleMetadataAwareAspectInstanceFactory.java
  16. 1
      fine-spring/src/com/fr/third/springframework/aop/aspectj/SingletonMetadataAwareAspectInstanceFactory.java
  17. 2
      fine-spring/src/com/fr/third/springframework/core/io/ContextResource.java
  18. 8
      fine-spring/src/com/fr/third/springframework/web/bind/annotation/ExceptionHandler.java
  19. 8
      fine-spring/src/com/fr/third/springframework/web/bind/annotation/RequestMapping.java
  20. 2
      fine-spring/src/com/fr/third/springframework/web/context/request/FacesRequestAttributes.java
  21. 16
      fine-spring/src/com/fr/third/springframework/web/context/request/NativeWebRequest.java
  22. 20
      fine-spring/src/com/fr/third/springframework/web/multipart/commons/CommonsFileUploadSupport.java
  23. 8
      fine-spring/src/com/fr/third/springframework/web/multipart/commons/CommonsMultipartFile.java
  24. 18
      fine-spring/src/com/fr/third/springframework/web/multipart/commons/CommonsMultipartResolver.java

2
build.third_step1.gradle

@ -31,6 +31,7 @@ sourceSets{
"${srcDir}/fine-poi/src", "${srcDir}/fine-poi/src",
"${srcDir}/fine-quartz/src", "${srcDir}/fine-quartz/src",
"${srcDir}/fine-commons-io/src", "${srcDir}/fine-commons-io/src",
"${srcDir}/fine-portlet-api/src",
"${srcDir}/fine-commons-fileupload/src", "${srcDir}/fine-commons-fileupload/src",
"${srcDir}/fine-commons-lang3/src", "${srcDir}/fine-commons-lang3/src",
"${srcDir}/fine-commons-collections4/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-poi/src")
with dataContent.call("${srcDir}/fine-quartz/src") with dataContent.call("${srcDir}/fine-quartz/src")
with dataContent.call("${srcDir}/fine-commons-io/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") with dataContent.call("${srcDir}/fine-commons-fileupload/src")
into "${classesDir}" into "${classesDir}"
} }

BIN
fine-commons-fileupload/lib/javax.servlet-api-3.0.1.jar

Binary file not shown.

2
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.io.IOException;
import java.util.List; 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.FileItemFactory;
import com.fr.third.org.apache.commons.fileupload.FileItemIterator; import com.fr.third.org.apache.commons.fileupload.FileItemIterator;

2
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.InputStream;
import java.io.IOException; import java.io.IOException;
import javax.portlet.ActionRequest; import com.fr.third.javax.portlet.ActionRequest;
import com.fr.third.org.apache.commons.fileupload.RequestContext; import com.fr.third.org.apache.commons.fileupload.RequestContext;
/** /**

2
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 * 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, * reaper thread is terminated,
* when the web application is destroyed. * when the web application is destroyed.
*/ */

7
fine-spring/fine-spring.iml

@ -8,5 +8,12 @@
<orderEntry type="inheritedJdk" /> <orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="lib-spring" level="project" /> <orderEntry type="library" name="lib-spring" level="project" />
<orderEntry type="module" module-name="fine-commons-fileupload" />
<orderEntry type="library" name="lib" level="project" />
<orderEntry type="library" name="lib4" level="project" />
<orderEntry type="module" module-name="fine-aspectj" />
<orderEntry type="library" name="lib2" level="project" />
<orderEntry type="module" module-name="fine-hibernate" />
<orderEntry type="module" module-name="fine-portlet-api" />
</component> </component>
</module> </module>

BIN
fine-spring/lib/commons-logging-1.2.jar

Binary file not shown.

3
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.List;
import java.util.Map; import java.util.Map;
import com.fr.third.aspectj.lang.annotation.AspectMetadata;
import com.fr.third.aspectj.lang.reflect.PerClauseKind; import com.fr.third.aspectj.lang.reflect.PerClauseKind;
import com.fr.third.springframework.aop.Advisor; import com.fr.third.springframework.aop.Advisor;
@ -91,7 +90,7 @@ public class AspectJProxyFactory extends ProxyCreatorSupport {
public void addAspect(Object aspectInstance) { public void addAspect(Object aspectInstance) {
Class<?> aspectClass = aspectInstance.getClass(); Class<?> aspectClass = aspectInstance.getClass();
String aspectName = aspectClass.getName(); 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) { if (am.getAjType().getPerClause().getKind() != PerClauseKind.SINGLETON) {
throw new IllegalArgumentException( throw new IllegalArgumentException(
"Aspect class [" + aspectClass.getName() + "] does not define a singleton aspect"); "Aspect class [" + aspectClass.getName() + "] does not define a singleton aspect");

7
fine-spring/src/com/fr/third/springframework/aop/aspectj/AspectMetadata.java

@ -14,17 +14,16 @@
* limitations under the License. * 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.AjType;
import com.fr.third.aspectj.lang.reflect.AjTypeSystem; import com.fr.third.aspectj.lang.reflect.AjTypeSystem;
import com.fr.third.aspectj.lang.reflect.PerClauseKind; import com.fr.third.aspectj.lang.reflect.PerClauseKind;
import com.fr.third.springframework.aop.Pointcut; 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.framework.AopConfigException;
import com.fr.third.springframework.aop.support.ComposablePointcut; 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 * 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 Rod Johnson
* @author Juergen Hoeller * @author Juergen Hoeller
* @since 2.0 * @since 2.0
* @see com.fr.third.aspectj.AspectJExpressionPointcut * @see com.fr.third.springframework.aop.aspectj.AspectJExpressionPointcut
*/ */
public class AspectMetadata { public class AspectMetadata {

1
fine-spring/src/com/fr/third/springframework/aop/aspectj/BeanFactoryAspectInstanceFactory.java

@ -16,7 +16,6 @@
package com.fr.third.springframework.aop.aspectj; 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.BeanFactory;
import com.fr.third.springframework.beans.factory.config.ConfigurableBeanFactory; import com.fr.third.springframework.beans.factory.config.ConfigurableBeanFactory;
import com.fr.third.springframework.core.Ordered; import com.fr.third.springframework.core.Ordered;

1
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.List;
import java.util.Map; import java.util.Map;
import com.fr.third.aspectj.lang.annotation.AspectMetadata;
import com.fr.third.aspectj.lang.reflect.PerClauseKind; import com.fr.third.aspectj.lang.reflect.PerClauseKind;
import com.fr.third.springframework.aop.Advisor; import com.fr.third.springframework.aop.Advisor;

471
fine-spring/src/com/fr/third/springframework/aop/aspectj/InstantiationModelAwarePointcutAdvisorImpl.java

@ -16,256 +16,249 @@
package com.fr.third.springframework.aop.aspectj; 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.aspectj.lang.reflect.PerClauseKind;
import com.fr.third.springframework.aop.Pointcut; import com.fr.third.springframework.aop.Pointcut;
import com.fr.third.springframework.aop.support.DynamicMethodMatcherPointcut; import com.fr.third.springframework.aop.support.DynamicMethodMatcherPointcut;
import com.fr.third.springframework.aop.support.Pointcuts; 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 java.lang.reflect.Method;
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;
/** /**
* Internal implementation of AspectJPointcutAdvisor. * Internal implementation of AspectJPointcutAdvisor. Note that there will be one instance of this
* Note that there will be one instance of this advisor for each target method. * advisor for each target method.
* *
* @author Rod Johnson * @author Rod Johnson
* @author Juergen Hoeller * @author Juergen Hoeller
* @since 2.0 * @since 2.0
*/ */
class InstantiationModelAwarePointcutAdvisorImpl class InstantiationModelAwarePointcutAdvisorImpl
implements InstantiationModelAwarePointcutAdvisor, AspectJPrecedenceInformation { implements InstantiationModelAwarePointcutAdvisor, AspectJPrecedenceInformation {
private final AspectJExpressionPointcut declaredPointcut; private final AspectJExpressionPointcut declaredPointcut;
private Pointcut pointcut; private Pointcut pointcut;
private final MetadataAwareAspectInstanceFactory aspectInstanceFactory; private final MetadataAwareAspectInstanceFactory aspectInstanceFactory;
private final Method method; private final Method method;
private final boolean lazy; private final boolean lazy;
private final AspectJAdvisorFactory atAspectJAdvisorFactory; private final AspectJAdvisorFactory atAspectJAdvisorFactory;
private Advice instantiatedAdvice; private Advice instantiatedAdvice;
private int declarationOrder; private int declarationOrder;
private String aspectName; private String aspectName;
private Boolean isBeforeAdvice; private Boolean isBeforeAdvice;
private Boolean isAfterAdvice; private Boolean isAfterAdvice;
public InstantiationModelAwarePointcutAdvisorImpl(
public InstantiationModelAwarePointcutAdvisorImpl(AspectJAdvisorFactory af, AspectJExpressionPointcut ajexp, AspectJAdvisorFactory af,
MetadataAwareAspectInstanceFactory aif, Method method, int declarationOrderInAspect, String aspectName) { AspectJExpressionPointcut ajexp,
MetadataAwareAspectInstanceFactory aif,
this.declaredPointcut = ajexp; Method method,
this.method = method; int declarationOrderInAspect,
this.atAspectJAdvisorFactory = af; String aspectName) {
this.aspectInstanceFactory = aif;
this.declarationOrder = declarationOrderInAspect; this.declaredPointcut = ajexp;
this.aspectName = aspectName; this.method = method;
this.atAspectJAdvisorFactory = af;
if (aif.getAspectMetadata().isLazilyInstantiated()) { this.aspectInstanceFactory = aif;
// Static part of the pointcut is a lazy type. this.declarationOrder = declarationOrderInAspect;
Pointcut preInstantiationPointcut = this.aspectName = aspectName;
Pointcuts.union(aif.getAspectMetadata().getPerClausePointcut(), this.declaredPointcut);
if (aif.getAspectMetadata().isLazilyInstantiated()) {
// Make it dynamic: must mutate from pre-instantiation to post-instantiation state. // Static part of the pointcut is a lazy type.
// If it's not a dynamic pointcut, it may be optimized out Pointcut preInstantiationPointcut =
// by the Spring AOP infrastructure after the first evaluation. Pointcuts.union(aif.getAspectMetadata().getPerClausePointcut(), this.declaredPointcut);
this.pointcut = new PerTargetInstantiationModelPointcut(this.declaredPointcut, preInstantiationPointcut, aif);
this.lazy = true; // Make it dynamic: must mutate from pre-instantiation to post-instantiation state.
} // If it's not a dynamic pointcut, it may be optimized out
else { // by the Spring AOP infrastructure after the first evaluation.
// A singleton aspect. this.pointcut =
this.instantiatedAdvice = instantiateAdvice(this.declaredPointcut); new PerTargetInstantiationModelPointcut(
this.pointcut = declaredPointcut; this.declaredPointcut, preInstantiationPointcut, aif);
this.lazy = false; 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() { * The pointcut for Spring AOP to use. Actual behaviour of the pointcut will change depending on
return this.pointcut; * the state of the advice.
} */
@Override
/** public Pointcut getPointcut() {
* This is only of interest for Spring AOP: AspectJ instantiation semantics return this.pointcut;
* are much richer. In AspectJ terminology, all a return of {@code true} }
* means here is that the aspect is not a SINGLETON.
*/ /**
@Override * This is only of interest for Spring AOP: AspectJ instantiation semantics are much richer. In
public boolean isPerInstance() { * AspectJ terminology, all a return of {@code true} means here is that the aspect is not a
return (getAspectMetadata().getAjType().getPerClause().getKind() != PerClauseKind.SINGLETON); * SINGLETON.
} */
@Override
/** public boolean isPerInstance() {
* Return the AspectJ AspectMetadata for this advisor. return (getAspectMetadata().getAjType().getPerClause().getKind() != PerClauseKind.SINGLETON);
*/ }
public com.fr.third.aspectj.lang.annotation.AspectMetadata getAspectMetadata() {
return this.aspectInstanceFactory.getAspectMetadata(); /** Return the AspectJ AspectMetadata for this advisor. */
} public AspectMetadata getAspectMetadata() {
return this.aspectInstanceFactory.getAspectMetadata();
/** }
* Lazily instantiate advice if necessary.
*/ /** Lazily instantiate advice if necessary. */
@Override @Override
public synchronized Advice getAdvice() { public synchronized Advice getAdvice() {
if (this.instantiatedAdvice == null) { if (this.instantiatedAdvice == null) {
this.instantiatedAdvice = instantiateAdvice(this.declaredPointcut); this.instantiatedAdvice = instantiateAdvice(this.declaredPointcut);
} }
return this.instantiatedAdvice; return this.instantiatedAdvice;
} }
@Override @Override
public boolean isLazy() { public boolean isLazy() {
return this.lazy; return this.lazy;
} }
@Override @Override
public synchronized boolean isAdviceInstantiated() { public synchronized boolean isAdviceInstantiated() {
return (this.instantiatedAdvice != null); return (this.instantiatedAdvice != null);
} }
private Advice instantiateAdvice(AspectJExpressionPointcut pcut) {
private Advice instantiateAdvice(AspectJExpressionPointcut pcut) { return this.atAspectJAdvisorFactory.getAdvice(
return this.atAspectJAdvisorFactory.getAdvice( this.method, pcut, this.aspectInstanceFactory, this.declarationOrder, this.aspectName);
this.method, pcut, this.aspectInstanceFactory, this.declarationOrder, this.aspectName); }
}
public MetadataAwareAspectInstanceFactory getAspectInstanceFactory() {
public MetadataAwareAspectInstanceFactory getAspectInstanceFactory() { return this.aspectInstanceFactory;
return this.aspectInstanceFactory; }
}
public AspectJExpressionPointcut getDeclaredPointcut() {
public AspectJExpressionPointcut getDeclaredPointcut() { return this.declaredPointcut;
return this.declaredPointcut; }
}
@Override
@Override public int getOrder() {
public int getOrder() { return this.aspectInstanceFactory.getOrder();
return this.aspectInstanceFactory.getOrder(); }
}
@Override
@Override public String getAspectName() {
public String getAspectName() { return this.aspectName;
return this.aspectName; }
}
@Override
@Override public int getDeclarationOrder() {
public int getDeclarationOrder() { return this.declarationOrder;
return this.declarationOrder; }
}
@Override
@Override public boolean isBeforeAdvice() {
public boolean isBeforeAdvice() { if (this.isBeforeAdvice == null) {
if (this.isBeforeAdvice == null) { determineAdviceType();
determineAdviceType(); }
} return this.isBeforeAdvice;
return this.isBeforeAdvice; }
}
@Override
@Override public boolean isAfterAdvice() {
public boolean isAfterAdvice() { if (this.isAfterAdvice == null) {
if (this.isAfterAdvice == null) { determineAdviceType();
determineAdviceType(); }
} return this.isAfterAdvice;
return this.isAfterAdvice; }
}
/**
/** * Duplicates some logic from getAdvice, but importantly does not force creation of the advice.
* Duplicates some logic from getAdvice, but importantly does not force */
* creation of the advice. private void determineAdviceType() {
*/ AbstractAspectJAdvisorFactory.AspectJAnnotation<?> aspectJAnnotation =
private void determineAdviceType() { AbstractAspectJAdvisorFactory.findAspectJAnnotationOnMethod(this.method);
AbstractAspectJAdvisorFactory.AspectJAnnotation<?> aspectJAnnotation = if (aspectJAnnotation == null) {
AbstractAspectJAdvisorFactory.findAspectJAnnotationOnMethod(this.method); this.isBeforeAdvice = false;
if (aspectJAnnotation == null) { this.isAfterAdvice = false;
this.isBeforeAdvice = false; } else {
this.isAfterAdvice = false; switch (aspectJAnnotation.getAnnotationType()) {
} case AtAfter:
else { case AtAfterReturning:
switch (aspectJAnnotation.getAnnotationType()) { case AtAfterThrowing:
case AtAfter: this.isAfterAdvice = true;
case AtAfterReturning: this.isBeforeAdvice = false;
case AtAfterThrowing: break;
this.isAfterAdvice = true; case AtAround:
this.isBeforeAdvice = false; case AtPointcut:
break; this.isAfterAdvice = false;
case AtAround: this.isBeforeAdvice = false;
case AtPointcut: break;
this.isAfterAdvice = false; case AtBefore:
this.isBeforeAdvice = false; this.isAfterAdvice = false;
break; this.isBeforeAdvice = true;
case AtBefore: }
this.isAfterAdvice = false; }
this.isBeforeAdvice = true; }
}
} @Override
} public String toString() {
return "InstantiationModelAwarePointcutAdvisor: expression ["
+ getDeclaredPointcut().getExpression()
@Override + "]; advice method ["
public String toString() { + this.method
return "InstantiationModelAwarePointcutAdvisor: expression [" + getDeclaredPointcut().getExpression() + + "]; perClauseKind="
"]; advice method [" + this.method + "]; perClauseKind=" + + this.aspectInstanceFactory.getAspectMetadata().getAjType().getPerClause().getKind();
this.aspectInstanceFactory.getAspectMetadata().getAjType().getPerClause().getKind(); }
} /**
* Pointcut implementation that changes its behaviour when the advice is instantiated. Note that
* this is a <i>dynamic</i> pointcut. Otherwise it might be optimized out if it does not at first
/** * match statically.
* Pointcut implementation that changes its behaviour when the advice is instantiated. */
* Note that this is a <i>dynamic</i> pointcut. Otherwise it might private class PerTargetInstantiationModelPointcut extends DynamicMethodMatcherPointcut {
* be optimized out if it does not at first match statically.
*/ private final AspectJExpressionPointcut declaredPointcut;
private class PerTargetInstantiationModelPointcut extends DynamicMethodMatcherPointcut {
private final Pointcut preInstantiationPointcut;
private final AspectJExpressionPointcut declaredPointcut;
private LazySingletonAspectInstanceFactoryDecorator aspectInstanceFactory;
private final Pointcut preInstantiationPointcut;
private PerTargetInstantiationModelPointcut(
private LazySingletonAspectInstanceFactoryDecorator aspectInstanceFactory; AspectJExpressionPointcut declaredPointcut,
Pointcut preInstantiationPointcut,
private PerTargetInstantiationModelPointcut(AspectJExpressionPointcut declaredPointcut, MetadataAwareAspectInstanceFactory aspectInstanceFactory) {
Pointcut preInstantiationPointcut, MetadataAwareAspectInstanceFactory aspectInstanceFactory) { this.declaredPointcut = declaredPointcut;
this.declaredPointcut = declaredPointcut; this.preInstantiationPointcut = preInstantiationPointcut;
this.preInstantiationPointcut = preInstantiationPointcut; if (aspectInstanceFactory instanceof LazySingletonAspectInstanceFactoryDecorator) {
if (aspectInstanceFactory instanceof LazySingletonAspectInstanceFactoryDecorator) { this.aspectInstanceFactory =
this.aspectInstanceFactory = (LazySingletonAspectInstanceFactoryDecorator) aspectInstanceFactory; (LazySingletonAspectInstanceFactoryDecorator) aspectInstanceFactory;
} }
} }
@Override @Override
public boolean matches(Method method, Class<?> targetClass) { public boolean matches(Method method, Class<?> targetClass) {
// We're either instantiated and matching on declared pointcut, or uninstantiated matching on either pointcut // We're either instantiated and matching on declared pointcut, or uninstantiated matching on
return (isAspectMaterialized() && this.declaredPointcut.matches(method, targetClass)) || // either pointcut
this.preInstantiationPointcut.getMethodMatcher().matches(method, targetClass); return (isAspectMaterialized() && this.declaredPointcut.matches(method, targetClass))
} || this.preInstantiationPointcut.getMethodMatcher().matches(method, targetClass);
}
@Override
public boolean matches(Method method, Class<?> targetClass, Object[] args) { @Override
// This can match only on declared pointcut. public boolean matches(Method method, Class<?> targetClass, Object[] args) {
return (isAspectMaterialized() && this.declaredPointcut.matches(method, targetClass)); // This can match only on declared pointcut.
} return (isAspectMaterialized() && this.declaredPointcut.matches(method, targetClass));
}
private boolean isAspectMaterialized() {
return (this.aspectInstanceFactory == null || this.aspectInstanceFactory.isMaterialized()); private boolean isAspectMaterialized() {
} return (this.aspectInstanceFactory == null || this.aspectInstanceFactory.isMaterialized());
} }
}
} }

1
fine-spring/src/com/fr/third/springframework/aop/aspectj/LazySingletonAspectInstanceFactoryDecorator.java

@ -16,7 +16,6 @@
package com.fr.third.springframework.aop.aspectj; package com.fr.third.springframework.aop.aspectj;
import com.fr.third.aspectj.lang.annotation.AspectMetadata;
import com.fr.third.springframework.util.Assert; import com.fr.third.springframework.util.Assert;
/** /**

3
fine-spring/src/com/fr/third/springframework/aop/aspectj/MetadataAwareAspectInstanceFactory.java

@ -16,10 +16,9 @@
package com.fr.third.springframework.aop.aspectj; 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. * that returns {@link AspectMetadata} associated with AspectJ-annotated classes.
* *
* <p>Ideally, AspectInstanceFactory would include this method itself, but because * <p>Ideally, AspectInstanceFactory would include this method itself, but because

5
fine-spring/src/com/fr/third/springframework/aop/aspectj/SimpleMetadataAwareAspectInstanceFactory.java

@ -16,7 +16,6 @@
package com.fr.third.springframework.aop.aspectj; 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.Ordered;
import com.fr.third.springframework.core.annotation.AnnotationUtils; import com.fr.third.springframework.core.annotation.AnnotationUtils;
import com.fr.third.springframework.core.annotation.Order; import com.fr.third.springframework.core.annotation.Order;
@ -42,12 +41,12 @@ public class SimpleMetadataAwareAspectInstanceFactory extends SimpleAspectInstan
*/ */
public SimpleMetadataAwareAspectInstanceFactory(Class<?> aspectClass, String aspectName) { public SimpleMetadataAwareAspectInstanceFactory(Class<?> aspectClass, String aspectName) {
super(aspectClass); super(aspectClass);
this.metadata = new com.fr.third.aspectj.lang.annotation.AspectMetadata(aspectClass, aspectName); this.metadata = new AspectMetadata(aspectClass, aspectName);
} }
@Override @Override
public final com.fr.third.aspectj.lang.annotation.AspectMetadata getAspectMetadata() { public final AspectMetadata getAspectMetadata() {
return this.metadata; return this.metadata;
} }

1
fine-spring/src/com/fr/third/springframework/aop/aspectj/SingletonMetadataAwareAspectInstanceFactory.java

@ -16,7 +16,6 @@
package com.fr.third.springframework.aop.aspectj; 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.Ordered;
import com.fr.third.springframework.core.annotation.AnnotationUtils; import com.fr.third.springframework.core.annotation.AnnotationUtils;
import com.fr.third.springframework.core.annotation.Order; import com.fr.third.springframework.core.annotation.Order;

2
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 * Extended interface for a resource that is loaded from an enclosing
* 'context', e.g. from a {@link javax.servlet.ServletContext} or a * '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, * or relative file system paths (specified without an explicit prefix,
* hence applying relative to the local {@link ResourceLoader}'s context). * hence applying relative to the local {@link ResourceLoader}'s context).
* *

8
fine-spring/src/com/fr/third/springframework/web/bind/annotation/ExceptionHandler.java

@ -37,13 +37,13 @@ import java.lang.annotation.Target;
* <li>Request and/or response objects (Servlet API or Portlet API). * <li>Request and/or response objects (Servlet API or Portlet API).
* You may choose any specific request/response type, e.g. * You may choose any specific request/response type, e.g.
* {@link javax.servlet.ServletRequest} / {@link javax.servlet.http.HttpServletRequest} * {@link javax.servlet.ServletRequest} / {@link javax.servlet.http.HttpServletRequest}
* or {@link javax.portlet.PortletRequest} / {@link javax.portlet.ActionRequest} / * or {@link com.fr.third.javax.portlet.PortletRequest} / {@link com.fr.third.javax.portlet.ActionRequest} /
* {@link javax.portlet.RenderRequest}. Note that in the Portlet case, * {@link com.fr.third.javax.portlet.RenderRequest}. Note that in the Portlet case,
* an explicitly declared action/render argument is also used for mapping * an explicitly declared action/render argument is also used for mapping
* specific request types onto a handler method (in case of no other * specific request types onto a handler method (in case of no other
* information given that differentiates between action and render requests). * information given that differentiates between action and render requests).
* <li>Session object (Servlet API or Portlet API): either * <li>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. * An argument of this type will enforce the presence of a corresponding session.
* As a consequence, such an argument will never be {@code null}. * As a consequence, such an argument will never be {@code null}.
* <i>Note that session access may not be thread-safe, in particular in a * <i>Note that session access may not be thread-safe, in particular in a
@ -88,7 +88,7 @@ import java.lang.annotation.Target;
* <li>{@code void} if the method handles the response itself (by * <li>{@code void} if the method handles the response itself (by
* writing the response content directly, declaring an argument of type * writing the response content directly, declaring an argument of type
* {@link javax.servlet.ServletResponse} / {@link javax.servlet.http.HttpServletResponse} * {@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 * or if the view name is supposed to be implicitly determined through a
* {@link com.fr.third.springframework.web.servlet.RequestToViewNameTranslator} * {@link com.fr.third.springframework.web.servlet.RequestToViewNameTranslator}
* (not declaring a response argument in the handler method signature; * (not declaring a response argument in the handler method signature;

8
fine-spring/src/com/fr/third/springframework/web/bind/annotation/RequestMapping.java

@ -46,13 +46,13 @@ import java.util.concurrent.Callable;
* <li>Request and/or response objects (Servlet API or Portlet API). * <li>Request and/or response objects (Servlet API or Portlet API).
* You may choose any specific request/response type, e.g. * You may choose any specific request/response type, e.g.
* {@link javax.servlet.ServletRequest} / {@link javax.servlet.http.HttpServletRequest} * {@link javax.servlet.ServletRequest} / {@link javax.servlet.http.HttpServletRequest}
* or {@link javax.portlet.PortletRequest} / {@link javax.portlet.ActionRequest} / * or {@link com.fr.third.javax.portlet.PortletRequest} / {@link com.fr.third.javax.portlet.ActionRequest} /
* {@link javax.portlet.RenderRequest}. Note that in the Portlet case, * {@link com.fr.third.javax.portlet.RenderRequest}. Note that in the Portlet case,
* an explicitly declared action/render argument is also used for mapping * an explicitly declared action/render argument is also used for mapping
* specific request types onto a handler method (in case of no other * specific request types onto a handler method (in case of no other
* information given that differentiates between action and render requests). * information given that differentiates between action and render requests).
* <li>Session object (Servlet API or Portlet API): either * <li>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. * An argument of this type will enforce the presence of a corresponding session.
* As a consequence, such an argument will never be {@code null}. * As a consequence, such an argument will never be {@code null}.
* <i>Note that session access may not be thread-safe, in particular in a * <i>Note that session access may not be thread-safe, in particular in a
@ -207,7 +207,7 @@ import java.util.concurrent.Callable;
* <li>{@code void} if the method handles the response itself (by * <li>{@code void} if the method handles the response itself (by
* writing the response content directly, declaring an argument of type * writing the response content directly, declaring an argument of type
* {@link javax.servlet.ServletResponse} / {@link javax.servlet.http.HttpServletResponse} * {@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 * or if the view name is supposed to be implicitly determined through a
* {@link com.fr.third.springframework.web.servlet.RequestToViewNameTranslator} * {@link com.fr.third.springframework.web.servlet.RequestToViewNameTranslator}
* (not declaring a response argument in the handler method signature; * (not declaring a response argument in the handler method signature;

2
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 java.util.Map;
import javax.faces.context.ExternalContext; import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext; 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.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;

16
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. * Return the underlying native request object, if available.
* @see javax.servlet.http.HttpServletRequest * @see javax.servlet.http.HttpServletRequest
* @see javax.portlet.ActionRequest * @see com.fr.third.javax.portlet.ActionRequest
* @see javax.portlet.RenderRequest * @see com.fr.third.javax.portlet.RenderRequest
*/ */
Object getNativeRequest(); Object getNativeRequest();
/** /**
* Return the underlying native response object, if available. * Return the underlying native response object, if available.
* @see javax.servlet.http.HttpServletResponse * @see javax.servlet.http.HttpServletResponse
* @see javax.portlet.ActionResponse * @see com.fr.third.javax.portlet.ActionResponse
* @see javax.portlet.RenderResponse * @see com.fr.third.javax.portlet.RenderResponse
*/ */
Object getNativeResponse(); Object getNativeResponse();
@ -50,8 +50,8 @@ public interface NativeWebRequest extends WebRequest {
* @return the matching request object, or {@code null} if none * @return the matching request object, or {@code null} if none
* of that type is available * of that type is available
* @see javax.servlet.http.HttpServletRequest * @see javax.servlet.http.HttpServletRequest
* @see javax.portlet.ActionRequest * @see com.fr.third.javax.portlet.ActionRequest
* @see javax.portlet.RenderRequest * @see com.fr.third.javax.portlet.RenderRequest
*/ */
<T> T getNativeRequest(Class<T> requiredType); <T> T getNativeRequest(Class<T> requiredType);
@ -61,8 +61,8 @@ public interface NativeWebRequest extends WebRequest {
* @return the matching response object, or {@code null} if none * @return the matching response object, or {@code null} if none
* of that type is available * of that type is available
* @see javax.servlet.http.HttpServletResponse * @see javax.servlet.http.HttpServletResponse
* @see javax.portlet.ActionResponse * @see com.fr.third.javax.portlet.ActionResponse
* @see javax.portlet.RenderResponse * @see com.fr.third.javax.portlet.RenderResponse
*/ */
<T> T getNativeResponse(Class<T> requiredType); <T> T getNativeResponse(Class<T> requiredType);

20
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.List;
import java.util.Map; import java.util.Map;
import org.apache.commons.fileupload.FileItem; import com.fr.third.org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.FileItemFactory; import com.fr.third.org.apache.commons.fileupload.FileItemFactory;
import org.apache.commons.fileupload.FileUpload; import com.fr.third.org.apache.commons.fileupload.FileUpload;
import org.apache.commons.fileupload.disk.DiskFileItemFactory; import com.fr.third.org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; 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. * instance. There is hardly any need to access this.
* @return the underlying DiskFileItemFactory instance * @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. * instance. There is hardly any need to access this.
* @return the underlying FileUpload instance * @return the underlying FileUpload instance
*/ */
@ -103,7 +103,7 @@ public abstract class CommonsFileUploadSupport {
* Set the maximum allowed size (in bytes) before uploads are refused. * Set the maximum allowed size (in bytes) before uploads are refused.
* -1 indicates no limit (the default). * -1 indicates no limit (the default).
* @param maxUploadSize the maximum upload size allowed * @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) { public void setMaxUploadSize(long maxUploadSize) {
this.fileUpload.setSizeMax(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 * Uploaded files will still be received past this amount, but they will not be
* stored in memory. Default is 10240, according to Commons FileUpload. * stored in memory. Default is 10240, according to Commons FileUpload.
* @param maxInMemorySize the maximum in memory size allowed * @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) { public void setMaxInMemorySize(int maxInMemorySize) {
this.fileItemFactory.setSizeThreshold(maxInMemorySize); this.fileItemFactory.setSizeThreshold(maxInMemorySize);
@ -132,7 +132,7 @@ public abstract class CommonsFileUploadSupport {
* @see javax.servlet.ServletRequest#getCharacterEncoding * @see javax.servlet.ServletRequest#getCharacterEncoding
* @see javax.servlet.ServletRequest#setCharacterEncoding * @see javax.servlet.ServletRequest#setCharacterEncoding
* @see WebUtils#DEFAULT_CHARACTER_ENCODING * @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) { public void setDefaultEncoding(String defaultEncoding) {
this.fileUpload.setHeaderEncoding(defaultEncoding); this.fileUpload.setHeaderEncoding(defaultEncoding);
@ -270,7 +270,7 @@ public abstract class CommonsFileUploadSupport {
* potentially holding temporary data on disk. * potentially holding temporary data on disk.
* <p>Deletes the underlying Commons FileItem instances. * <p>Deletes the underlying Commons FileItem instances.
* @param multipartFiles Collection of MultipartFile 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<String, MultipartFile> multipartFiles) { protected void cleanupFileItems(MultiValueMap<String, MultipartFile> multipartFiles) {
for (List<MultipartFile> files : multipartFiles.values()) { for (List<MultipartFile> files : multipartFiles.values()) {

8
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.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.Serializable; import java.io.Serializable;
import org.apache.commons.fileupload.FileItem; import com.fr.third.org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.FileUploadException; import com.fr.third.org.apache.commons.fileupload.FileUploadException;
import org.apache.commons.fileupload.disk.DiskFileItem; import com.fr.third.org.apache.commons.fileupload.disk.DiskFileItem;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; 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. * instance. There is hardly any need to access this.
*/ */
public final FileItem getFileItem() { public final FileItem getFileItem() {

18
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.ServletContext;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import org.apache.commons.fileupload.FileItem; import com.fr.third.org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.FileItemFactory; import com.fr.third.org.apache.commons.fileupload.FileItemFactory;
import org.apache.commons.fileupload.FileUpload; import com.fr.third.org.apache.commons.fileupload.FileUpload;
import org.apache.commons.fileupload.FileUploadBase; import com.fr.third.org.apache.commons.fileupload.FileUploadBase;
import org.apache.commons.fileupload.FileUploadException; import com.fr.third.org.apache.commons.fileupload.FileUploadException;
import org.apache.commons.fileupload.servlet.ServletFileUpload; import com.fr.third.org.apache.commons.fileupload.servlet.ServletFileUpload;
import com.fr.third.springframework.util.Assert; import com.fr.third.springframework.util.Assert;
import com.fr.third.springframework.web.context.ServletContextAware; import com.fr.third.springframework.web.context.ServletContextAware;
@ -56,8 +56,8 @@ import com.fr.third.springframework.web.util.WebUtils;
* @see #CommonsMultipartResolver(ServletContext) * @see #CommonsMultipartResolver(ServletContext)
* @see #setResolveLazily * @see #setResolveLazily
* @see com.fr.third.springframework.web.portlet.multipart.CommonsPortletMultipartResolver * @see com.fr.third.springframework.web.portlet.multipart.CommonsPortletMultipartResolver
* @see org.apache.commons.fileupload.servlet.ServletFileUpload * @see com.fr.third.org.apache.commons.fileupload.servlet.ServletFileUpload
* @see org.apache.commons.fileupload.disk.DiskFileItemFactory * @see com.fr.third.org.apache.commons.fileupload.disk.DiskFileItemFactory
*/ */
public class CommonsMultipartResolver extends CommonsFileUploadSupport public class CommonsMultipartResolver extends CommonsFileUploadSupport
implements MultipartResolver, ServletContextAware { 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. * instance. Can be overridden to use a custom subclass, e.g. for testing purposes.
* @param fileItemFactory the Commons FileItemFactory to use * @param fileItemFactory the Commons FileItemFactory to use
* @return the new ServletFileUpload instance * @return the new ServletFileUpload instance

Loading…
Cancel
Save