October 2018
Intermediate to advanced
590 pages
15h 5m
English
In AOP, a pointcut is a predate that matches join points. The value of the @Around annotation, "execution(* app.messages..*.*(..))", from the preceding example is a pointcut expression, which specifies when the checkSecurity() around advice should be fired. You can also use the @Pointcut annotation to declare a pointcut signature, as follows:
@Aspect@Componentpublic class SecurityChecker { @Pointcut("execution(* app.messages..*.*(..))") public void everyMessageMethod() {} @Around("everyMessageMethod()") public Object checkSecurity (ProceedingJoinPoint joinPoint) { ... }}
In the SecurityChecker aspect, we create an everyMessageMethod() public method and annotate it with the @Pointcut annotation. Since we only define a pointcut signature ...
Read now
Unlock full access