Class MethodSecurityInterceptor
- java.lang.Object
-
- org.springframework.security.access.intercept.AbstractSecurityInterceptor
-
- org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor
-
- All Implemented Interfaces:
org.aopalliance.aop.Advice,org.aopalliance.intercept.Interceptor,org.aopalliance.intercept.MethodInterceptor,org.springframework.beans.factory.Aware,org.springframework.beans.factory.InitializingBean,org.springframework.context.ApplicationEventPublisherAware,org.springframework.context.MessageSourceAware
- Direct Known Subclasses:
AspectJMethodSecurityInterceptor
public class MethodSecurityInterceptor extends AbstractSecurityInterceptor implements org.aopalliance.intercept.MethodInterceptor
Provides security interception of AOP Alliance based method invocations.The
SecurityMetadataSourcerequired by this security interceptor is of typeMethodSecurityMetadataSource. This is shared with the AspectJ based security interceptor (AspectJSecurityInterceptor), since both work with JavaMethods.Refer to
AbstractSecurityInterceptorfor details on the workflow.
-
-
Field Summary
-
Fields inherited from class org.springframework.security.access.intercept.AbstractSecurityInterceptor
logger, messages
-
-
Constructor Summary
Constructors Constructor Description MethodSecurityInterceptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Class<?>getSecureObjectClass()Indicates the type of secure objects the subclass will be presenting to the abstract parent for processing.MethodSecurityMetadataSourcegetSecurityMetadataSource()java.lang.Objectinvoke(org.aopalliance.intercept.MethodInvocation mi)This method should be used to enforce security on aMethodInvocation.SecurityMetadataSourceobtainSecurityMetadataSource()voidsetSecurityMetadataSource(MethodSecurityMetadataSource newSource)-
Methods inherited from class org.springframework.security.access.intercept.AbstractSecurityInterceptor
afterInvocation, afterPropertiesSet, beforeInvocation, finallyInvocation, getAccessDecisionManager, getAfterInvocationManager, getAuthenticationManager, getRunAsManager, isAlwaysReauthenticate, isRejectPublicInvocations, isValidateConfigAttributes, setAccessDecisionManager, setAfterInvocationManager, setAlwaysReauthenticate, setApplicationEventPublisher, setAuthenticationManager, setMessageSource, setPublishAuthorizationSuccess, setRejectPublicInvocations, setRunAsManager, setValidateConfigAttributes
-
-
-
-
Method Detail
-
getSecureObjectClass
public java.lang.Class<?> getSecureObjectClass()
Description copied from class:AbstractSecurityInterceptorIndicates the type of secure objects the subclass will be presenting to the abstract parent for processing. This is used to ensure collaborators wired to theAbstractSecurityInterceptorall support the indicated secure object class.- Specified by:
getSecureObjectClassin classAbstractSecurityInterceptor- Returns:
- the type of secure object the subclass provides services for
-
invoke
public java.lang.Object invoke(org.aopalliance.intercept.MethodInvocation mi) throws java.lang.ThrowableThis method should be used to enforce security on aMethodInvocation.- Specified by:
invokein interfaceorg.aopalliance.intercept.MethodInterceptor- Parameters:
mi- The method being invoked which requires a security decision- Returns:
- The returned value from the method invocation (possibly modified by the
AfterInvocationManager). - Throws:
java.lang.Throwable- if any error occurs
-
getSecurityMetadataSource
public MethodSecurityMetadataSource getSecurityMetadataSource()
-
obtainSecurityMetadataSource
public SecurityMetadataSource obtainSecurityMetadataSource()
- Specified by:
obtainSecurityMetadataSourcein classAbstractSecurityInterceptor
-
setSecurityMetadataSource
public void setSecurityMetadataSource(MethodSecurityMetadataSource newSource)
-
-