use of org.springframework.security.access.intercept.InterceptorStatusToken in project spring-security by spring-projects.
the class ChannelSecurityInterceptor method clearToken.
private InterceptorStatusToken clearToken() {
InterceptorStatusToken token = tokenHolder.get();
tokenHolder.remove();
return token;
}
use of org.springframework.security.access.intercept.InterceptorStatusToken in project spring-security by spring-projects.
the class MethodSecurityInterceptor method invoke.
/**
* This method should be used to enforce security on a <code>MethodInvocation</code>.
*
* @param mi The method being invoked which requires a security decision
*
* @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 {
InterceptorStatusToken token = super.beforeInvocation(mi);
Object result;
try {
result = mi.proceed();
} finally {
super.finallyInvocation(token);
}
return super.afterInvocation(token, result);
}
use of org.springframework.security.access.intercept.InterceptorStatusToken in project spring-security by spring-projects.
the class AspectJMethodSecurityInterceptor method invoke.
/**
* Method that is suitable for user with traditional AspectJ-code aspects.
*
* @param jp The AspectJ joint point being invoked which requires a security decision
* @param advisorProceed the advice-defined anonymous class that implements
* {@code AspectJCallback} containing a simple {@code return proceed();} statement
*
* @return The returned value from the method invocation
*/
public Object invoke(JoinPoint jp, AspectJCallback advisorProceed) {
InterceptorStatusToken token = super.beforeInvocation(new MethodInvocationAdapter(jp));
Object result;
try {
result = advisorProceed.proceedWithObject();
} finally {
super.finallyInvocation(token);
}
return super.afterInvocation(token, result);
}
use of org.springframework.security.access.intercept.InterceptorStatusToken in project spring-security by spring-projects.
the class ChannelSecurityInterceptor method postSend.
public void postSend(Message<?> message, MessageChannel channel, boolean sent) {
InterceptorStatusToken token = clearToken();
afterInvocation(token, null);
}
use of org.springframework.security.access.intercept.InterceptorStatusToken in project spring-security by spring-projects.
the class ChannelSecurityInterceptor method afterSendCompletion.
public void afterSendCompletion(Message<?> message, MessageChannel channel, boolean sent, Exception ex) {
InterceptorStatusToken token = clearToken();
finallyInvocation(token);
}
Aggregations