Added debug statement at commencement of interception and additional comment re ContextHolder.

This commit is contained in:
Ben Alex 2004-03-28 11:56:32 +00:00
parent cf043ad35f
commit 8d24027443
1 changed files with 6 additions and 0 deletions

View File

@ -207,6 +207,10 @@ public class SecurityInterceptor implements MethodInterceptor, InitializingBean
* <code>Authentication</code> object
*/
public Object invoke(MethodInvocation mi) throws Throwable {
if (logger.isDebugEnabled()) {
logger.debug("Intercepted request for method " + mi.getMethod());
}
ConfigAttributeDefinition attr = this.methodDefinitionSource
.getAttributes(mi);
@ -225,6 +229,8 @@ public class SecurityInterceptor implements MethodInterceptor, InitializingBean
SecureContext context = (SecureContext) ContextHolder.getContext();
// We check for just the property we're interested in (we do
// not call Context.validate() like the ContextInterceptor)
if (context.getAuthentication() == null) {
throw new AuthenticationCredentialsNotFoundException(
"Authentication credentials were not found in the SecureContext");