Java Code Examples for org.springframework.aop.aspectj.AspectJExpressionPointcutAdvisor#setAdvice()

The following examples show how to use org.springframework.aop.aspectj.AspectJExpressionPointcutAdvisor#setAdvice() . These examples are extracted from open source projects. 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 Project: AnyMock   File: DigestLoggerConfig.java    License: Apache License 2.0 5 votes vote down vote up
@Bean
public Advisor digestLogger() {
    AspectJExpressionPointcutAdvisor advisor = new AspectJExpressionPointcutAdvisor();
    advisor.setExpression("within(com.dxm.anymock.common.dal.dao..*)");
    advisor.setAdvice(new DigestLogger());
    return advisor;
}
 
Example 2
@Bean
public AspectJExpressionPointcutAdvisor counterAspectJExpressionPointcutAdvisor(CounterMetricsProperties conf,
		CounterMetricsAdvice advice) {
	Assert.notNull(conf.getExpression(), "Expression of the counter AOP pointcut is null.");
	if (log.isInfoEnabled()) {
		log.info("Initial counterAspectJExpressionPointcutAdvisor. {}", conf);
	}

	AspectJExpressionPointcutAdvisor advisor = new AspectJExpressionPointcutAdvisor();
	advisor.setExpression(conf.getExpression());
	advisor.setAdvice(advice);
	return advisor;
}
 
Example 3
@Bean
public AspectJExpressionPointcutAdvisor timerAspectJExpressionPointcutAdvisor(TimerMetricsProperties conf,
		TimerMetricsAdvice advice) {
	Assert.notNull(conf.getExpression(), "Expression of the timeouts AOP pointcut is null.");
	if (log.isInfoEnabled()) {
		log.info("Initial timerAspectJExpressionPointcutAdvisor. {}", conf);
	}

	AspectJExpressionPointcutAdvisor advisor = new AspectJExpressionPointcutAdvisor();
	advisor.setExpression(conf.getExpression());
	advisor.setAdvice(advice);
	return advisor;
}
 
Example 4
@Bean
@ConditionalOnBean(XssResolveAdviceInterceptor.class)
public AspectJExpressionPointcutAdvisor xssSecurityResolverAspectJExpressionPointcutAdvisor(XssProperties config,
		XssResolveAdviceInterceptor advice) {
	AspectJExpressionPointcutAdvisor advisor = new AspectJExpressionPointcutAdvisor();
	advisor.setExpression(config.getExpression());
	advisor.setAdvice(advice);
	return advisor;
}
 
Example 5
Source Project: justtestlah   File: AopConfig.java    License: Apache License 2.0 5 votes vote down vote up
@Bean
public AspectJExpressionPointcutAdvisor stepsLoggingAdvisor() {
  AspectJExpressionPointcutAdvisor advisor = new AspectJExpressionPointcutAdvisor();
  advisor.setExpression(POINTCUT_TEMPLATE.replaceFirst("__package__", stepsPackage));
  advisor.setAdvice(entryExitLoggingAspect());
  return advisor;
}
 
Example 6
Source Project: justtestlah   File: AopConfig.java    License: Apache License 2.0 5 votes vote down vote up
@Bean
public AspectJExpressionPointcutAdvisor pagesLoggingAdvisor() {
  AspectJExpressionPointcutAdvisor advisor = new AspectJExpressionPointcutAdvisor();
  advisor.setExpression(POINTCUT_TEMPLATE.replaceFirst("__package__", pagesPackage));
  advisor.setAdvice(entryExitLoggingAspect());
  return advisor;
}