This Aspect would like to see how an Animal does its
tricks. This Aspect has to be versatile: it can spy on a Dolphin,
and if configured, spy on a Panda or other animals.
It extends from AbstractPerfSpyAspect and
implements the two abstract PointCut:
@Aspectpublic class PerfSpyDemoAsepct extends AbstractPerfSpyAspect {@Pointcut("execution(* com.yourcompany.zoo..*.*(..) )")public void withinCflowOps() {}@Pointcut("cflow(execution(* com.yourcompany.zoo.animal.Animal.playTricks(..) ) )")public void cflowOps() {}}
cflowOps(): @Pointcut("cflow(execution(*
com.yourcompany.zoo.animal.Animal.playTricks(..) ) )")
Capture what happens
inside the execution of Animal.playTricks. Notice, here the superclass Animal is being
spied on.
withinCflowOps():@Pointcut("execution(* com.yourcompany.zoo..*.*(..)
)")
No comments:
Post a Comment