org.aspectj.lang.annotation.Pointcut Java Examples

The following examples show how to use org.aspectj.lang.annotation.Pointcut. 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: LoggingAspect.java    From java-microservices-examples with Apache License 2.0 5 votes vote down vote up
/**
 * Pointcut that matches all Spring beans in the application's main packages.
 */
@Pointcut("within(com.okta.developer.blog.repository..*)"+
    " || within(com.okta.developer.blog.service..*)"+
    " || within(com.okta.developer.blog.web.rest..*)")
public void applicationPackagePointcut() {
    // Method is empty as this is just a Pointcut, the implementations are in the advices.
}
 
Example #2
Source File: LoggingAspect.java    From cubeai with Apache License 2.0 5 votes vote down vote up
/**
 * Pointcut that matches all repositories, services and Web REST endpoints.
 */
@Pointcut("within(@org.springframework.stereotype.Repository *)" +
    " || within(@org.springframework.stereotype.Service *)" +
    " || within(@org.springframework.web.bind.annotation.RestController *)")
public void springBeanPointcut() {
    // Method is empty as this is just a Pointcut, the implementations are in the advices.
}
 
Example #3
Source File: DataSourceAop.java    From spring-boot-demo with MIT License 5 votes vote down vote up
@Pointcut("@annotation(com.easy.mybatis.multidatasource.annotation.Master) " +
        "|| execution(* com.easy.mybatis.multidatasource.service..*.insert*(..)) " +
        "|| execution(* com.easy.mybatis.multidatasource.service..*.add*(..)) " +
        "|| execution(* com.easy.mybatis.multidatasource.service..*.update*(..)) " +
        "|| execution(* com.easy.mybatis.multidatasource.service..*.edit*(..)) " +
        "|| execution(* com.easy.mybatis.multidatasource.service..*.delete*(..)) " +
        "|| execution(* com.easy.mybatis.multidatasource.service..*.remove*(..))")
public void writePointcut() {

}
 
Example #4
Source File: ReflectiveAspectJAdvisorFactory.java    From spring-analysis-note with MIT License 5 votes vote down vote up
private List<Method> getAdvisorMethods(Class<?> aspectClass) {
	final List<Method> methods = new ArrayList<>();
	ReflectionUtils.doWithMethods(aspectClass, method -> {
		// Exclude pointcuts
		if (AnnotationUtils.getAnnotation(method, Pointcut.class) == null) {
			methods.add(method);
		}
	}, ReflectionUtils.USER_DECLARED_METHODS);
	methods.sort(METHOD_COMPARATOR);
	return methods;
}
 
Example #5
Source File: LoggingAspect.java    From cubeai with Apache License 2.0 5 votes vote down vote up
/**
 * Pointcut that matches all Spring beans in the application's main packages.
 */
@Pointcut("within(com.wyy.repository..*)"+
    " || within(com.wyy.service..*)"+
    " || within(com.wyy.web.rest..*)")
public void applicationPackagePointcut() {
    // Method is empty as this is just a Pointcut, the implementations are in the advices.
}
 
Example #6
Source File: LoggingAspect.java    From java-microservices-examples with Apache License 2.0 5 votes vote down vote up
/**
 * Pointcut that matches all Spring beans in the application's main packages.
 */
@Pointcut("within(com.okta.developer.store.repository..*)"+
    " || within(com.okta.developer.store.service..*)"+
    " || within(com.okta.developer.store.web.rest..*)")
public void applicationPackagePointcut() {
    // Method is empty as this is just a Pointcut, the implementations are in the advices.
}
 
Example #7
Source File: ReflectiveAspectJAdvisorFactory.java    From java-technology-stack with MIT License 5 votes vote down vote up
private List<Method> getAdvisorMethods(Class<?> aspectClass) {
	final List<Method> methods = new ArrayList<>();
	ReflectionUtils.doWithMethods(aspectClass, method -> {
		// Exclude pointcuts
		if (AnnotationUtils.getAnnotation(method, Pointcut.class) == null) {
			methods.add(method);
		}
	});
	methods.sort(METHOD_COMPARATOR);
	return methods;
}
 
Example #8
Source File: LoggingAspect.java    From cubeai with Apache License 2.0 5 votes vote down vote up
/**
 * Pointcut that matches all repositories, services and Web REST endpoints.
 */
@Pointcut("within(@org.springframework.stereotype.Repository *)" +
    " || within(@org.springframework.stereotype.Service *)" +
    " || within(@org.springframework.web.bind.annotation.RestController *)")
public void springBeanPointcut() {
    // Method is empty as this is just a Pointcut, the implementations are in the advices.
}
 
Example #9
Source File: LoggingAspect.java    From java-microservices-examples with Apache License 2.0 5 votes vote down vote up
/**
 * Pointcut that matches all repositories, services and Web REST endpoints.
 */
@Pointcut("within(@org.springframework.stereotype.Repository *)" +
    " || within(@org.springframework.stereotype.Service *)" +
    " || within(@org.springframework.web.bind.annotation.RestController *)")
public void springBeanPointcut() {
    // Method is empty as this is just a Pointcut, the implementations are in the advices.
}
 
Example #10
Source File: BindingResultAspect.java    From HIS with Apache License 2.0 4 votes vote down vote up
@Pointcut("execution(public * com.neu.his.cloud.zuul.controller.*.*(..))")
public void BindingResult() {
}
 
Example #11
Source File: UseTimeAspect.java    From WeBASE-Collect-Bee with Apache License 2.0 4 votes vote down vote up
@Pointcut("@annotation(com.webank.webasebee.common.aspect.UseTime)")
public void logPointCut() {
}
 
