I can write like this.
@Component
@Aspect("pertypewithin(com..*)")
@Scope("prototype")
public class TimeAspect {
@Pointcut("execution(* com.dngzs.spring.service..*.*(..))")
public void time() {
}
@Before("time()")
public void before(JoinPoint joinpoint) {
System.out.println("before:" + joinpoint);
}
}
The official document is written like this:
Spring supports AspectJ’s
perthis
andpertarget
instantiation models;percflow
,percflowbelow
, andpertypewithin
are not currently supported.
Is my example wrong?
Comment From: sbrannen
I've edited your comment to improve the formatting. You might want to check out this Mastering Markdown guide for future reference.
Comment From: dngzs
HI Are there any results? Looking forward to your reply, thank you very much
Comment From: sbrannen
Based on the implementation of AspectMetadata
, it appears that Spring AOP does support pertypewithin
; however, we don't have any tests in place to prove that, and as you pointed out the documentation does not list it as supported.
So perhaps we just need to update the documentation.
@jhoeller, thoughts?
Comment From: dngzs
Is the problem ready to fix the document? When to fix , Looking forward to reply @sbrannen @jhoeller