@ -63,10 +63,10 @@ public class MethodDefinitionSourceAdvisor extends AbstractPointcutAdvisor imple
@@ -63,10 +63,10 @@ public class MethodDefinitionSourceAdvisor extends AbstractPointcutAdvisor imple
* @deprecated use the decoupled approach instead
* /
public MethodDefinitionSourceAdvisor ( MethodSecurityInterceptor advice ) {
Assert . notNull ( advice . getObjectDefinitionSource ( ) , "Cannot construct a MethodDefinitionSourceAdvisor using a " +
"MethodSecurityInterceptor that has no ObjectDefinitionSource configured" ) ;
Assert . notNull ( advice . getObjectDefinitionSource ( ) , "Cannot construct a MethodDefinitionSourceAdvisor using a " +
"MethodSecurityInterceptor that has no ObjectDefinitionSource configured" ) ;
this . interceptor = advice ;
this . interceptor = advice ;
this . attributeSource = advice . getObjectDefinitionSource ( ) ;
}
@ -83,35 +83,34 @@ public class MethodDefinitionSourceAdvisor extends AbstractPointcutAdvisor imple
@@ -83,35 +83,34 @@ public class MethodDefinitionSourceAdvisor extends AbstractPointcutAdvisor imple
* @param attributeSource the attribute source ( should be the same as the one used on the interceptor )
* /
public MethodDefinitionSourceAdvisor ( String adviceBeanName , MethodDefinitionSource attributeSource ) {
Assert . notNull ( adviceBeanName , "The adviceBeanName cannot be null" ) ;
Assert . notNull ( attributeSource , "The attributeSource cannot be null" ) ;
Assert . notNull ( adviceBeanName , "The adviceBeanName cannot be null" ) ;
Assert . notNull ( attributeSource , "The attributeSource cannot be null" ) ;
this . adviceBeanName = adviceBeanName ;
this . attributeSource = attributeSource ;
this . adviceBeanName = adviceBeanName ;
this . attributeSource = attributeSource ;
}
//~ Methods ========================================================================================================
public Pointcut getPointcut ( ) {
return pointcut ;
}
public Advice getAdvice ( ) {
synchronized ( this . adviceMonitor ) {
if ( interceptor = = null ) {
Assert . notNull ( adviceBeanName , "'adviceBeanName' must be set for use with bean factory lookup." ) ;
Assert . state ( beanFactory ! = null , "BeanFactory must be set to resolve 'adviceBeanName'" ) ;
interceptor = ( MethodSecurityInterceptor )
beanFactory . getBean ( this . adviceBeanName , MethodSecurityInterceptor . class ) ;
// attributeSource = interceptor.getObjectDefinitionSource();
}
return interceptor ;
}
}
public void setBeanFactory ( BeanFactory beanFactory ) throws BeansException {
this . beanFactory = beanFactory ;
}
public Pointcut getPointcut ( ) {
return pointcut ;
}
public Advice getAdvice ( ) {
synchronized ( this . adviceMonitor ) {
if ( interceptor = = null ) {
Assert . notNull ( adviceBeanName , "'adviceBeanName' must be set for use with bean factory lookup." ) ;
Assert . state ( beanFactory ! = null , "BeanFactory must be set to resolve 'adviceBeanName'" ) ;
interceptor = ( MethodSecurityInterceptor )
beanFactory . getBean ( this . adviceBeanName , MethodSecurityInterceptor . class ) ;
}
return interceptor ;
}
}
public void setBeanFactory ( BeanFactory beanFactory ) throws BeansException {
this . beanFactory = beanFactory ;
}
//~ Inner Classes ==================================================================================================
@ -153,7 +152,7 @@ public class MethodDefinitionSourceAdvisor extends AbstractPointcutAdvisor imple
@@ -153,7 +152,7 @@ public class MethodDefinitionSourceAdvisor extends AbstractPointcutAdvisor imple
}
public Object getThis ( ) {
return this . targetClass ;
return this . targetClass ;
}
public Object proceed ( ) throws Throwable {