Spring Security Framework

org.springframework.security.intercept.method.aopalliance
Class MethodSecurityInterceptor

java.lang.Object
  extended by org.springframework.security.intercept.AbstractSecurityInterceptor
      extended by org.springframework.security.intercept.method.aopalliance.MethodSecurityInterceptor
All Implemented Interfaces:
org.aopalliance.aop.Advice, org.aopalliance.intercept.Interceptor, org.aopalliance.intercept.MethodInterceptor, InitializingBean, ApplicationEventPublisherAware, MessageSourceAware

public class MethodSecurityInterceptor
extends AbstractSecurityInterceptor
implements org.aopalliance.intercept.MethodInterceptor

Provides security interception of AOP Alliance based method invocations.

The ObjectDefinitionSource required by this security interceptor is of type MethodDefinitionSource. This is shared with the AspectJ based security interceptor (AspectJSecurityInterceptor), since both work with Java Methods.

Refer to AbstractSecurityInterceptor for details on the workflow.

Version:
$Id$
Author:
Ben Alex

Field Summary
 
Fields inherited from class org.springframework.security.intercept.AbstractSecurityInterceptor
logger, messages
 
Constructor Summary
MethodSecurityInterceptor()
           
 
Method Summary
 MethodDefinitionSource getObjectDefinitionSource()
           
 Class getSecureObjectClass()
          Indicates the type of secure objects the subclass will be presenting to the abstract parent for processing.
 Object invoke(org.aopalliance.intercept.MethodInvocation mi)
          This method should be used to enforce security on a MethodInvocation.
 ObjectDefinitionSource obtainObjectDefinitionSource()
           
 void setObjectDefinitionSource(MethodDefinitionSource newSource)
           
 
Methods inherited from class org.springframework.security.intercept.AbstractSecurityInterceptor
afterInvocation, afterPropertiesSet, beforeInvocation, getAccessDecisionManager, getAfterInvocationManager, getAuthenticationManager, getRunAsManager, isAlwaysReauthenticate, isRejectPublicInvocations, isValidateConfigAttributes, setAccessDecisionManager, setAfterInvocationManager, setAlwaysReauthenticate, setApplicationEventPublisher, setAuthenticationManager, setMessageSource, setRejectPublicInvocations, setRunAsManager, setValidateConfigAttributes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MethodSecurityInterceptor

public MethodSecurityInterceptor()
Method Detail

getObjectDefinitionSource

public MethodDefinitionSource getObjectDefinitionSource()

getSecureObjectClass

public Class getSecureObjectClass()
Description copied from class: AbstractSecurityInterceptor
Indicates the type of secure objects the subclass will be presenting to the abstract parent for processing. This is used to ensure collaborators wired to the AbstractSecurityInterceptor all support the indicated secure object class.

Specified by:
getSecureObjectClass in class AbstractSecurityInterceptor
Returns:
the type of secure object the subclass provides services for

invoke

public Object invoke(org.aopalliance.intercept.MethodInvocation mi)
              throws Throwable
This method should be used to enforce security on a MethodInvocation.

Specified by:
invoke in interface org.aopalliance.intercept.MethodInterceptor
Parameters:
mi - The method being invoked which requires a security decision
Returns:
The returned value from the method invocation
Throws:
Throwable - if any error occurs

obtainObjectDefinitionSource

public ObjectDefinitionSource obtainObjectDefinitionSource()
Specified by:
obtainObjectDefinitionSource in class AbstractSecurityInterceptor

setObjectDefinitionSource

public void setObjectDefinitionSource(MethodDefinitionSource newSource)

Spring Security Framework

Copyright © 2004-2010 SpringSource, Inc. All Rights Reserved.