Java Code Examples for org.springframework.aop.support.DefaultPointcutAdvisor#setAdvice()
The following examples show how to use
org.springframework.aop.support.DefaultPointcutAdvisor#setAdvice() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SmartDruidDataSourceConfig.java From smart-admin with MIT License | 5 votes |
@Bean public DefaultPointcutAdvisor defaultPointcutAdvisor() { DefaultPointcutAdvisor pointcutAdvisor = new DefaultPointcutAdvisor(); pointcutAdvisor.setPointcut(jdkRegexpMethodPointcut()); pointcutAdvisor.setAdvice(druidStatInterceptor); return pointcutAdvisor; }
Example 2
Source File: AspectJExpressionPointcutTests.java From spring-analysis-note with MIT License | 5 votes |
private TestBean getAdvisedProxy(String pointcutExpression, CallCountingInterceptor interceptor) { TestBean target = new TestBean(); Pointcut pointcut = getPointcut(pointcutExpression); DefaultPointcutAdvisor advisor = new DefaultPointcutAdvisor(); advisor.setAdvice(interceptor); advisor.setPointcut(pointcut); ProxyFactory pf = new ProxyFactory(); pf.setTarget(target); pf.addAdvisor(advisor); return (TestBean) pf.getProxy(); }
Example 3
Source File: AspectJExpressionPointcutTests.java From java-technology-stack with MIT License | 5 votes |
private TestBean getAdvisedProxy(String pointcutExpression, CallCountingInterceptor interceptor) { TestBean target = new TestBean(); Pointcut pointcut = getPointcut(pointcutExpression); DefaultPointcutAdvisor advisor = new DefaultPointcutAdvisor(); advisor.setAdvice(interceptor); advisor.setPointcut(pointcut); ProxyFactory pf = new ProxyFactory(); pf.setTarget(target); pf.addAdvisor(advisor); return (TestBean) pf.getProxy(); }
Example 4
Source File: MethodLockConfiguration.java From common-project with Apache License 2.0 | 5 votes |
@Bean(name = MethodLockConfigBeanNameUtils.METHOD_DISTRIBUTED_LOCK_POINTCUT_ADVISOR_BEAN_NAME) public DefaultPointcutAdvisor defaultBeanFactoryPointcutAdvisor(){ DefaultPointcutAdvisor defaultPointcutAdvisor = new DefaultPointcutAdvisor(); defaultPointcutAdvisor.setAdvice(methodLockInterceptor()); defaultPointcutAdvisor.setPointcut(pointcut()); return defaultPointcutAdvisor; }
Example 5
Source File: AspectJExpressionPointcutTests.java From spring4-understanding with Apache License 2.0 | 5 votes |
private TestBean getAdvisedProxy(String pointcutExpression, CallCountingInterceptor interceptor) { TestBean target = new TestBean(); Pointcut pointcut = getPointcut(pointcutExpression); DefaultPointcutAdvisor advisor = new DefaultPointcutAdvisor(); advisor.setAdvice(interceptor); advisor.setPointcut(pointcut); ProxyFactory pf = new ProxyFactory(); pf.setTarget(target); pf.addAdvisor(advisor); return (TestBean) pf.getProxy(); }