当前位置: 首页>>代码示例>>Java>>正文


Java AnnotationMatchingPointcut类代码示例

本文整理汇总了Java中org.springframework.aop.support.annotation.AnnotationMatchingPointcut的典型用法代码示例。如果您正苦于以下问题:Java AnnotationMatchingPointcut类的具体用法?Java AnnotationMatchingPointcut怎么用?Java AnnotationMatchingPointcut使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


AnnotationMatchingPointcut类属于org.springframework.aop.support.annotation包,在下文中一共展示了AnnotationMatchingPointcut类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: buildPointcut

import org.springframework.aop.support.annotation.AnnotationMatchingPointcut; //导入依赖的package包/类
/**
 * Calculate a pointcut for the given async annotation types, if any.
 * @param asyncAnnotationTypes the async annotation types to introspect
 * @return the applicable Pointcut object, or {@code null} if none
 */
protected Pointcut buildPointcut(Set<Class<? extends Annotation>> asyncAnnotationTypes) {
	ComposablePointcut result = null;
	for (Class<? extends Annotation> asyncAnnotationType : asyncAnnotationTypes) {
		Pointcut cpc = new AnnotationMatchingPointcut(asyncAnnotationType, true);
		Pointcut mpc = AnnotationMatchingPointcut.forMethodAnnotation(asyncAnnotationType);
		if (result == null) {
			result = new ComposablePointcut(cpc).union(mpc);
		}
		else {
			result.union(cpc).union(mpc);
		}
	}
	return result;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:20,代码来源:AsyncAnnotationAdvisor.java

示例2: afterPropertiesSet

import org.springframework.aop.support.annotation.AnnotationMatchingPointcut; //导入依赖的package包/类
@Override
public void afterPropertiesSet() {
	Pointcut pointcut = new AnnotationMatchingPointcut(this.validatedAnnotationType, true);
	Advice advice = (this.validator != null ? new MethodValidationInterceptor(this.validator) :
			new MethodValidationInterceptor());
	this.advisor = new DefaultPointcutAdvisor(pointcut, advice);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:8,代码来源:MethodValidationPostProcessor.java

示例3: PersistenceExceptionTranslationAdvisor

import org.springframework.aop.support.annotation.AnnotationMatchingPointcut; //导入依赖的package包/类
/**
 * Create a new PersistenceExceptionTranslationAdvisor.
 * @param persistenceExceptionTranslator the PersistenceExceptionTranslator to use
 * @param repositoryAnnotationType the annotation type to check for
 */
public PersistenceExceptionTranslationAdvisor(
		PersistenceExceptionTranslator persistenceExceptionTranslator,
		Class<? extends Annotation> repositoryAnnotationType) {

	this.advice = new PersistenceExceptionTranslationInterceptor(persistenceExceptionTranslator);
	this.pointcut = new AnnotationMatchingPointcut(repositoryAnnotationType, true);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:13,代码来源:PersistenceExceptionTranslationAdvisor.java

示例4: init

import org.springframework.aop.support.annotation.AnnotationMatchingPointcut; //导入依赖的package包/类
@PostConstruct
public void init() {
    logger.info("init LogAutoConfiguration start");
    this.pointcut = new AnnotationMatchingPointcut(null, Log.class);
    this.advice = new LogMethodInterceptor(logProperties.getExcludeArr());
    logger.info("init LogAutoConfiguration end");
}
 
开发者ID:fangjian0423,项目名称:springboot-analysis,代码行数:8,代码来源:LogAutoConfiguration.java

示例5: springServiceMonitoringAdvisor

import org.springframework.aop.support.annotation.AnnotationMatchingPointcut; //导入依赖的package包/类
@ConditionalOnProperty(name = "javamelody.enableSpringServiceMonitoring", havingValue = "true")
@Bean
public MonitoringSpringAdvisor springServiceMonitoringAdvisor() {
    final MonitoringSpringAdvisor interceptor = new MonitoringSpringAdvisor();
    interceptor.setPointcut(new AnnotationMatchingPointcut(Service.class));
    return interceptor;
}
 
开发者ID:Catalysts,项目名称:cat-boot,代码行数:8,代码来源:JavaMelodyAutoConfiguration.java

示例6: springControllerMonitoringAdvisor

import org.springframework.aop.support.annotation.AnnotationMatchingPointcut; //导入依赖的package包/类
@ConditionalOnProperty(name = "javamelody.enableSpringControllerMonitoring", havingValue = "true")
@Bean
public MonitoringSpringAdvisor springControllerMonitoringAdvisor() {
    final MonitoringSpringAdvisor interceptor = new MonitoringSpringAdvisor();
    interceptor.setPointcut(new AnnotationMatchingPointcut(Controller.class));
    return interceptor;
}
 
开发者ID:Catalysts,项目名称:cat-boot,代码行数:8,代码来源:JavaMelodyAutoConfiguration.java

示例7: monitoringSpringAsyncAdvisor

import org.springframework.aop.support.annotation.AnnotationMatchingPointcut; //导入依赖的package包/类
/**
 * Monitoring of beans or methods having the {@link Async} annotation.
 * @return MonitoringSpringAdvisor
 */
@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)));
}
 
