public class MethodDefinitionSourceAdvisor
extends org.springframework.aop.support.AbstractPointcutAdvisor
implements org.springframework.beans.factory.BeanFactoryAware
MethodDefinitionSource
, used to exclude a MethodSecurityInterceptor
from
public (ie 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
org.springframework.aop.framework.autoproxy.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.
Constructor and Description |
---|
MethodDefinitionSourceAdvisor(MethodSecurityInterceptor advice)
Deprecated.
use the decoupled approach instead
|
MethodDefinitionSourceAdvisor(java.lang.String adviceBeanName,
MethodDefinitionSource attributeSource)
Alternative constructor for situations where we want the advisor decoupled from the advice.
|
Modifier and Type | Method and Description |
---|---|
org.aopalliance.aop.Advice |
getAdvice() |
org.springframework.aop.Pointcut |
getPointcut() |
void |
setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) |
public MethodDefinitionSourceAdvisor(MethodSecurityInterceptor advice)
public MethodDefinitionSourceAdvisor(java.lang.String adviceBeanName, MethodDefinitionSource attributeSource)
This is essentially the approach taken by subclasses of AbstractBeanFactoryPointcutAdvisor
, which this
class should extend in future. The original hierarchy and constructor have been retained for backwards
compatibility.
adviceBeanName
- name of the MethodSecurityInterceptor beanattributeSource
- the attribute source (should be the same as the one used on the interceptor)public org.springframework.aop.Pointcut getPointcut()
getPointcut
in interface org.springframework.aop.PointcutAdvisor
public org.aopalliance.aop.Advice getAdvice()
getAdvice
in interface org.springframework.aop.Advisor
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) throws org.springframework.beans.BeansException
setBeanFactory
in interface org.springframework.beans.factory.BeanFactoryAware
org.springframework.beans.BeansException