public class MethodSecurityMetadataSourceAdvisor extends AbstractPointcutAdvisor implements 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.
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
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() |
Pointcut |
getPointcut() |
void |
setBeanFactory(BeanFactory beanFactory) |
equals, getOrder, hashCode, isPerInstance, setOrder
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 Pointcut getPointcut()
getPointcut
in interface PointcutAdvisor
public org.aopalliance.aop.Advice getAdvice()
public void setBeanFactory(BeanFactory beanFactory) throws BeansException
setBeanFactory
in interface BeanFactoryAware
BeansException