开发者ID:javamelody,项目名称:javamelody,代码行数:12,代码来源:JavaMelodyAutoConfiguration.java

示例8: monitoringSpringScheduledAdvisor

import org.springframework.aop.support.annotation.AnnotationMatchingPointcut; //导入依赖的package包/类
/**
 * Monitoring of beans methods having the {@link Scheduled} or {@link Schedules} annotations,
 * only if <code>scheduled-monitoring-enabled: true</code> is added in application.yml.
 * @return MonitoringSpringAdvisor
 */
@Bean
@ConditionalOnProperty(prefix = JavaMelodyConfigurationProperties.PREFIX, name = "scheduled-monitoring-enabled", matchIfMissing = false)
public MonitoringSpringAdvisor monitoringSpringScheduledAdvisor() {
	// only if scheduled-monitoring-enabled because of #643,
	// but https://jira.spring.io/browse/SPR-15562 may change that
	return new MonitoringSpringAdvisor(
			Pointcuts.union(new AnnotationMatchingPointcut(null, Scheduled.class),
					new AnnotationMatchingPointcut(null, Schedules.class)));
}
 
开发者ID:javamelody,项目名称:javamelody,代码行数:15,代码来源:JavaMelodyAutoConfiguration.java

示例9: afterPropertiesSet

import org.springframework.aop.support.annotation.AnnotationMatchingPointcut; //导入依赖的package包/类
@Override
public void afterPropertiesSet() {
    // see MethodValidationPostProcessor
    Pointcut pointcut = new AnnotationMatchingPointcut(null, UnitOfWork.class);
    this.advisor = new DefaultPointcutAdvisor(pointcut, interceptor);
}
 
开发者ID:jihor,项目名称:hiatus-spring-boot,代码行数:7,代码来源:HiatusBeanPostProcessor.java

示例10: afterPropertiesSet

import org.springframework.aop.support.annotation.AnnotationMatchingPointcut; //导入依赖的package包/类
@Override
public void afterPropertiesSet() {
	Pointcut pointcut = new AnnotationMatchingPointcut(this.validatedAnnotationType, true);
	this.advisor = new DefaultPointcutAdvisor(pointcut, createMethodValidationAdvice(this.validator));
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:6,代码来源:MethodValidationPostProcessor.java

示例11: springServiceMonitoringAdvisor

import org.springframework.aop.support.annotation.AnnotationMatchingPointcut; //导入依赖的package包/类
@Bean
public MonitoringSpringAdvisor springServiceMonitoringAdvisor() {
    final MonitoringSpringAdvisor interceptor = new MonitoringSpringAdvisor();
    interceptor.setPointcut(new AnnotationMatchingPointcut(Service.class));
    return interceptor;
}
 
开发者ID:richashworth,项目名称:planningpoker,代码行数:7,代码来源:JavaMelodyConfig.java

示例12: springControllerMonitoringAdvisor

import org.springframework.aop.support.annotation.AnnotationMatchingPointcut; //导入依赖的package包/类
@Bean
public MonitoringSpringAdvisor springControllerMonitoringAdvisor() {
    final MonitoringSpringAdvisor interceptor = new MonitoringSpringAdvisor();
    interceptor.setPointcut(new AnnotationMatchingPointcut(Controller.class));
    return interceptor;
}
 
开发者ID:richashworth,项目名称:planningpoker,代码行数:7,代码来源:JavaMelodyConfig.java

示例13: springRestControllerMonitoringAdvisor

import org.springframework.aop.support.annotation.AnnotationMatchingPointcut; //导入依赖的package包/类
@Bean
public MonitoringSpringAdvisor springRestControllerMonitoringAdvisor() {
    final MonitoringSpringAdvisor interceptor = new MonitoringSpringAdvisor();
    interceptor.setPointcut(new AnnotationMatchingPointcut(RestController.class));
    return interceptor;
}
 
开发者ID:richashworth,项目名称:planningpoker,代码行数:7,代码来源:JavaMelodyConfig.java

示例14: intercept

import org.springframework.aop.support.annotation.AnnotationMatchingPointcut; //导入依赖的package包/类
public static <T> T intercept(Object target, Class<? extends Annotation> annoClass, MethodInterceptor methodInterceptor){
	return intercept(target, ()->AnnotationMatchingPointcut.forMethodAnnotation(annoClass), methodInterceptor);
}
 
开发者ID:wayshall,项目名称:onetwo,代码行数:4,代码来源:Proxys.java

示例15: monitoringSpringServiceAdvisor

import org.springframework.aop.support.annotation.AnnotationMatchingPointcut; //导入依赖的package包/类
/**
 * Monitoring of beans having the {@link Service} annotation.
 * @return MonitoringSpringAdvisor
 */
@Bean
@ConditionalOnProperty(prefix = JavaMelodyConfigurationProperties.PREFIX, name = "spring-monitoring-enabled", matchIfMissing = true)
public MonitoringSpringAdvisor monitoringSpringServiceAdvisor() {
	return new MonitoringSpringAdvisor(new AnnotationMatchingPointcut(Service.class));
}
 
开发者ID:javamelody,项目名称:javamelody,代码行数:10,代码来源:JavaMelodyAutoConfiguration.java


注:本文中的org.springframework.aop.support.annotation.AnnotationMatchingPointcut类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。