Revert "Merge branch 'SPR-10130' into cleanup-master"
This reverts commit45fa50821a, reversing changes made toa312d900f8.
This commit is contained in:
parent
d5c6d797e5
commit
70eaf02b7f
|
|
@ -33,8 +33,8 @@ configure(allprojects) {
|
|||
group = "org.springframework"
|
||||
|
||||
compileJava {
|
||||
sourceCompatibility=1.6
|
||||
targetCompatibility=1.6
|
||||
sourceCompatibility=1.5
|
||||
targetCompatibility=1.5
|
||||
}
|
||||
compileTestJava {
|
||||
sourceCompatibility=1.7
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@ public interface TargetSource extends TargetClassAware {
|
|||
* target class.
|
||||
* @return the type of targets returned by this {@link TargetSource}
|
||||
*/
|
||||
@Override
|
||||
Class<?> getTargetClass();
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -34,7 +34,6 @@ class TrueClassFilter implements ClassFilter, Serializable {
|
|||
private TrueClassFilter() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(Class clazz) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,17 +35,14 @@ class TrueMethodMatcher implements MethodMatcher, Serializable {
|
|||
private TrueMethodMatcher() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRuntime() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(Method method, Class targetClass) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(Method method, Class targetClass, Object[] args) {
|
||||
// Should never be invoked as isRuntime returns false.
|
||||
throw new UnsupportedOperationException();
|
||||
|
|
|
|||
|
|
@ -34,12 +34,10 @@ class TruePointcut implements Pointcut, Serializable {
|
|||
private TruePointcut() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ClassFilter getClassFilter() {
|
||||
return ClassFilter.TRUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MethodMatcher getMethodMatcher() {
|
||||
return MethodMatcher.TRUE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -203,7 +203,6 @@ public abstract class AbstractAspectJAdvice implements Advice, AspectJPrecedence
|
|||
return this.aspectInstanceFactory.getAspectClassLoader();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return this.aspectInstanceFactory.getOrder();
|
||||
}
|
||||
|
|
@ -213,7 +212,6 @@ public abstract class AbstractAspectJAdvice implements Advice, AspectJPrecedence
|
|||
this.aspectName = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAspectName() {
|
||||
return this.aspectName;
|
||||
}
|
||||
|
|
@ -225,7 +223,6 @@ public abstract class AbstractAspectJAdvice implements Advice, AspectJPrecedence
|
|||
this.declarationOrder = order;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDeclarationOrder() {
|
||||
return this.declarationOrder;
|
||||
}
|
||||
|
|
@ -681,7 +678,6 @@ public abstract class AbstractAspectJAdvice implements Advice, AspectJPrecedence
|
|||
this.adviceMethod = adviceMethod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(Method method, Class targetClass) {
|
||||
return !this.adviceMethod.equals(method);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -222,7 +222,6 @@ public class AspectJAdviceParameterNameDiscoverer implements ParameterNameDiscov
|
|||
* @param method the target {@link Method}
|
||||
* @return the parameter names
|
||||
*/
|
||||
@Override
|
||||
public String[] getParameterNames(Method method) {
|
||||
this.argumentTypes = method.getParameterTypes();
|
||||
this.numberOfRemainingUnboundArguments = this.argumentTypes.length;
|
||||
|
|
@ -310,7 +309,6 @@ public class AspectJAdviceParameterNameDiscoverer implements ParameterNameDiscov
|
|||
* @throws UnsupportedOperationException if
|
||||
* {@link #setRaiseExceptions(boolean) raiseExceptions} has been set to {@code true}
|
||||
*/
|
||||
@Override
|
||||
public String[] getParameterNames(Constructor ctor) {
|
||||
if (this.raiseExceptions) {
|
||||
throw new UnsupportedOperationException("An advice method can never be a constructor");
|
||||
|
|
|
|||
|
|
@ -37,7 +37,6 @@ public class AspectJAfterAdvice extends AbstractAspectJAdvice implements MethodI
|
|||
super(aspectJBeforeAdviceMethod, pointcut, aif);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object invoke(MethodInvocation mi) throws Throwable {
|
||||
try {
|
||||
return mi.proceed();
|
||||
|
|
@ -47,12 +46,10 @@ public class AspectJAfterAdvice extends AbstractAspectJAdvice implements MethodI
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBeforeAdvice() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAfterAdvice() {
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,12 +40,10 @@ public class AspectJAfterReturningAdvice extends AbstractAspectJAdvice implement
|
|||
super(aspectJBeforeAdviceMethod, pointcut, aif);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBeforeAdvice() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAfterAdvice() {
|
||||
return true;
|
||||
}
|
||||
|
|
@ -55,7 +53,6 @@ public class AspectJAfterReturningAdvice extends AbstractAspectJAdvice implement
|
|||
setReturningNameNoCheck(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterReturning(Object returnValue, Method method, Object[] args, Object target) throws Throwable {
|
||||
if (shouldInvokeOnReturnValueOf(method, returnValue)) {
|
||||
invokeAdviceMethod(getJoinPointMatch(), returnValue, null);
|
||||
|
|
|
|||
|
|
@ -37,12 +37,10 @@ public class AspectJAfterThrowingAdvice extends AbstractAspectJAdvice implements
|
|||
super(aspectJBeforeAdviceMethod, pointcut, aif);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBeforeAdvice() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAfterAdvice() {
|
||||
return true;
|
||||
}
|
||||
|
|
@ -52,7 +50,6 @@ public class AspectJAfterThrowingAdvice extends AbstractAspectJAdvice implements
|
|||
setThrowingNameNoCheck(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object invoke(MethodInvocation mi) throws Throwable {
|
||||
try {
|
||||
return mi.proceed();
|
||||
|
|
|
|||
|
|
@ -41,12 +41,10 @@ public class AspectJAroundAdvice extends AbstractAspectJAdvice implements Method
|
|||
super(aspectJAroundAdviceMethod, pointcut, aif);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBeforeAdvice() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAfterAdvice() {
|
||||
return false;
|
||||
}
|
||||
|
|
@ -57,7 +55,6 @@ public class AspectJAroundAdvice extends AbstractAspectJAdvice implements Method
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Object invoke(MethodInvocation mi) throws Throwable {
|
||||
if (!(mi instanceof ProxyMethodInvocation)) {
|
||||
throw new IllegalStateException("MethodInvocation is not a Spring ProxyMethodInvocation: " + mi);
|
||||
|
|
|
|||
|
|
@ -155,19 +155,16 @@ public class AspectJExpressionPointcut extends AbstractExpressionPointcut
|
|||
this.pointcutParameterTypes = types;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBeanFactory(BeanFactory beanFactory) {
|
||||
this.beanFactory = beanFactory;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ClassFilter getClassFilter() {
|
||||
checkReadyToMatch();
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MethodMatcher getMethodMatcher() {
|
||||
checkReadyToMatch();
|
||||
return this;
|
||||
|
|
@ -247,7 +244,6 @@ public class AspectJExpressionPointcut extends AbstractExpressionPointcut
|
|||
return this.pointcutExpression;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(Class targetClass) {
|
||||
checkReadyToMatch();
|
||||
try {
|
||||
|
|
@ -271,7 +267,6 @@ public class AspectJExpressionPointcut extends AbstractExpressionPointcut
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(Method method, Class targetClass, boolean beanHasIntroductions) {
|
||||
checkReadyToMatch();
|
||||
Method targetMethod = AopUtils.getMostSpecificMethod(method, targetClass);
|
||||
|
|
@ -292,18 +287,15 @@ public class AspectJExpressionPointcut extends AbstractExpressionPointcut
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(Method method, Class targetClass) {
|
||||
return matches(method, targetClass, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRuntime() {
|
||||
checkReadyToMatch();
|
||||
return this.pointcutExpression.mayNeedDynamicTest();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(Method method, Class targetClass, Object[] args) {
|
||||
checkReadyToMatch();
|
||||
ShadowMatch shadowMatch = getShadowMatch(AopUtils.getMostSpecificMethod(method, targetClass), method);
|
||||
|
|
@ -514,12 +506,10 @@ public class AspectJExpressionPointcut extends AbstractExpressionPointcut
|
|||
|
||||
private static final String BEAN_DESIGNATOR_NAME = "bean";
|
||||
|
||||
@Override
|
||||
public String getDesignatorName() {
|
||||
return BEAN_DESIGNATOR_NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ContextBasedMatcher parse(String expression) {
|
||||
return new BeanNameContextMatcher(expression);
|
||||
}
|
||||
|
|
@ -541,27 +531,22 @@ public class AspectJExpressionPointcut extends AbstractExpressionPointcut
|
|||
this.expressionPattern = new NamePattern(expression);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean couldMatchJoinPointsInType(Class someClass) {
|
||||
return (contextMatch(someClass) == FuzzyBoolean.YES);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean couldMatchJoinPointsInType(Class someClass, MatchingContext context) {
|
||||
return (contextMatch(someClass) == FuzzyBoolean.YES);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matchesDynamically(MatchingContext context) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FuzzyBoolean matchesStatically(MatchingContext context) {
|
||||
return contextMatch(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean mayNeedDynamicTest() {
|
||||
return false;
|
||||
}
|
||||
|
|
@ -626,22 +611,18 @@ public class AspectJExpressionPointcut extends AbstractExpressionPointcut
|
|||
this.other = other;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean alwaysMatches() {
|
||||
return primary.alwaysMatches();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean maybeMatches() {
|
||||
return primary.maybeMatches();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean neverMatches() {
|
||||
return primary.neverMatches();
|
||||
}
|
||||
|
||||
@Override
|
||||
public JoinPointMatch matchesJoinPoint(Object thisObject,
|
||||
Object targetObject, Object[] args) {
|
||||
try {
|
||||
|
|
@ -651,7 +632,6 @@ public class AspectJExpressionPointcut extends AbstractExpressionPointcut
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMatchingContext(MatchingContext aMatchContext) {
|
||||
primary.setMatchingContext(aMatchContext);
|
||||
other.setMatchingContext(aMatchContext);
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@ public class AspectJExpressionPointcutAdvisor extends AbstractGenericPointcutAdv
|
|||
private final AspectJExpressionPointcut pointcut = new AspectJExpressionPointcut();
|
||||
|
||||
|
||||
@Override
|
||||
public Pointcut getPointcut() {
|
||||
return this.pointcut;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,17 +35,14 @@ public class AspectJMethodBeforeAdvice extends AbstractAspectJAdvice implements
|
|||
super(aspectJBeforeAdviceMethod, pointcut, aif);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void before(Method method, Object[] args, Object target) throws Throwable {
|
||||
invokeAdviceMethod(getJoinPointMatch(), null, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBeforeAdvice() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAfterAdvice() {
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,22 +56,18 @@ public class AspectJPointcutAdvisor implements PointcutAdvisor, Ordered {
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isPerInstance() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Advice getAdvice() {
|
||||
return this.advice;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pointcut getPointcut() {
|
||||
return this.pointcut;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
if (this.order != null) {
|
||||
return this.order;
|
||||
|
|
|
|||
|
|
@ -48,7 +48,6 @@ public class AspectJWeaverMessageHandler implements IMessageHandler {
|
|||
private static final Log LOGGER = LogFactory.getLog("AspectJ Weaver");
|
||||
|
||||
|
||||
@Override
|
||||
public boolean handleMessage(IMessage message) throws AbortException {
|
||||
Kind messageKind = message.getKind();
|
||||
|
||||
|
|
@ -94,18 +93,15 @@ public class AspectJWeaverMessageHandler implements IMessageHandler {
|
|||
return AJ_ID + aMessage.getMessage();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isIgnoring(Kind messageKind) {
|
||||
// We want to see everything, and allow configuration of log levels dynamically.
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dontIgnore(Kind messageKind) {
|
||||
// We weren't ignoring anything anyway...
|
||||
}
|
||||
|
||||
@Override
|
||||
public void ignore(Kind kind) {
|
||||
// We weren't ignoring anything anyway...
|
||||
}
|
||||
|
|
|
|||
|
|
@ -77,7 +77,6 @@ public class DeclareParentsAdvisor implements IntroductionAdvisor {
|
|||
|
||||
// Excludes methods implemented.
|
||||
ClassFilter exclusion = new ClassFilter() {
|
||||
@Override
|
||||
public boolean matches(Class clazz) {
|
||||
return !(introducedInterface.isAssignableFrom(clazz));
|
||||
}
|
||||
|
|
@ -88,27 +87,22 @@ public class DeclareParentsAdvisor implements IntroductionAdvisor {
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ClassFilter getClassFilter() {
|
||||
return this.typePatternClassFilter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validateInterfaces() throws IllegalArgumentException {
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPerInstance() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Advice getAdvice() {
|
||||
return this.advice;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class[] getInterfaces() {
|
||||
return new Class[] {this.introducedInterface};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,17 +72,14 @@ public class MethodInvocationProceedingJoinPoint implements ProceedingJoinPoint,
|
|||
this.methodInvocation = methodInvocation;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void set$AroundClosure(AroundClosure aroundClosure) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object proceed() throws Throwable {
|
||||
return this.methodInvocation.invocableClone().proceed();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object proceed(Object[] arguments) throws Throwable {
|
||||
Assert.notNull(arguments, "Argument array passed to proceed cannot be null");
|
||||
if (arguments.length != this.methodInvocation.getArguments().length) {
|
||||
|
|
@ -97,7 +94,6 @@ public class MethodInvocationProceedingJoinPoint implements ProceedingJoinPoint,
|
|||
/**
|
||||
* Returns the Spring AOP proxy. Cannot be {@code null}.
|
||||
*/
|
||||
@Override
|
||||
public Object getThis() {
|
||||
return this.methodInvocation.getProxy();
|
||||
}
|
||||
|
|
@ -105,12 +101,10 @@ public class MethodInvocationProceedingJoinPoint implements ProceedingJoinPoint,
|
|||
/**
|
||||
* Returns the Spring AOP target. May be {@code null} if there is no target.
|
||||
*/
|
||||
@Override
|
||||
public Object getTarget() {
|
||||
return this.methodInvocation.getThis();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object[] getArgs() {
|
||||
if (this.defensiveCopyOfArgs == null) {
|
||||
Object[] argsSource = this.methodInvocation.getArguments();
|
||||
|
|
@ -120,7 +114,6 @@ public class MethodInvocationProceedingJoinPoint implements ProceedingJoinPoint,
|
|||
return this.defensiveCopyOfArgs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Signature getSignature() {
|
||||
if (this.signature == null) {
|
||||
this.signature = new MethodSignatureImpl();
|
||||
|
|
@ -128,7 +121,6 @@ public class MethodInvocationProceedingJoinPoint implements ProceedingJoinPoint,
|
|||
return signature;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SourceLocation getSourceLocation() {
|
||||
if (this.sourceLocation == null) {
|
||||
this.sourceLocation = new SourceLocationImpl();
|
||||
|
|
@ -136,28 +128,23 @@ public class MethodInvocationProceedingJoinPoint implements ProceedingJoinPoint,
|
|||
return this.sourceLocation;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getKind() {
|
||||
return ProceedingJoinPoint.METHOD_EXECUTION;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
// TODO: It's just an adapter but returning 0 might still have side effects...
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JoinPoint.StaticPart getStaticPart() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toShortString() {
|
||||
return "execution(" + getSignature().toShortString() + ")";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toLongString() {
|
||||
return "execution(" + getSignature().toLongString() + ")";
|
||||
}
|
||||
|
|
@ -174,42 +161,34 @@ public class MethodInvocationProceedingJoinPoint implements ProceedingJoinPoint,
|
|||
|
||||
private volatile String[] parameterNames;
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return methodInvocation.getMethod().getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getModifiers() {
|
||||
return methodInvocation.getMethod().getModifiers();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class getDeclaringType() {
|
||||
return methodInvocation.getMethod().getDeclaringClass();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDeclaringTypeName() {
|
||||
return methodInvocation.getMethod().getDeclaringClass().getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class getReturnType() {
|
||||
return methodInvocation.getMethod().getReturnType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Method getMethod() {
|
||||
return methodInvocation.getMethod();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class[] getParameterTypes() {
|
||||
return methodInvocation.getMethod().getParameterTypes();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getParameterNames() {
|
||||
if (this.parameterNames == null) {
|
||||
this.parameterNames = (new LocalVariableTableParameterNameDiscoverer()).getParameterNames(getMethod());
|
||||
|
|
@ -217,17 +196,14 @@ public class MethodInvocationProceedingJoinPoint implements ProceedingJoinPoint,
|
|||
return this.parameterNames;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class[] getExceptionTypes() {
|
||||
return methodInvocation.getMethod().getExceptionTypes();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toShortString() {
|
||||
return toString(false, false, false, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toLongString() {
|
||||
return toString(true, true, true, true);
|
||||
}
|
||||
|
|
@ -291,7 +267,6 @@ public class MethodInvocationProceedingJoinPoint implements ProceedingJoinPoint,
|
|||
*/
|
||||
private class SourceLocationImpl implements SourceLocation {
|
||||
|
||||
@Override
|
||||
public Class getWithinType() {
|
||||
if (methodInvocation.getThis() == null) {
|
||||
throw new UnsupportedOperationException("No source location joinpoint available: target is null");
|
||||
|
|
@ -299,17 +274,14 @@ public class MethodInvocationProceedingJoinPoint implements ProceedingJoinPoint,
|
|||
return methodInvocation.getThis().getClass();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFileName() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLine() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColumn() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -106,44 +106,35 @@ class RuntimeTestWalker {
|
|||
protected static final int AT_TARGET_VAR = 4;
|
||||
protected static final int AT_ANNOTATION_VAR = 8;
|
||||
|
||||
@Override
|
||||
public void visit(And e) {
|
||||
e.getLeft().accept(this);
|
||||
e.getRight().accept(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(Or e) {
|
||||
e.getLeft().accept(this);
|
||||
e.getRight().accept(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(Not e) {
|
||||
e.getBody().accept(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(Instanceof i) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(Literal literal) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(Call call) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(FieldGetCall fieldGetCall) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(HasAnnotation hasAnnotation) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(MatchingContextBasedTest matchingContextTest) {
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -49,7 +49,6 @@ public class SimpleAspectInstanceFactory implements AspectInstanceFactory {
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public final Object getAspectInstance() {
|
||||
try {
|
||||
return this.aspectClass.newInstance();
|
||||
|
|
@ -62,7 +61,6 @@ public class SimpleAspectInstanceFactory implements AspectInstanceFactory {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ClassLoader getAspectClassLoader() {
|
||||
return this.aspectClass.getClassLoader();
|
||||
}
|
||||
|
|
@ -75,7 +73,6 @@ public class SimpleAspectInstanceFactory implements AspectInstanceFactory {
|
|||
* @see org.springframework.core.Ordered
|
||||
* @see #getOrderForAspectClass
|
||||
*/
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return getOrderForAspectClass(this.aspectClass);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,12 +44,10 @@ public class SingletonAspectInstanceFactory implements AspectInstanceFactory {
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public final Object getAspectInstance() {
|
||||
return this.aspectInstance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ClassLoader getAspectClassLoader() {
|
||||
return this.aspectInstance.getClass().getClassLoader();
|
||||
}
|
||||
|
|
@ -62,7 +60,6 @@ public class SingletonAspectInstanceFactory implements AspectInstanceFactory {
|
|||
* @see org.springframework.core.Ordered
|
||||
* @see #getOrderForAspectClass
|
||||
*/
|
||||
@Override
|
||||
public int getOrder() {
|
||||
if (this.aspectInstance instanceof Ordered) {
|
||||
return ((Ordered) this.aspectInstance).getOrder();
|
||||
|
|
|
|||
|
|
@ -93,7 +93,6 @@ public class TypePatternClassFilter implements ClassFilter {
|
|||
* @return whether the advice should apply to this candidate target class
|
||||
* @throws IllegalStateException if no {@link #setTypePattern(String)} has been set
|
||||
*/
|
||||
@Override
|
||||
public boolean matches(Class clazz) {
|
||||
if (this.aspectJTypePatternMatcher == null) {
|
||||
throw new IllegalStateException("No 'typePattern' has been set via ctor/setter.");
|
||||
|
|
|
|||
|
|
@ -111,7 +111,6 @@ public abstract class AbstractAspectJAdvisorFactory implements AspectJAdvisorFac
|
|||
* is that aspects written in the code-style (AspectJ language) also have the annotation present
|
||||
* when compiled by ajc with the -1.5 flag, yet they cannot be consumed by Spring AOP.
|
||||
*/
|
||||
@Override
|
||||
public boolean isAspect(Class<?> clazz) {
|
||||
return (hasAspectAnnotation(clazz) && !compiledByAjc(clazz));
|
||||
}
|
||||
|
|
@ -136,7 +135,6 @@ public abstract class AbstractAspectJAdvisorFactory implements AspectJAdvisorFac
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(Class<?> aspectClass) throws AopConfigException {
|
||||
// If the parent has the annotation and isn't abstract it's an error
|
||||
if (aspectClass.getSuperclass().getAnnotation(Aspect.class) != null &&
|
||||
|
|
@ -311,7 +309,6 @@ public abstract class AbstractAspectJAdvisorFactory implements AspectJAdvisorFac
|
|||
*/
|
||||
private static class AspectJAnnotationParameterNameDiscoverer implements ParameterNameDiscoverer {
|
||||
|
||||
@Override
|
||||
public String[] getParameterNames(Method method) {
|
||||
if (method.getParameterTypes().length == 0) {
|
||||
return new String[0];
|
||||
|
|
@ -333,7 +330,6 @@ public abstract class AbstractAspectJAdvisorFactory implements AspectJAdvisorFac
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getParameterNames(Constructor ctor) {
|
||||
throw new UnsupportedOperationException("Spring AOP cannot handle constructor advice");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,12 +72,10 @@ public class BeanFactoryAspectInstanceFactory implements MetadataAwareAspectInst
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Object getAspectInstance() {
|
||||
return this.beanFactory.getBean(this.name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ClassLoader getAspectClassLoader() {
|
||||
if (this.beanFactory instanceof ConfigurableBeanFactory) {
|
||||
return ((ConfigurableBeanFactory) this.beanFactory).getBeanClassLoader();
|
||||
|
|
@ -87,7 +85,6 @@ public class BeanFactoryAspectInstanceFactory implements MetadataAwareAspectInst
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AspectMetadata getAspectMetadata() {
|
||||
return this.aspectMetadata;
|
||||
}
|
||||
|
|
@ -102,7 +99,6 @@ public class BeanFactoryAspectInstanceFactory implements MetadataAwareAspectInst
|
|||
* @see org.springframework.core.Ordered
|
||||
* @see org.springframework.core.annotation.Order
|
||||
*/
|
||||
@Override
|
||||
public int getOrder() {
|
||||
Class<?> type = this.beanFactory.getType(this.name);
|
||||
if (type != null) {
|
||||
|
|
|
|||
|
|
@ -97,7 +97,6 @@ class InstantiationModelAwarePointcutAdvisorImpl
|
|||
* 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;
|
||||
}
|
||||
|
|
@ -107,7 +106,6 @@ class InstantiationModelAwarePointcutAdvisorImpl
|
|||
* 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);
|
||||
}
|
||||
|
|
@ -122,7 +120,6 @@ class InstantiationModelAwarePointcutAdvisorImpl
|
|||
/**
|
||||
* Lazily instantiate advice if necessary.
|
||||
*/
|
||||
@Override
|
||||
public synchronized Advice getAdvice() {
|
||||
if (this.instantiatedAdvice == null) {
|
||||
this.instantiatedAdvice = instantiateAdvice(this.declaredPointcut);
|
||||
|
|
@ -130,12 +127,10 @@ class InstantiationModelAwarePointcutAdvisorImpl
|
|||
return this.instantiatedAdvice;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isLazy() {
|
||||
return this.lazy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized boolean isAdviceInstantiated() {
|
||||
return (this.instantiatedAdvice != null);
|
||||
}
|
||||
|
|
@ -154,22 +149,18 @@ class InstantiationModelAwarePointcutAdvisorImpl
|
|||
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();
|
||||
|
|
@ -177,7 +168,6 @@ class InstantiationModelAwarePointcutAdvisorImpl
|
|||
return this.isBeforeAdvice;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAfterAdvice() {
|
||||
if (this.isAfterAdvice == null) {
|
||||
determineAdviceType();
|
||||
|
|
@ -255,7 +245,6 @@ class InstantiationModelAwarePointcutAdvisorImpl
|
|||
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));
|
||||
|
|
|
|||
|
|
@ -42,7 +42,6 @@ public class LazySingletonAspectInstanceFactoryDecorator implements MetadataAwar
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public synchronized Object getAspectInstance() {
|
||||
if (this.materialized == null) {
|
||||
synchronized (this) {
|
||||
|
|
@ -58,17 +57,14 @@ public class LazySingletonAspectInstanceFactoryDecorator implements MetadataAwar
|
|||
return (this.materialized != null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ClassLoader getAspectClassLoader() {
|
||||
return this.maaif.getAspectClassLoader();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AspectMetadata getAspectMetadata() {
|
||||
return this.maaif.getAspectMetadata();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return this.maaif.getOrder();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,7 +75,6 @@ public class ReflectiveAspectJAdvisorFactory extends AbstractAspectJAdvisorFacto
|
|||
new InstanceComparator<Annotation>(
|
||||
Around.class, Before.class, After.class, AfterReturning.class, AfterThrowing.class),
|
||||
new Converter<Method, Annotation>() {
|
||||
@Override
|
||||
public Annotation convert(Method method) {
|
||||
AspectJAnnotation<?> annotation = AbstractAspectJAdvisorFactory.findAspectJAnnotationOnMethod(method);
|
||||
return annotation == null ? null : annotation.getAnnotation();
|
||||
|
|
@ -83,7 +82,6 @@ public class ReflectiveAspectJAdvisorFactory extends AbstractAspectJAdvisorFacto
|
|||
}));
|
||||
comparator.addComparator(new ConvertingComparator<Method, String>(
|
||||
new Converter<Method, String>() {
|
||||
@Override
|
||||
public String convert(Method method) {
|
||||
return method.getName();
|
||||
}
|
||||
|
|
@ -92,7 +90,6 @@ public class ReflectiveAspectJAdvisorFactory extends AbstractAspectJAdvisorFacto
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<Advisor> getAdvisors(MetadataAwareAspectInstanceFactory maaif) {
|
||||
final Class<?> aspectClass = maaif.getAspectMetadata().getAspectClass();
|
||||
final String aspectName = maaif.getAspectMetadata().getAspectName();
|
||||
|
|
@ -131,7 +128,6 @@ public class ReflectiveAspectJAdvisorFactory extends AbstractAspectJAdvisorFacto
|
|||
private List<Method> getAdvisorMethods(Class<?> aspectClass) {
|
||||
final List<Method> methods = new LinkedList<Method>();
|
||||
ReflectionUtils.doWithMethods(aspectClass, new ReflectionUtils.MethodCallback() {
|
||||
@Override
|
||||
public void doWith(Method method) throws IllegalArgumentException {
|
||||
// Exclude pointcuts
|
||||
if (AnnotationUtils.getAnnotation(method, Pointcut.class) == null) {
|
||||
|
|
@ -168,7 +164,6 @@ public class ReflectiveAspectJAdvisorFactory extends AbstractAspectJAdvisorFacto
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Advisor getAdvisor(Method candidateAdviceMethod, MetadataAwareAspectInstanceFactory aif,
|
||||
int declarationOrderInAspect, String aspectName) {
|
||||
|
||||
|
|
@ -196,7 +191,6 @@ public class ReflectiveAspectJAdvisorFactory extends AbstractAspectJAdvisorFacto
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Advice getAdvice(Method candidateAdviceMethod, AspectJExpressionPointcut ajexp,
|
||||
MetadataAwareAspectInstanceFactory aif, int declarationOrderInAspect, String aspectName) {
|
||||
|
||||
|
|
@ -278,7 +272,6 @@ public class ReflectiveAspectJAdvisorFactory extends AbstractAspectJAdvisorFacto
|
|||
|
||||
public SyntheticInstantiationAdvisor(final MetadataAwareAspectInstanceFactory aif) {
|
||||
super(aif.getAspectMetadata().getPerClausePointcut(), new MethodBeforeAdvice() {
|
||||
@Override
|
||||
public void before(Method method, Object[] args, Object target) {
|
||||
// Simply instantiate the aspect
|
||||
aif.getAspectInstance();
|
||||
|
|
|
|||
|
|
@ -45,7 +45,6 @@ public class SimpleMetadataAwareAspectInstanceFactory extends SimpleAspectInstan
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public final AspectMetadata getAspectMetadata() {
|
||||
return this.metadata;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,7 +47,6 @@ public class SingletonMetadataAwareAspectInstanceFactory extends SingletonAspect
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public final AspectMetadata getAspectMetadata() {
|
||||
return this.metadata;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -131,13 +131,11 @@ public class AspectJAwareAdvisorAutoProxyCreator extends AbstractAdvisorAutoProx
|
|||
this.comparator = comparator;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(Object obj) {
|
||||
Advisor otherAdvisor = ((PartiallyComparableAdvisorHolder) obj).advisor;
|
||||
return this.comparator.compare(this.advisor, otherAdvisor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int fallbackCompareTo(Object obj) {
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,7 +76,6 @@ class AspectJPrecedenceComparator implements Comparator {
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int compare(Object o1, Object o2) {
|
||||
if (!(o1 instanceof Advisor && o2 instanceof Advisor)) {
|
||||
throw new IllegalArgumentException(
|
||||
|
|
|
|||
|
|
@ -58,7 +58,6 @@ import org.springframework.util.StringUtils;
|
|||
*/
|
||||
public abstract class AbstractInterceptorDrivenBeanDefinitionDecorator implements BeanDefinitionDecorator {
|
||||
|
||||
@Override
|
||||
public final BeanDefinitionHolder decorate(Node node, BeanDefinitionHolder definitionHolder, ParserContext parserContext) {
|
||||
BeanDefinitionRegistry registry = parserContext.getRegistry();
|
||||
|
||||
|
|
|
|||
|
|
@ -91,7 +91,6 @@ public class AdvisorComponentDefinition extends AbstractComponentDefinition {
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return this.advisorBeanName;
|
||||
}
|
||||
|
|
@ -111,7 +110,6 @@ public class AdvisorComponentDefinition extends AbstractComponentDefinition {
|
|||
return this.beanReferences;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getSource() {
|
||||
return this.advisorDefinition.getSource();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,7 +59,6 @@ public class AopNamespaceHandler extends NamespaceHandlerSupport {
|
|||
* '{@code config}', '{@code spring-configured}', '{@code aspectj-autoproxy}'
|
||||
* and '{@code scoped-proxy}' tags.
|
||||
*/
|
||||
@Override
|
||||
public void init() {
|
||||
// In 2.0 XSD as well as in 2.1 XSD.
|
||||
registerBeanDefinitionParser("config", new ConfigBeanDefinitionParser());
|
||||
|
|
|
|||
|
|
@ -37,7 +37,6 @@ import org.springframework.beans.factory.xml.ParserContext;
|
|||
*/
|
||||
class AspectJAutoProxyBeanDefinitionParser implements BeanDefinitionParser {
|
||||
|
||||
@Override
|
||||
public BeanDefinition parse(Element element, ParserContext parserContext) {
|
||||
AopNamespaceUtils.registerAspectJAnnotationAutoProxyCreatorIfNecessary(parserContext, element);
|
||||
extendBeanDefinition(element, parserContext);
|
||||
|
|
|
|||
|
|
@ -95,7 +95,6 @@ class ConfigBeanDefinitionParser implements BeanDefinitionParser {
|
|||
private ParseState parseState = new ParseState();
|
||||
|
||||
|
||||
@Override
|
||||
public BeanDefinition parse(Element element, ParserContext parserContext) {
|
||||
CompositeComponentDefinition compositeDef =
|
||||
new CompositeComponentDefinition(element.getTagName(), parserContext.extractSource(element));
|
||||
|
|
|
|||
|
|
@ -57,7 +57,6 @@ public class MethodLocatingFactoryBean implements FactoryBean<Method>, BeanFacto
|
|||
this.methodName = methodName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBeanFactory(BeanFactory beanFactory) {
|
||||
if (!StringUtils.hasText(this.targetBeanName)) {
|
||||
throw new IllegalArgumentException("Property 'targetBeanName' is required");
|
||||
|
|
@ -79,17 +78,14 @@ public class MethodLocatingFactoryBean implements FactoryBean<Method>, BeanFacto
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Method getObject() throws Exception {
|
||||
return this.method;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<Method> getObjectType() {
|
||||
return Method.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSingleton() {
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,7 +46,6 @@ public class PointcutComponentDefinition extends AbstractComponentDefinition {
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return this.pointcutBeanName;
|
||||
}
|
||||
|
|
@ -61,7 +60,6 @@ public class PointcutComponentDefinition extends AbstractComponentDefinition {
|
|||
return new BeanDefinition[] {this.pointcutDefinition};
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getSource() {
|
||||
return this.pointcutDefinition.getSource();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@ class ScopedProxyBeanDefinitionDecorator implements BeanDefinitionDecorator {
|
|||
private static final String PROXY_TARGET_CLASS = "proxy-target-class";
|
||||
|
||||
|
||||
@Override
|
||||
public BeanDefinitionHolder decorate(Node node, BeanDefinitionHolder definition, ParserContext parserContext) {
|
||||
boolean proxyTargetClass = true;
|
||||
if (node instanceof Element) {
|
||||
|
|
|
|||
|
|
@ -47,7 +47,6 @@ public class SimpleBeanFactoryAwareAspectInstanceFactory implements AspectInstan
|
|||
this.aspectBeanName = aspectBeanName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBeanFactory(BeanFactory beanFactory) {
|
||||
this.beanFactory = beanFactory;
|
||||
if (!StringUtils.hasText(this.aspectBeanName)) {
|
||||
|
|
@ -60,12 +59,10 @@ public class SimpleBeanFactoryAwareAspectInstanceFactory implements AspectInstan
|
|||
* Look up the aspect bean from the {@link BeanFactory} and returns it.
|
||||
* @see #setAspectBeanName
|
||||
*/
|
||||
@Override
|
||||
public Object getAspectInstance() {
|
||||
return this.beanFactory.getBean(this.aspectBeanName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ClassLoader getAspectClassLoader() {
|
||||
if (this.beanFactory instanceof ConfigurableBeanFactory) {
|
||||
return ((ConfigurableBeanFactory) this.beanFactory).getBeanClassLoader();
|
||||
|
|
@ -75,7 +72,6 @@ public class SimpleBeanFactoryAwareAspectInstanceFactory implements AspectInstan
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
if (this.beanFactory.isSingleton(this.aspectBeanName) &&
|
||||
this.beanFactory.isTypeMatch(this.aspectBeanName, Ordered.class)) {
|
||||
|
|
|
|||
|
|
@ -50,7 +50,6 @@ class SpringConfiguredBeanDefinitionParser implements BeanDefinitionParser {
|
|||
"org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect";
|
||||
|
||||
|
||||
@Override
|
||||
public BeanDefinition parse(Element element, ParserContext parserContext) {
|
||||
if (!parserContext.getRegistry().containsBeanDefinition(BEAN_CONFIGURER_ASPECT_BEAN_NAME)) {
|
||||
RootBeanDefinition def = new RootBeanDefinition();
|
||||
|
|
|
|||
|
|
@ -50,7 +50,6 @@ public abstract class AbstractAdvisingBeanPostProcessor extends ProxyConfig
|
|||
private final Map<String, Boolean> eligibleBeans = new ConcurrentHashMap<String, Boolean>(64);
|
||||
|
||||
|
||||
@Override
|
||||
public void setBeanClassLoader(ClassLoader beanClassLoader) {
|
||||
this.beanClassLoader = beanClassLoader;
|
||||
}
|
||||
|
|
@ -59,18 +58,15 @@ public abstract class AbstractAdvisingBeanPostProcessor extends ProxyConfig
|
|||
this.order = order;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return this.order;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Object postProcessBeforeInitialization(Object bean, String beanName) {
|
||||
return bean;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object postProcessAfterInitialization(Object bean, String beanName) {
|
||||
if (bean instanceof AopInfrastructureBean) {
|
||||
// Ignore AOP infrastructure such as scoped proxies.
|
||||
|
|
|
|||
|
|
@ -122,7 +122,6 @@ public abstract class AbstractSingletonProxyFactoryBean extends ProxyConfig
|
|||
this.proxyClassLoader = classLoader;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBeanClassLoader(ClassLoader classLoader) {
|
||||
if (this.proxyClassLoader == null) {
|
||||
this.proxyClassLoader = classLoader;
|
||||
|
|
@ -130,7 +129,6 @@ public abstract class AbstractSingletonProxyFactoryBean extends ProxyConfig
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() {
|
||||
if (this.target == null) {
|
||||
throw new IllegalArgumentException("Property 'target' is required");
|
||||
|
|
@ -192,7 +190,6 @@ public abstract class AbstractSingletonProxyFactoryBean extends ProxyConfig
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Object getObject() {
|
||||
if (this.proxy == null) {
|
||||
throw new FactoryBeanNotInitializedException();
|
||||
|
|
@ -200,7 +197,6 @@ public abstract class AbstractSingletonProxyFactoryBean extends ProxyConfig
|
|||
return this.proxy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getObjectType() {
|
||||
if (this.proxy != null) {
|
||||
return this.proxy.getClass();
|
||||
|
|
@ -217,7 +213,6 @@ public abstract class AbstractSingletonProxyFactoryBean extends ProxyConfig
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean isSingleton() {
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -137,12 +137,10 @@ public class AdvisedSupport extends ProxyConfig implements Advised {
|
|||
setTargetSource(new SingletonTargetSource(target));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTargetSource(TargetSource targetSource) {
|
||||
this.targetSource = (targetSource != null ? targetSource : EMPTY_TARGET_SOURCE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TargetSource getTargetSource() {
|
||||
return this.targetSource;
|
||||
}
|
||||
|
|
@ -164,17 +162,14 @@ public class AdvisedSupport extends ProxyConfig implements Advised {
|
|||
this.targetSource = EmptyTargetSource.forClass(targetClass);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getTargetClass() {
|
||||
return this.targetSource.getTargetClass();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPreFiltered(boolean preFiltered) {
|
||||
this.preFiltered = preFiltered;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPreFiltered() {
|
||||
return this.preFiltered;
|
||||
}
|
||||
|
|
@ -233,12 +228,10 @@ public class AdvisedSupport extends ProxyConfig implements Advised {
|
|||
return this.interfaces.remove(intf);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class[] getProxiedInterfaces() {
|
||||
return this.interfaces.toArray(new Class[this.interfaces.size()]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInterfaceProxied(Class intf) {
|
||||
for (Class proxyIntf : this.interfaces) {
|
||||
if (intf.isAssignableFrom(proxyIntf)) {
|
||||
|
|
@ -249,18 +242,15 @@ public class AdvisedSupport extends ProxyConfig implements Advised {
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public final Advisor[] getAdvisors() {
|
||||
return this.advisorArray;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addAdvisor(Advisor advisor) {
|
||||
int pos = this.advisors.size();
|
||||
addAdvisor(pos, advisor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addAdvisor(int pos, Advisor advisor) throws AopConfigException {
|
||||
if (advisor instanceof IntroductionAdvisor) {
|
||||
validateIntroductionAdvisor((IntroductionAdvisor) advisor);
|
||||
|
|
@ -268,7 +258,6 @@ public class AdvisedSupport extends ProxyConfig implements Advised {
|
|||
addAdvisorInternal(pos, advisor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removeAdvisor(Advisor advisor) {
|
||||
int index = indexOf(advisor);
|
||||
if (index == -1) {
|
||||
|
|
@ -280,7 +269,6 @@ public class AdvisedSupport extends ProxyConfig implements Advised {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeAdvisor(int index) throws AopConfigException {
|
||||
if (isFrozen()) {
|
||||
throw new AopConfigException("Cannot remove Advisor: Configuration is frozen.");
|
||||
|
|
@ -304,13 +292,11 @@ public class AdvisedSupport extends ProxyConfig implements Advised {
|
|||
adviceChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int indexOf(Advisor advisor) {
|
||||
Assert.notNull(advisor, "Advisor must not be null");
|
||||
return this.advisors.indexOf(advisor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean replaceAdvisor(Advisor a, Advisor b) throws AopConfigException {
|
||||
Assert.notNull(a, "Advisor a must not be null");
|
||||
Assert.notNull(b, "Advisor b must not be null");
|
||||
|
|
@ -402,7 +388,6 @@ public class AdvisedSupport extends ProxyConfig implements Advised {
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void addAdvice(Advice advice) throws AopConfigException {
|
||||
int pos = this.advisors.size();
|
||||
addAdvice(pos, advice);
|
||||
|
|
@ -411,7 +396,6 @@ public class AdvisedSupport extends ProxyConfig implements Advised {
|
|||
/**
|
||||
* Cannot add introductions this way unless the advice implements IntroductionInfo.
|
||||
*/
|
||||
@Override
|
||||
public void addAdvice(int pos, Advice advice) throws AopConfigException {
|
||||
Assert.notNull(advice, "Advice must not be null");
|
||||
if (advice instanceof IntroductionInfo) {
|
||||
|
|
@ -428,7 +412,6 @@ public class AdvisedSupport extends ProxyConfig implements Advised {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removeAdvice(Advice advice) throws AopConfigException {
|
||||
int index = indexOf(advice);
|
||||
if (index == -1) {
|
||||
|
|
@ -440,7 +423,6 @@ public class AdvisedSupport extends ProxyConfig implements Advised {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int indexOf(Advice advice) {
|
||||
Assert.notNull(advice, "Advice must not be null");
|
||||
for (int i = 0; i < this.advisors.size(); i++) {
|
||||
|
|
@ -572,7 +554,6 @@ public class AdvisedSupport extends ProxyConfig implements Advised {
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toProxyConfigString() {
|
||||
return toString();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -146,12 +146,10 @@ final class CglibAopProxy implements AopProxy, Serializable {
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Object getProxy() {
|
||||
return getProxy(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getProxy(ClassLoader classLoader) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Creating CGLIB proxy: target source is " + this.advised.getTargetSource());
|
||||
|
|
@ -388,7 +386,6 @@ final class CglibAopProxy implements AopProxy, Serializable {
|
|||
this.target = target;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object intercept(Object proxy, Method method, Object[] args, MethodProxy methodProxy) throws Throwable {
|
||||
Object retVal = methodProxy.invoke(this.target, args);
|
||||
return processReturnType(proxy, this.target, method, retVal);
|
||||
|
|
@ -408,7 +405,6 @@ final class CglibAopProxy implements AopProxy, Serializable {
|
|||
this.target = target;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object intercept(Object proxy, Method method, Object[] args, MethodProxy methodProxy) throws Throwable {
|
||||
Object oldProxy = null;
|
||||
try {
|
||||
|
|
@ -436,7 +432,6 @@ final class CglibAopProxy implements AopProxy, Serializable {
|
|||
this.targetSource = targetSource;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object intercept(Object proxy, Method method, Object[] args, MethodProxy methodProxy) throws Throwable {
|
||||
Object target = this.targetSource.getTarget();
|
||||
try {
|
||||
|
|
@ -461,7 +456,6 @@ final class CglibAopProxy implements AopProxy, Serializable {
|
|||
this.targetSource = targetSource;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object intercept(Object proxy, Method method, Object[] args, MethodProxy methodProxy) throws Throwable {
|
||||
Object oldProxy = null;
|
||||
Object target = this.targetSource.getTarget();
|
||||
|
|
@ -491,7 +485,6 @@ final class CglibAopProxy implements AopProxy, Serializable {
|
|||
this.target = target;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object loadObject() {
|
||||
return this.target;
|
||||
}
|
||||
|
|
@ -509,7 +502,6 @@ final class CglibAopProxy implements AopProxy, Serializable {
|
|||
this.advised = advised;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object loadObject() throws Exception {
|
||||
return this.advised;
|
||||
}
|
||||
|
|
@ -528,7 +520,6 @@ final class CglibAopProxy implements AopProxy, Serializable {
|
|||
this.advised = advised;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object intercept(Object proxy, Method method, Object[] args, MethodProxy methodProxy) {
|
||||
Object other = args[0];
|
||||
if (proxy == other) {
|
||||
|
|
@ -561,7 +552,6 @@ final class CglibAopProxy implements AopProxy, Serializable {
|
|||
this.advised = advised;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object intercept(Object proxy, Method method, Object[] args, MethodProxy methodProxy) {
|
||||
return CglibAopProxy.class.hashCode() * 13 + this.advised.getTargetSource().hashCode();
|
||||
}
|
||||
|
|
@ -585,7 +575,6 @@ final class CglibAopProxy implements AopProxy, Serializable {
|
|||
this.targetClass = targetClass;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object intercept(Object proxy, Method method, Object[] args, MethodProxy methodProxy) throws Throwable {
|
||||
MethodInvocation invocation = new CglibMethodInvocation(proxy, this.target, method, args,
|
||||
this.targetClass, this.adviceChain, methodProxy);
|
||||
|
|
@ -609,7 +598,6 @@ final class CglibAopProxy implements AopProxy, Serializable {
|
|||
this.advised = advised;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object intercept(Object proxy, Method method, Object[] args, MethodProxy methodProxy) throws Throwable {
|
||||
Object oldProxy = null;
|
||||
boolean setProxyContext = false;
|
||||
|
|
@ -766,7 +754,6 @@ final class CglibAopProxy implements AopProxy, Serializable {
|
|||
* DynamicUnadvisedInterceptor already considers this.</dd>
|
||||
* </dl>
|
||||
*/
|
||||
@Override
|
||||
public int accept(Method method) {
|
||||
if (AopUtils.isFinalizeMethod(method)) {
|
||||
logger.debug("Found finalize() method - using NO_OVERRIDE");
|
||||
|
|
|
|||
|
|
@ -46,7 +46,6 @@ import org.springframework.aop.support.MethodMatchers;
|
|||
@SuppressWarnings("serial")
|
||||
public class DefaultAdvisorChainFactory implements AdvisorChainFactory, Serializable {
|
||||
|
||||
@Override
|
||||
public List<Object> getInterceptorsAndDynamicInterceptionAdvice(
|
||||
Advised config, Method method, Class targetClass) {
|
||||
|
||||
|
|
|
|||
|
|
@ -49,7 +49,6 @@ import org.springframework.aop.SpringProxy;
|
|||
public class DefaultAopProxyFactory implements AopProxyFactory, Serializable {
|
||||
|
||||
|
||||
@Override
|
||||
public AopProxy createAopProxy(AdvisedSupport config) throws AopConfigException {
|
||||
if (config.isOptimize() || config.isProxyTargetClass() || hasNoUserSuppliedProxyInterfaces(config)) {
|
||||
Class targetClass = config.getTargetClass();
|
||||
|
|
|
|||
|
|
@ -106,12 +106,10 @@ final class JdkDynamicAopProxy implements AopProxy, InvocationHandler, Serializa
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Object getProxy() {
|
||||
return getProxy(ClassUtils.getDefaultClassLoader());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getProxy(ClassLoader classLoader) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Creating JDK dynamic proxy: target source is " + this.advised.getTargetSource());
|
||||
|
|
@ -149,7 +147,6 @@ final class JdkDynamicAopProxy implements AopProxy, InvocationHandler, Serializa
|
|||
* <p>Callers will see exactly the exception thrown by the target,
|
||||
* unless a hook method throws an exception.
|
||||
*/
|
||||
@Override
|
||||
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
|
||||
MethodInvocation invocation;
|
||||
Object oldProxy = null;
|
||||
|
|
|
|||
|
|
@ -218,14 +218,12 @@ public class ProxyFactoryBean extends ProxyCreatorSupport
|
|||
this.classLoaderConfigured = (classLoader != null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBeanClassLoader(ClassLoader classLoader) {
|
||||
if (!this.classLoaderConfigured) {
|
||||
this.proxyClassLoader = classLoader;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBeanFactory(BeanFactory beanFactory) {
|
||||
this.beanFactory = beanFactory;
|
||||
checkInterceptorNames();
|
||||
|
|
@ -239,7 +237,6 @@ public class ProxyFactoryBean extends ProxyCreatorSupport
|
|||
* {@code getObject()} for a proxy.
|
||||
* @return a fresh AOP proxy reflecting the current state of this factory
|
||||
*/
|
||||
@Override
|
||||
public Object getObject() throws BeansException {
|
||||
initializeAdvisorChain();
|
||||
if (isSingleton()) {
|
||||
|
|
@ -260,7 +257,6 @@ public class ProxyFactoryBean extends ProxyCreatorSupport
|
|||
* a single one), the target bean type, or the TargetSource's target class.
|
||||
* @see org.springframework.aop.TargetSource#getTargetClass
|
||||
*/
|
||||
@Override
|
||||
public Class<?> getObjectType() {
|
||||
synchronized (this) {
|
||||
if (this.singletonInstance != null) {
|
||||
|
|
@ -282,7 +278,6 @@ public class ProxyFactoryBean extends ProxyCreatorSupport
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSingleton() {
|
||||
return this.singleton;
|
||||
}
|
||||
|
|
@ -643,12 +638,10 @@ public class ProxyFactoryBean extends ProxyCreatorSupport
|
|||
return beanName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Advice getAdvice() {
|
||||
throw new UnsupportedOperationException("Cannot invoke methods: " + this.message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPerInstance() {
|
||||
throw new UnsupportedOperationException("Cannot invoke methods: " + this.message);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -114,17 +114,14 @@ public class ReflectiveMethodInvocation implements ProxyMethodInvocation, Clonea
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public final Object getProxy() {
|
||||
return this.proxy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final Object getThis() {
|
||||
return this.target;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final AccessibleObject getStaticPart() {
|
||||
return this.method;
|
||||
}
|
||||
|
|
@ -134,23 +131,19 @@ public class ReflectiveMethodInvocation implements ProxyMethodInvocation, Clonea
|
|||
* May or may not correspond with a method invoked on an underlying
|
||||
* implementation of that interface.
|
||||
*/
|
||||
@Override
|
||||
public final Method getMethod() {
|
||||
return this.method;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final Object[] getArguments() {
|
||||
return (this.arguments != null ? this.arguments : new Object[0]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setArguments(Object[] arguments) {
|
||||
this.arguments = arguments;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Object proceed() throws Throwable {
|
||||
// We start with an index of -1 and increment early.
|
||||
if (this.currentInterceptorIndex == this.interceptorsAndDynamicMethodMatchers.size() - 1) {
|
||||
|
|
@ -199,7 +192,6 @@ public class ReflectiveMethodInvocation implements ProxyMethodInvocation, Clonea
|
|||
* current interceptor index.
|
||||
* @see java.lang.Object#clone()
|
||||
*/
|
||||
@Override
|
||||
public MethodInvocation invocableClone() {
|
||||
Object[] cloneArguments = null;
|
||||
if (this.arguments != null) {
|
||||
|
|
@ -218,7 +210,6 @@ public class ReflectiveMethodInvocation implements ProxyMethodInvocation, Clonea
|
|||
* current interceptor index.
|
||||
* @see java.lang.Object#clone()
|
||||
*/
|
||||
@Override
|
||||
public MethodInvocation invocableClone(Object[] arguments) {
|
||||
// Force initialization of the user attributes Map,
|
||||
// for having a shared Map reference in the clone.
|
||||
|
|
@ -239,7 +230,6 @@ public class ReflectiveMethodInvocation implements ProxyMethodInvocation, Clonea
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setUserAttribute(String key, Object value) {
|
||||
if (value != null) {
|
||||
if (this.userAttributes == null) {
|
||||
|
|
@ -254,7 +244,6 @@ public class ReflectiveMethodInvocation implements ProxyMethodInvocation, Clonea
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getUserAttribute(String key) {
|
||||
return (this.userAttributes != null ? this.userAttributes.get(key) : null);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,12 +48,10 @@ public class AdvisorAdapterRegistrationManager implements BeanPostProcessor {
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
|
||||
return bean;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
|
||||
if (bean instanceof AdvisorAdapter){
|
||||
this.advisorAdapterRegistry.registerAdvisorAdapter((AdvisorAdapter) bean);
|
||||
|
|
|
|||
|
|
@ -34,12 +34,10 @@ import org.springframework.aop.AfterReturningAdvice;
|
|||
@SuppressWarnings("serial")
|
||||
class AfterReturningAdviceAdapter implements AdvisorAdapter, Serializable {
|
||||
|
||||
@Override
|
||||
public boolean supportsAdvice(Advice advice) {
|
||||
return (advice instanceof AfterReturningAdvice);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MethodInterceptor getInterceptor(Advisor advisor) {
|
||||
AfterReturningAdvice advice = (AfterReturningAdvice) advisor.getAdvice();
|
||||
return new AfterReturningAdviceInterceptor(advice);
|
||||
|
|
|
|||
|
|
@ -47,7 +47,6 @@ public class AfterReturningAdviceInterceptor implements MethodInterceptor, After
|
|||
this.advice = advice;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object invoke(MethodInvocation mi) throws Throwable {
|
||||
Object retVal = mi.proceed();
|
||||
this.advice.afterReturning(retVal, mi.getMethod(), mi.getArguments(), mi.getThis());
|
||||
|
|
|
|||
|
|
@ -53,7 +53,6 @@ public class DefaultAdvisorAdapterRegistry implements AdvisorAdapterRegistry, Se
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Advisor wrap(Object adviceObject) throws UnknownAdviceTypeException {
|
||||
if (adviceObject instanceof Advisor) {
|
||||
return (Advisor) adviceObject;
|
||||
|
|
@ -75,7 +74,6 @@ public class DefaultAdvisorAdapterRegistry implements AdvisorAdapterRegistry, Se
|
|||
throw new UnknownAdviceTypeException(advice);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MethodInterceptor[] getInterceptors(Advisor advisor) throws UnknownAdviceTypeException {
|
||||
List<MethodInterceptor> interceptors = new ArrayList<MethodInterceptor>(3);
|
||||
Advice advice = advisor.getAdvice();
|
||||
|
|
@ -93,7 +91,6 @@ public class DefaultAdvisorAdapterRegistry implements AdvisorAdapterRegistry, Se
|
|||
return interceptors.toArray(new MethodInterceptor[interceptors.size()]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerAdvisorAdapter(AdvisorAdapter adapter) {
|
||||
this.adapters.add(adapter);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,12 +34,10 @@ import org.springframework.aop.MethodBeforeAdvice;
|
|||
@SuppressWarnings("serial")
|
||||
class MethodBeforeAdviceAdapter implements AdvisorAdapter, Serializable {
|
||||
|
||||
@Override
|
||||
public boolean supportsAdvice(Advice advice) {
|
||||
return (advice instanceof MethodBeforeAdvice);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MethodInterceptor getInterceptor(Advisor advisor) {
|
||||
MethodBeforeAdvice advice = (MethodBeforeAdvice) advisor.getAdvice();
|
||||
return new MethodBeforeAdviceInterceptor(advice);
|
||||
|
|
|
|||
|
|
@ -46,7 +46,6 @@ public class MethodBeforeAdviceInterceptor implements MethodInterceptor, Seriali
|
|||
this.advice = advice;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object invoke(MethodInvocation mi) throws Throwable {
|
||||
this.advice.before(mi.getMethod(), mi.getArguments(), mi.getThis() );
|
||||
return mi.proceed();
|
||||
|
|
|
|||
|
|
@ -34,12 +34,10 @@ import org.springframework.aop.ThrowsAdvice;
|
|||
@SuppressWarnings("serial")
|
||||
class ThrowsAdviceAdapter implements AdvisorAdapter, Serializable {
|
||||
|
||||
@Override
|
||||
public boolean supportsAdvice(Advice advice) {
|
||||
return (advice instanceof ThrowsAdvice);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MethodInterceptor getInterceptor(Advisor advisor) {
|
||||
return new ThrowsAdviceInterceptor(advisor.getAdvice());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -119,7 +119,6 @@ public class ThrowsAdviceInterceptor implements MethodInterceptor, AfterAdvice {
|
|||
return handler;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object invoke(MethodInvocation mi) throws Throwable {
|
||||
try {
|
||||
return mi.proceed();
|
||||
|
|
|
|||
|
|
@ -155,7 +155,6 @@ public abstract class AbstractAutoProxyCreator extends ProxyConfig
|
|||
this.order = order;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final int getOrder() {
|
||||
return this.order;
|
||||
}
|
||||
|
|
@ -233,14 +232,12 @@ public abstract class AbstractAutoProxyCreator extends ProxyConfig
|
|||
this.classLoaderConfigured = (classLoader != null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBeanClassLoader(ClassLoader classLoader) {
|
||||
if (!this.classLoaderConfigured) {
|
||||
this.proxyClassLoader = classLoader;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBeanFactory(BeanFactory beanFactory) {
|
||||
this.beanFactory = beanFactory;
|
||||
}
|
||||
|
|
@ -254,25 +251,21 @@ public abstract class AbstractAutoProxyCreator extends ProxyConfig
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Class<?> predictBeanType(Class<?> beanClass, String beanName) {
|
||||
Object cacheKey = getCacheKey(beanClass, beanName);
|
||||
return this.proxyTypes.get(cacheKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Constructor<?>[] determineCandidateConstructors(Class<?> beanClass, String beanName) throws BeansException {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getEarlyBeanReference(Object bean, String beanName) throws BeansException {
|
||||
Object cacheKey = getCacheKey(bean.getClass(), beanName);
|
||||
this.earlyProxyReferences.put(cacheKey, Boolean.TRUE);
|
||||
return wrapIfNecessary(bean, beanName, cacheKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object postProcessBeforeInstantiation(Class<?> beanClass, String beanName) throws BeansException {
|
||||
Object cacheKey = getCacheKey(beanClass, beanName);
|
||||
|
||||
|
|
@ -303,19 +296,16 @@ public abstract class AbstractAutoProxyCreator extends ProxyConfig
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean postProcessAfterInstantiation(Object bean, String beanName) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PropertyValues postProcessPropertyValues(
|
||||
PropertyValues pvs, PropertyDescriptor[] pds, Object bean, String beanName) {
|
||||
|
||||
return pvs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object postProcessBeforeInitialization(Object bean, String beanName) {
|
||||
return bean;
|
||||
}
|
||||
|
|
@ -325,7 +315,6 @@ public abstract class AbstractAutoProxyCreator extends ProxyConfig
|
|||
* identified as one to proxy by the subclass.
|
||||
* @see #getAdvicesAndAdvisorsForBean
|
||||
*/
|
||||
@Override
|
||||
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
|
||||
if (bean != null) {
|
||||
Object cacheKey = getCacheKey(bean.getClass(), beanName);
|
||||
|
|
|
|||
|
|
@ -79,7 +79,6 @@ public class DefaultAdvisorAutoProxyCreator extends AbstractAdvisorAutoProxyCrea
|
|||
return this.advisorBeanNamePrefix;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBeanName(String name) {
|
||||
// If no infrastructure bean name prefix has been set, override it.
|
||||
if (this.advisorBeanNamePrefix == null) {
|
||||
|
|
|
|||
|
|
@ -66,7 +66,6 @@ public abstract class AbstractBeanFactoryBasedTargetSourceCreator
|
|||
new HashMap<String, DefaultListableBeanFactory>();
|
||||
|
||||
|
||||
@Override
|
||||
public final void setBeanFactory(BeanFactory beanFactory) {
|
||||
if (!(beanFactory instanceof ConfigurableBeanFactory)) {
|
||||
throw new IllegalStateException("Cannot do auto-TargetSource creation with a BeanFactory " +
|
||||
|
|
@ -87,7 +86,6 @@ public abstract class AbstractBeanFactoryBasedTargetSourceCreator
|
|||
// Implementation of the TargetSourceCreator interface
|
||||
//---------------------------------------------------------------------
|
||||
|
||||
@Override
|
||||
public final TargetSource getTargetSource(Class<?> beanClass, String beanName) {
|
||||
AbstractBeanFactoryBasedTargetSource targetSource =
|
||||
createBeanFactoryBasedTargetSource(beanClass, beanName);
|
||||
|
|
@ -161,7 +159,6 @@ public abstract class AbstractBeanFactoryBasedTargetSourceCreator
|
|||
* Destroys the internal BeanFactory on shutdown of the TargetSourceCreator.
|
||||
* @see #getInternalBeanFactoryForBean
|
||||
*/
|
||||
@Override
|
||||
public void destroy() {
|
||||
synchronized (this.internalBeanFactories) {
|
||||
for (DefaultListableBeanFactory bf : this.internalBeanFactories.values()) {
|
||||
|
|
|
|||
|
|
@ -105,7 +105,6 @@ public abstract class AbstractTraceInterceptor implements MethodInterceptor, Ser
|
|||
* to the {@code invokeUnderTrace} method for handling.
|
||||
* @see #invokeUnderTrace(org.aopalliance.intercept.MethodInvocation, org.apache.commons.logging.Log)
|
||||
*/
|
||||
@Override
|
||||
public Object invoke(MethodInvocation invocation) throws Throwable {
|
||||
Log logger = getLoggerForInvocation(invocation);
|
||||
if (isInterceptorEnabled(invocation, logger)) {
|
||||
|
|
|
|||
|
|
@ -80,7 +80,6 @@ public abstract class AsyncExecutionAspectSupport implements BeanFactoryAware {
|
|||
/**
|
||||
* Set the {@link BeanFactory} to be used when looking up executors by qualifier.
|
||||
*/
|
||||
@Override
|
||||
public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
|
||||
this.beanFactory = beanFactory;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,11 +75,9 @@ public class AsyncExecutionInterceptor extends AsyncExecutionAspectSupport
|
|||
* @return {@link Future} if the original method returns {@code Future}; {@code null}
|
||||
* otherwise.
|
||||
*/
|
||||
@Override
|
||||
public Object invoke(final MethodInvocation invocation) throws Throwable {
|
||||
Future<?> result = this.determineAsyncExecutor(invocation.getMethod()).submit(
|
||||
new Callable<Object>() {
|
||||
@Override
|
||||
public Object call() throws Exception {
|
||||
try {
|
||||
Object result = invocation.proceed();
|
||||
|
|
@ -115,7 +113,6 @@ public class AsyncExecutionInterceptor extends AsyncExecutionAspectSupport
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return Ordered.HIGHEST_PRECEDENCE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,7 +47,6 @@ public class ConcurrencyThrottleInterceptor extends ConcurrencyThrottleSupport
|
|||
setConcurrencyLimit(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object invoke(MethodInvocation methodInvocation) throws Throwable {
|
||||
beforeAccess();
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -109,7 +109,6 @@ public abstract class ExposeBeanNameAdvisors {
|
|||
this.beanName = beanName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object invoke(MethodInvocation mi) throws Throwable {
|
||||
if (!(mi instanceof ProxyMethodInvocation)) {
|
||||
throw new IllegalStateException("MethodInvocation is not a Spring ProxyMethodInvocation: " + mi);
|
||||
|
|
@ -143,7 +142,6 @@ public abstract class ExposeBeanNameAdvisors {
|
|||
return super.invoke(mi);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBeanName() {
|
||||
return this.beanName;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -84,7 +84,6 @@ public class ExposeInvocationInterceptor implements MethodInterceptor, Ordered,
|
|||
private ExposeInvocationInterceptor() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object invoke(MethodInvocation mi) throws Throwable {
|
||||
MethodInvocation oldInvocation = invocation.get();
|
||||
invocation.set(mi);
|
||||
|
|
@ -96,7 +95,6 @@ public class ExposeInvocationInterceptor implements MethodInterceptor, Ordered,
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return Ordered.HIGHEST_PRECEDENCE + 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,12 +55,10 @@ public class DefaultScopedObject implements ScopedObject, Serializable {
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Object getTargetObject() {
|
||||
return this.beanFactory.getBean(this.targetBeanName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeFromScope() {
|
||||
this.beanFactory.destroyScopedBean(this.targetBeanName);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,7 +78,6 @@ public class ScopedProxyFactoryBean extends ProxyConfig implements FactoryBean<O
|
|||
this.scopedTargetSource.setTargetBeanName(targetBeanName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBeanFactory(BeanFactory beanFactory) {
|
||||
if (!(beanFactory instanceof ConfigurableBeanFactory)) {
|
||||
throw new IllegalStateException("Not running in a ConfigurableBeanFactory: " + beanFactory);
|
||||
|
|
@ -112,7 +111,6 @@ public class ScopedProxyFactoryBean extends ProxyConfig implements FactoryBean<O
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Object getObject() {
|
||||
if (this.proxy == null) {
|
||||
throw new FactoryBeanNotInitializedException();
|
||||
|
|
@ -120,7 +118,6 @@ public class ScopedProxyFactoryBean extends ProxyConfig implements FactoryBean<O
|
|||
return this.proxy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getObjectType() {
|
||||
if (this.proxy != null) {
|
||||
return this.proxy.getClass();
|
||||
|
|
@ -131,7 +128,6 @@ public class ScopedProxyFactoryBean extends ProxyConfig implements FactoryBean<O
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSingleton() {
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,7 +69,6 @@ public abstract class AbstractBeanFactoryPointcutAdvisor extends AbstractPointcu
|
|||
return this.adviceBeanName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBeanFactory(BeanFactory beanFactory) {
|
||||
this.beanFactory = beanFactory;
|
||||
}
|
||||
|
|
@ -80,7 +79,6 @@ public abstract class AbstractBeanFactoryPointcutAdvisor extends AbstractPointcu
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Advice getAdvice() {
|
||||
synchronized (this.adviceMonitor) {
|
||||
if (this.advice == null && this.adviceBeanName != null) {
|
||||
|
|
|
|||
|
|
@ -83,7 +83,6 @@ public abstract class AbstractExpressionPointcut implements ExpressionPointcut,
|
|||
/**
|
||||
* Return this pointcut's expression.
|
||||
*/
|
||||
@Override
|
||||
public String getExpression() {
|
||||
return this.expression;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@ public abstract class AbstractGenericPointcutAdvisor extends AbstractPointcutAdv
|
|||
this.advice = advice;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Advice getAdvice() {
|
||||
return this.advice;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,7 +44,6 @@ public abstract class AbstractPointcutAdvisor implements PointcutAdvisor, Ordere
|
|||
this.order = order;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
if (this.order != null) {
|
||||
return this.order;
|
||||
|
|
@ -56,7 +55,6 @@ public abstract class AbstractPointcutAdvisor implements PointcutAdvisor, Ordere
|
|||
return Ordered.LOWEST_PRECEDENCE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPerInstance() {
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -124,7 +124,6 @@ public abstract class AbstractRegexpMethodPointcut extends StaticMethodMatcherPo
|
|||
* of the target class as well as against the method's declaring class,
|
||||
* plus the name of the method.
|
||||
*/
|
||||
@Override
|
||||
public boolean matches(Method method, Class targetClass) {
|
||||
return ((targetClass != null && matchesPattern(targetClass.getName() + "." + method.getName())) ||
|
||||
matchesPattern(method.getDeclaringClass().getName() + "." + method.getName()));
|
||||
|
|
|
|||
|
|
@ -96,7 +96,6 @@ public abstract class ClassFilters {
|
|||
this.filters = filters;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(Class clazz) {
|
||||
for (int i = 0; i < this.filters.length; i++) {
|
||||
if (this.filters[i].matches(clazz)) {
|
||||
|
|
@ -131,7 +130,6 @@ public abstract class ClassFilters {
|
|||
this.filters = filters;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(Class clazz) {
|
||||
for (int i = 0; i < this.filters.length; i++) {
|
||||
if (!this.filters[i].matches(clazz)) {
|
||||
|
|
|
|||
|
|
@ -170,12 +170,10 @@ public class ComposablePointcut implements Pointcut, Serializable {
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ClassFilter getClassFilter() {
|
||||
return this.classFilter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MethodMatcher getMethodMatcher() {
|
||||
return this.methodMatcher;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,7 +71,6 @@ public class ControlFlowPointcut implements Pointcut, ClassFilter, MethodMatcher
|
|||
/**
|
||||
* Subclasses can override this for greater filtering (and performance).
|
||||
*/
|
||||
@Override
|
||||
public boolean matches(Class clazz) {
|
||||
return true;
|
||||
}
|
||||
|
|
@ -80,17 +79,14 @@ public class ControlFlowPointcut implements Pointcut, ClassFilter, MethodMatcher
|
|||
* Subclasses can override this if it's possible to filter out
|
||||
* some candidate classes.
|
||||
*/
|
||||
@Override
|
||||
public boolean matches(Method method, Class targetClass) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRuntime() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(Method method, Class targetClass, Object[] args) {
|
||||
++this.evaluations;
|
||||
ControlFlow cflow = ControlFlowFactory.createControlFlow();
|
||||
|
|
@ -105,12 +101,10 @@ public class ControlFlowPointcut implements Pointcut, ClassFilter, MethodMatcher
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ClassFilter getClassFilter() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MethodMatcher getMethodMatcher() {
|
||||
return this;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,7 +47,6 @@ public class DefaultBeanFactoryPointcutAdvisor extends AbstractBeanFactoryPointc
|
|||
this.pointcut = (pointcut != null ? pointcut : Pointcut.TRUE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pointcut getPointcut() {
|
||||
return this.pointcut;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -102,12 +102,10 @@ public class DefaultIntroductionAdvisor implements IntroductionAdvisor, ClassFil
|
|||
this.interfaces.add(intf);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class[] getInterfaces() {
|
||||
return this.interfaces.toArray(new Class[this.interfaces.size()]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validateInterfaces() throws IllegalArgumentException {
|
||||
for (Class ifc : this.interfaces) {
|
||||
if (this.advice instanceof DynamicIntroductionAdvice &&
|
||||
|
|
@ -123,28 +121,23 @@ public class DefaultIntroductionAdvisor implements IntroductionAdvisor, ClassFil
|
|||
this.order = order;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return this.order;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Advice getAdvice() {
|
||||
return this.advice;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPerInstance() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ClassFilter getClassFilter() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(Class clazz) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -77,7 +77,6 @@ public class DefaultPointcutAdvisor extends AbstractGenericPointcutAdvisor imple
|
|||
this.pointcut = (pointcut != null ? pointcut : Pointcut.TRUE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pointcut getPointcut() {
|
||||
return this.pointcut;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,7 +83,6 @@ public class DelegatePerTargetObjectIntroductionInterceptor extends Introduction
|
|||
* behaviour in around advice. However, subclasses should invoke this
|
||||
* method, which handles introduced interfaces and forwarding to the target.
|
||||
*/
|
||||
@Override
|
||||
public Object invoke(MethodInvocation mi) throws Throwable {
|
||||
if (isMethodOnIntroducedInterface(mi)) {
|
||||
Object delegate = getIntroductionDelegateFor(mi.getThis());
|
||||
|
|
|
|||
|
|
@ -99,7 +99,6 @@ public class DelegatingIntroductionInterceptor extends IntroductionInfoSupport
|
|||
* behaviour in around advice. However, subclasses should invoke this
|
||||
* method, which handles introduced interfaces and forwarding to the target.
|
||||
*/
|
||||
@Override
|
||||
public Object invoke(MethodInvocation mi) throws Throwable {
|
||||
if (isMethodOnIntroducedInterface(mi)) {
|
||||
// Using the following method rather than direct reflection, we
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@ import org.springframework.aop.MethodMatcher;
|
|||
*/
|
||||
public abstract class DynamicMethodMatcher implements MethodMatcher {
|
||||
|
||||
@Override
|
||||
public final boolean isRuntime() {
|
||||
return true;
|
||||
}
|
||||
|
|
@ -35,7 +34,6 @@ public abstract class DynamicMethodMatcher implements MethodMatcher {
|
|||
* Can override to add preconditions for dynamic matching. This implementation
|
||||
* always returns true.
|
||||
*/
|
||||
@Override
|
||||
public boolean matches(Method method, Class<?> targetClass) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,12 +30,10 @@ import org.springframework.aop.Pointcut;
|
|||
*/
|
||||
public abstract class DynamicMethodMatcherPointcut extends DynamicMethodMatcher implements Pointcut {
|
||||
|
||||
@Override
|
||||
public ClassFilter getClassFilter() {
|
||||
return ClassFilter.TRUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final MethodMatcher getMethodMatcher() {
|
||||
return this;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,7 +59,6 @@ public class IntroductionInfoSupport implements IntroductionInfo, Serializable {
|
|||
this.publishedInterfaces.remove(intf);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class[] getInterfaces() {
|
||||
return this.publishedInterfaces.toArray(new Class[this.publishedInterfaces.size()]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -112,13 +112,11 @@ public abstract class MethodMatchers {
|
|||
this.mm2 = mm2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(Method method, Class targetClass, boolean hasIntroductions) {
|
||||
return (matchesClass1(targetClass) && MethodMatchers.matches(this.mm1, method, targetClass, hasIntroductions)) ||
|
||||
(matchesClass2(targetClass) && MethodMatchers.matches(this.mm2, method, targetClass, hasIntroductions));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(Method method, Class targetClass) {
|
||||
return (matchesClass1(targetClass) && this.mm1.matches(method, targetClass)) ||
|
||||
(matchesClass2(targetClass) && this.mm2.matches(method, targetClass));
|
||||
|
|
@ -132,12 +130,10 @@ public abstract class MethodMatchers {
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRuntime() {
|
||||
return this.mm1.isRuntime() || this.mm2.isRuntime();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(Method method, Class targetClass, Object[] args) {
|
||||
return this.mm1.matches(method, targetClass, args) || this.mm2.matches(method, targetClass, args);
|
||||
}
|
||||
|
|
@ -220,23 +216,19 @@ public abstract class MethodMatchers {
|
|||
this.mm2 = mm2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(Method method, Class targetClass, boolean hasIntroductions) {
|
||||
return MethodMatchers.matches(this.mm1, method, targetClass, hasIntroductions) &&
|
||||
MethodMatchers.matches(this.mm2, method, targetClass, hasIntroductions);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(Method method, Class targetClass) {
|
||||
return this.mm1.matches(method, targetClass) && this.mm2.matches(method, targetClass);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRuntime() {
|
||||
return this.mm1.isRuntime() || this.mm2.isRuntime();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(Method method, Class targetClass, Object[] args) {
|
||||
// Because a dynamic intersection may be composed of a static and dynamic part,
|
||||
// we must avoid calling the 3-arg matches method on a dynamic matcher, as
|
||||
|
|
|
|||
|
|
@ -77,7 +77,6 @@ public class NameMatchMethodPointcut extends StaticMethodMatcherPointcut impleme
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean matches(Method method, Class targetClass) {
|
||||
for (String mappedName : this.mappedNames) {
|
||||
if (mappedName.equals(method.getName()) || isMatch(method.getName(), mappedName)) {
|
||||
|
|
|
|||
|
|
@ -85,7 +85,6 @@ public class NameMatchMethodPointcutAdvisor extends AbstractGenericPointcutAdvis
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Pointcut getPointcut() {
|
||||
return this.pointcut;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,7 +96,6 @@ public abstract class Pointcuts {
|
|||
|
||||
public static SetterPointcut INSTANCE = new SetterPointcut();
|
||||
|
||||
@Override
|
||||
public boolean matches(Method method, Class targetClass) {
|
||||
return method.getName().startsWith("set") &&
|
||||
method.getParameterTypes().length == 1 &&
|
||||
|
|
@ -117,7 +116,6 @@ public abstract class Pointcuts {
|
|||
|
||||
public static GetterPointcut INSTANCE = new GetterPointcut();
|
||||
|
||||
@Override
|
||||
public boolean matches(Method method, Class targetClass) {
|
||||
return method.getName().startsWith("get") &&
|
||||
method.getParameterTypes().length == 0;
|
||||
|
|
|
|||
|
|
@ -116,7 +116,6 @@ public class RegexpMethodPointcutAdvisor extends AbstractGenericPointcutAdvisor
|
|||
/**
|
||||
* Initialize the singleton Pointcut held within this Advisor.
|
||||
*/
|
||||
@Override
|
||||
public Pointcut getPointcut() {
|
||||
synchronized (this.pointcutMonitor) {
|
||||
if (this.pointcut == null) {
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@ public class RootClassFilter implements ClassFilter, Serializable {
|
|||
this.clazz = clazz;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(Class candidate) {
|
||||
return clazz.isAssignableFrom(candidate);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,12 +26,10 @@ import org.springframework.aop.MethodMatcher;
|
|||
*/
|
||||
public abstract class StaticMethodMatcher implements MethodMatcher {
|
||||
|
||||
@Override
|
||||
public final boolean isRuntime() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean matches(Method method, Class<?> targetClass, Object[] args) {
|
||||
// should never be invoked because isRuntime() returns false
|
||||
throw new UnsupportedOperationException("Illegal MethodMatcher usage");
|
||||
|
|
|
|||
|
|
@ -43,13 +43,11 @@ public abstract class StaticMethodMatcherPointcut extends StaticMethodMatcher im
|
|||
this.classFilter = classFilter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ClassFilter getClassFilter() {
|
||||
return this.classFilter;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public final MethodMatcher getMethodMatcher() {
|
||||
return this;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,7 +63,6 @@ public abstract class StaticMethodMatcherPointcutAdvisor extends StaticMethodMat
|
|||
this.order = order;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return this.order;
|
||||
}
|
||||
|
|
@ -72,17 +71,14 @@ public abstract class StaticMethodMatcherPointcutAdvisor extends StaticMethodMat
|
|||
this.advice = advice;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Advice getAdvice() {
|
||||
return this.advice;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPerInstance() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pointcut getPointcut() {
|
||||
return this;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,7 +59,6 @@ public class AnnotationClassFilter implements ClassFilter {
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean matches(Class clazz) {
|
||||
return (this.checkInherited ?
|
||||
(AnnotationUtils.findAnnotation(clazz, this.annotationType) != null) :
|
||||
|
|
|
|||
|
|
@ -90,12 +90,10 @@ public class AnnotationMatchingPointcut implements Pointcut {
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ClassFilter getClassFilter() {
|
||||
return this.classFilter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MethodMatcher getMethodMatcher() {
|
||||
return this.methodMatcher;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,7 +47,6 @@ public class AnnotationMethodMatcher extends StaticMethodMatcher {
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean matches(Method method, Class targetClass) {
|
||||
if (method.isAnnotationPresent(this.annotationType)) {
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -105,7 +105,6 @@ public abstract class AbstractBeanFactoryBasedTargetSource
|
|||
* Set the owning BeanFactory. We need to save a reference so that we can
|
||||
* use the {@code getBean} method on every invocation.
|
||||
*/
|
||||
@Override
|
||||
public void setBeanFactory(BeanFactory beanFactory) {
|
||||
if (this.targetBeanName == null) {
|
||||
throw new IllegalStateException("Property'targetBeanName' is required");
|
||||
|
|
@ -121,7 +120,6 @@ public abstract class AbstractBeanFactoryBasedTargetSource
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public synchronized Class<?> getTargetClass() {
|
||||
if (this.targetClass == null && this.beanFactory != null) {
|
||||
// Determine type of the target bean.
|
||||
|
|
@ -139,12 +137,10 @@ public abstract class AbstractBeanFactoryBasedTargetSource
|
|||
return this.targetClass;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isStatic() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void releaseTarget(Object target) throws Exception {
|
||||
// Nothing to do here.
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,12 +64,10 @@ public abstract class AbstractLazyCreationTargetSource implements TargetSource {
|
|||
* a meaningful value when the target is still {@code null}.
|
||||
* @see #isInitialized()
|
||||
*/
|
||||
@Override
|
||||
public synchronized Class<?> getTargetClass() {
|
||||
return (this.lazyTarget != null ? this.lazyTarget.getClass() : null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isStatic() {
|
||||
return false;
|
||||
}
|
||||
|
|
@ -79,7 +77,6 @@ public abstract class AbstractLazyCreationTargetSource implements TargetSource {
|
|||
* creating it on-the-fly if it doesn't exist already.
|
||||
* @see #createObject()
|
||||
*/
|
||||
@Override
|
||||
public synchronized Object getTarget() throws Exception {
|
||||
if (this.lazyTarget == null) {
|
||||
logger.debug("Initializing lazy target object");
|
||||
|
|
@ -88,7 +85,6 @@ public abstract class AbstractLazyCreationTargetSource implements TargetSource {
|
|||
return this.lazyTarget;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void releaseTarget(Object target) throws Exception {
|
||||
// nothing to do
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,7 +68,6 @@ public abstract class AbstractPoolingTargetSource extends AbstractPrototypeBased
|
|||
/**
|
||||
* Return the maximum size of the pool.
|
||||
*/
|
||||
@Override
|
||||
public int getMaxSize() {
|
||||
return this.maxSize;
|
||||
}
|
||||
|
|
@ -98,7 +97,6 @@ public abstract class AbstractPoolingTargetSource extends AbstractPrototypeBased
|
|||
* @throws Exception we may need to deal with checked exceptions from pool
|
||||
* APIs, so we're forgiving with our exception signature
|
||||
*/
|
||||
@Override
|
||||
public abstract Object getTarget() throws Exception;
|
||||
|
||||
/**
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue