public class MethodSecurityMetadataSourceAdvisor
extends AbstractPointcutAdvisor
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(java.lang.String adviceBeanName,
MethodSecurityMetadataSource attributeSource,
java.lang.String attributeSourceBeanName)
Alternative constructor for situations where we want the advisor decoupled from the
advice.
|
Modifier and Type | Method and Description |
---|---|
Advice |
getAdvice() |
Pointcut |
getPointcut() |
void |
setBeanFactory(BeanFactory beanFactory) |
public MethodSecurityMetadataSourceAdvisor(java.lang.String adviceBeanName, MethodSecurityMetadataSource attributeSource, java.lang.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)