summaryrefslogtreecommitdiff
path: root/spring-framework/24-aop-aspectj-annotations2/src/main/java/com/example/spring/aop/security/MyPointcuts.java
blob: 51f71044227743494c6708e8e3985bea96d25a55 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package com.example.spring.aop.security;

import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;

@Aspect
public class MyPointcuts {

	/*
	 * Following are the pointcut declarations. Note that these can be defined in separate classes as well.
	 */
	@Pointcut("execution(public * com.example.spring.aop.Account.withdraw(..)) && args(amount)") // pointcut expression - a selector
	public void checkWithAmount(double amount) {} //  pointcut signature - the name for the pointcut
	
	@Pointcut("execution(public * com.example.spring.aop.Account.deposit(..))") // pointcut expression - a selector
	public void abc() {} //  pointcut signature - the name for the pointcut
	
	@Pointcut("execution(public * com.example.spring.aop.Account.withdraw(..)) || execution(public * com.example.spring.aop.Account.deposit(..))")
	public void depositAndWithdraw() {}
}