public class

MethodSecurityMetadataSourceAdvisor

extends AbstractPointcutAdvisor
implements BeanFactoryAware
java.lang.Object
   ↳ org.springframework.aop.support.AbstractPointcutAdvisor
     ↳ org.springframework.security.access.intercept.aopalliance.MethodSecurityMetadataSourceAdvisor

Class Overview

Advisor driven by a MethodSecurityMetadataSource, used to exclude a MethodSecurityInterceptor from public (non-secure) methods.

Because the AOP framework caches advice calculations, this is normally faster than just letting the MethodSecurityInterceptor run and find out itself that it has no work to do.

This class also allows the use of Spring's DefaultAdvisorAutoProxyCreator, which makes configuration easier than setup a ProxyFactoryBean for each object requiring security. Note that autoproxying is not supported for BeanFactory implementations, as post-processing is automatic only for application contexts.

Based on Spring's TransactionAttributeSourceAdvisor.

Summary

Public Constructors
MethodSecurityMetadataSourceAdvisor(String adviceBeanName, MethodSecurityMetadataSource attributeSource, String attributeSourceBeanName)
Alternative constructor for situations where we want the advisor decoupled from the advice.
Public Methods
Advice getAdvice()
Pointcut getPointcut()
void setBeanFactory(BeanFactory beanFactory)
[Expand]
Inherited Methods
From class org.springframework.aop.support.AbstractPointcutAdvisor
From class java.lang.Object
From interface org.springframework.aop.Advisor
From interface org.springframework.aop.PointcutAdvisor
From interface org.springframework.beans.factory.BeanFactoryAware
From interface org.springframework.core.Ordered

Public Constructors

public MethodSecurityMetadataSourceAdvisor (String adviceBeanName, MethodSecurityMetadataSource attributeSource, String attributeSourceBeanName)

Alternative constructor for situations where we want the advisor decoupled from the advice. Instead the advice bean name should be set. This prevents eager instantiation of the interceptor (and hence the AuthenticationManager). See SEC-773, for example. The metadataSourceBeanName is used rather than a direct reference to support serialization via a bean factory lookup.

Parameters
adviceBeanName name of the MethodSecurityInterceptor bean
attributeSource the SecurityMetadataSource (should be the same as the one used on the interceptor)
attributeSourceBeanName the bean name of the attributeSource (required for serialization)

Public Methods

public Advice getAdvice ()

public Pointcut getPointcut ()

public void setBeanFactory (BeanFactory beanFactory)

Throws
BeansException