public class MethodSecurityMetadataSourceAdvisor
extends org.springframework.aop.support.AbstractPointcutAdvisor
implements org.springframework.beans.factory.BeanFactoryAware
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.
Constructor and Description |
---|
MethodSecurityMetadataSourceAdvisor(String adviceBeanName,
MethodSecurityMetadataSource attributeSource,
String attributeSourceBeanName)
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 MethodSecurityMetadataSourceAdvisor(String adviceBeanName, MethodSecurityMetadataSource attributeSource, String attributeSourceBeanName)
adviceBeanName
- name of the MethodSecurityInterceptor beanattributeSource
- the SecurityMetadataSource (should be the same as the one used on the interceptor)attributeSourceBeanName
- the bean name of the attributeSource (required for serialization)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
Copyright © 2015. All rights reserved.