Example usage for org.springframework.aop.support Pointcuts union

List of usage examples for org.springframework.aop.support Pointcuts union

Introduction

In this page you can find the example usage for org.springframework.aop.support Pointcuts union.

Prototype

public static Pointcut union(Pointcut pc1, Pointcut pc2) 

Source Link

Document

Match all methods that either (or both) of the given pointcuts matches.

Usage

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

/**
 * Monitoring of beans or methods having the {@link Async} annotation.
 * @return MonitoringSpringAdvisor// w w w.  ja v a2 s.  com
 */
@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)));
}

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

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