Example usage for org.springframework.aop.support.annotation AnnotationMatchingPointcut AnnotationMatchingPointcut

List of usage examples for org.springframework.aop.support.annotation AnnotationMatchingPointcut AnnotationMatchingPointcut

Introduction

In this page you can find the example usage for org.springframework.aop.support.annotation AnnotationMatchingPointcut AnnotationMatchingPointcut.

Prototype

public AnnotationMatchingPointcut(Class<? extends Annotation> classAnnotationType) 

Source Link

Document

Create a new AnnotationMatchingPointcut for the given annotation type.

Usage

From source file:net.bull.javamelody.JavaMelodyAutoConfiguration.java

/**
 * Monitoring of beans having the {@link Service} annotation.
 * @return MonitoringSpringAdvisor/*from w  ww .  ja v  a  2  s  .c  o  m*/
 */
@Bean
@ConditionalOnProperty(prefix = JavaMelodyConfigurationProperties.PREFIX, name = "spring-monitoring-enabled", matchIfMissing = true)
public MonitoringSpringAdvisor monitoringSpringServiceAdvisor() {
    return new MonitoringSpringAdvisor(new AnnotationMatchingPointcut(Service.class));
}

From source file:net.bull.javamelody.JavaMelodyAutoConfiguration.java

/**
 * Monitoring of beans having the {@link Controller} annotation.
 * @return MonitoringSpringAdvisor/*from w w w  .j  ava  2 s .co m*/
 */
@Bean
@ConditionalOnProperty(prefix = JavaMelodyConfigurationProperties.PREFIX, name = "spring-monitoring-enabled", matchIfMissing = true)
public MonitoringSpringAdvisor monitoringSpringControllerAdvisor() {
    return new MonitoringSpringAdvisor(new AnnotationMatchingPointcut(Controller.class));
}

From source file:net.bull.javamelody.JavaMelodyAutoConfiguration.java

/**
 * Monitoring of beans having the {@link RestController} annotation.
 * @return MonitoringSpringAdvisor//w ww . jav a2 s .co  m
 */
@Bean
@ConditionalOnProperty(prefix = JavaMelodyConfigurationProperties.PREFIX, name = "spring-monitoring-enabled", matchIfMissing = true)
public MonitoringSpringAdvisor monitoringSpringRestControllerAdvisor() {
    return new MonitoringSpringAdvisor(new AnnotationMatchingPointcut(RestController.class));
}

From source file:net.bull.javamelody.JavaMelodyAutoConfiguration.java

/**
 * Monitoring of beans or methods having the {@link Async} annotation.
 * @return MonitoringSpringAdvisor//from w w w  . j  a va2  s. c  o m
 */
@Bean
@ConditionalOnProperty(prefix = JavaMelodyConfigurationProperties.PREFIX, name = "spring-monitoring-enabled", matchIfMissing = true)
public MonitoringSpringAdvisor monitoringSpringAsyncAdvisor() {
    return new MonitoringSpringAdvisor(Pointcuts.union(new AnnotationMatchingPointcut(Async.class),
            new AnnotationMatchingPointcut(null, Async.class)));
}