SEC-1635: Stop security interceptors from calling AfterInvocationManager if exception occurs during invocation

This commit is contained in:
Luke Taylor
2010-12-14 16:20:27 +00:00
parent 2be2660b13
commit ce421f22bf
7 changed files with 105 additions and 41 deletions

View File

@@ -51,21 +51,16 @@ public class MethodSecurityInterceptor extends AbstractSecurityInterceptor imple
*
* @param mi The method being invoked which requires a security decision
*
* @return The returned value from the method invocation
* @return The returned value from the method invocation (possibly modified by the {@code AfterInvocationManager}).
*
* @throws Throwable if any error occurs
*/
public Object invoke(MethodInvocation mi) throws Throwable {
Object result = null;
InterceptorStatusToken token = super.beforeInvocation(mi);
try {
result = mi.proceed();
} finally {
result = super.afterInvocation(token, result);
}
Object result = mi.proceed();
return result;
return super.afterInvocation(token, result);
}
public MethodSecurityMetadataSource getSecurityMetadataSource() {

View File

@@ -37,15 +37,10 @@ public final class AspectJMethodSecurityInterceptor extends MethodSecurityInterc
* @return The returned value from the method invocation
*/
public Object invoke(JoinPoint jp, AspectJCallback advisorProceed) {
Object result = null;
InterceptorStatusToken token = super.beforeInvocation(new MethodInvocationAdapter(jp));
try {
result = advisorProceed.proceedWithObject();
} finally {
result = super.afterInvocation(token, result);
}
Object result = advisorProceed.proceedWithObject();
return result;
return super.afterInvocation(token, result);
}
}