Example #12
Source File: ApiLogAspect.java    From sophia_scaffolding with Apache License 2.0 4 votes vote down vote up
/***
 * 定义controller切入点拦截规则,拦截SysLog注解的方法
 * //@Pointcut("execution(public * com.scaffolding.sophia.*.*.controller.*.*(..) )")
 */
@Pointcut("@annotation(com.scaffolding.sophia.common.log.annotation.SysLog)")
public void log() {

}
 
Example #13
Source File: DataSourceAspect.java    From RuoYi-Vue with MIT License 4 votes vote down vote up
@Pointcut("@annotation(com.ruoyi.framework.aspectj.lang.annotation.DataSource)"
        + "|| @within(com.ruoyi.framework.aspectj.lang.annotation.DataSource)")
public void dsPointCut()
{

}
 
Example #14
Source File: RocketAspect.java    From rocketmq-spring-boot-starter with Apache License 2.0 4 votes vote down vote up
@Pointcut("@annotation(com.github.thierrysquirrel.annotation.TransactionMessage)")
public void transactionMessagePointcut() {
	log.debug("Start sending TransactionMessage");
}
 
Example #15
Source File: LogAspect.java    From java-master with Apache License 2.0 4 votes vote down vote up
@Pointcut("execution(public * org.javamaster.b2c.core.controller.*.*(..))")
public void logPointCut() {
}
 
Example #16
Source File: LimitAspect.java    From yshopmall with Apache License 2.0 4 votes vote down vote up
@Pointcut("@annotation(co.yixiang.annotation.Limit)")
public void pointcut() {
}
 
Example #17
Source File: DictAspect.java    From teaching with Apache License 2.0 4 votes vote down vote up
@Pointcut("execution(public * org.jeecg.modules..*.*Controller.*(..))")
public void excudeService() {
}
 
Example #18
Source File: EasySentinelResourceAspect.java    From easy-sentinel with Apache License 2.0 4 votes vote down vote up
@Pointcut("@annotation(com.github.lxchinesszz.easysentinel.annotation.EasySentinel)")
public void easySentinelResourceAnnotationPointcut() {
}
 
Example #19
Source File: DataSourceAop.java    From spring-boot-demo with MIT License 4 votes vote down vote up
@Pointcut("!@annotation(com.easy.mybatis.multidatasource.annotation.Master) " +
        "&& (execution(* com.easy.mybatis.multidatasource.service..*.select*(..)) " +
        "|| execution(* com.easy.mybatis.multidatasource.service..*.get*(..)))")
public void readPointcut() {

}
 
Example #20
Source File: RateLimiterEffectiveAspect.java    From spring-cloud-formula with Apache License 2.0 4 votes vote down vote up
@Pointcut(value = "@within(org.springframework.web.bind.annotation.RestController) "
        + " || @within(org.springframework.stereotype.Controller)")
public void controllerPointCut() {

}
 
Example #21
Source File: SessionHolderInterceptor.java    From MeetingFilm with Apache License 2.0 4 votes vote down vote up
@Pointcut("execution(* com.stylefeng.guns.*..controller.*.*(..))")
public void cutService() {
}
 
Example #22
Source File: FusionAspect.java    From Milkomeda with MIT License 4 votes vote down vote up
@Pointcut("@annotation(com.github.yizzuide.milkomeda.fusion.Fusion) && execution(public * *(..))")
public void actionPointCut() {}
 
Example #23
Source File: LogAop.java    From WebStack-Guns with MIT License 4 votes vote down vote up
@Pointcut(value = "@annotation(com.jsnjfz.manage.core.common.annotion.BussinessLog)")
public void cutService() {
}
 
Example #24
Source File: LockAspect.java    From DataSphereStudio with Apache License 2.0 4 votes vote down vote up
@Pointcut(value = "@annotation(com.webank.wedatasphere.dss.server.lock.Lock)")
private void cut() {
}
 
Example #25
Source File: DataSourceAspect.java    From Milkomeda with MIT License 4 votes vote down vote up
@Pointcut("@annotation(com.github.yizzuide.milkomeda.sundial.Sundial) && execution(public * *(..))")
public void actionPointCut() {
}
 
Example #26
Source File: DataSourceAspect.java    From Milkomeda with MIT License 4 votes vote down vote up
@Pointcut("@within(com.github.yizzuide.milkomeda.sundial.Sundial) && execution(public * *(..))")
public void classPointCut() {
}
 
Example #27
Source File: GeeTestAspect.java    From ZTuoExchange_framework with MIT License 4 votes vote down vote up
@Pointcut("execution(public * cn.ztuo.bitrade.controller.RegisterController.registerByEmail(..))"+
        "||execution(public * cn.ztuo.bitrade.controller.SmsController.resetPasswordCode(..))"+
        "||execution(public * cn.ztuo.bitrade.controller.RegisterController.sendResetPasswordCode(..))")
public void geeTest() {
}
 
Example #28
Source File: ArgumentBindingTests.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Pointcut("execution(* *(..)) && args(s,..)")
public void pointcutWithArgs(String s) {}
 
Example #29
Source File: AspectJAutoProxyCreatorTests.java    From spring-analysis-note with MIT License 4 votes vote down vote up
@Pointcut("execution(public * UnreliableBean.*(..))")
public void execOfPublicMethod() {
}
 
Example #30
Source File: AspectJAutoProxyCreatorTests.java    From spring-analysis-note with MIT License 4 votes vote down vote up
@Pointcut("execution(* *(..))")
public void methodExecution() {
}