@Before("execution(void *.set*(int))") public void countSetter() { ++count; } }
@Before("execution(void *.*(..))") public void countAnythingVoid() { ++count; } }
@Before("this(org.springframework.aop.aspectj.ThisAndTargetSelectionOnlyPointcutsAtAspectJTests.TestInterface) " + "&& target(org.springframework.aop.aspectj.ThisAndTargetSelectionOnlyPointcutsAtAspectJTests.TestImpl)") public void incrementThisAsInterfaceAndTargetAsClassCounter() { thisAsInterfaceAndTargetAsClassCounter++; }
@Before("execution(void *.set*(int))") public void countSetter() { ++count; } }
@Before("execution(* getAge())") public void throwException() throws Exception { throw ex; } }
@Before("this(org.springframework.aop.aspectj.ThisAndTargetSelectionOnlyPointcutsAtAspectJTests.TestInterface) " + "&& target(org.springframework.aop.aspectj.ThisAndTargetSelectionOnlyPointcutsAtAspectJTests.TestInterface)") public void incrementThisAsInterfaceAndTargetAsInterfaceCounter() { thisAsInterfaceAndTargetAsInterfaceCounter++; }
@Before("execution(* setAge(int)) && args(newAge)") public void countSet(int newAge) throws Exception { ++totalCalls; } }
@Before("execution(void *.set*(int))") public void countSetter() { ++count; }
@Before("execution(void *.set*(int))") public void countSetter() { ++count; }
@Before("@target(org.springframework.aop.aspectj.ThisAndTargetSelectionOnlyPointcutsAtAspectJTests.TestAnnotation)") public void incrementAtTargetClassAnnotationCounter() { atTargetClassAnnotationCounter++; }
@Before("@args(org.springframework.context.annotation.EnableAspectJAutoProxyTests.Loggable))") public void loggingBeginByAtArgs() { } }
@Before("genericInterfaceSubtypeGenericCollectionArgExecution()") public void incrementGenericInterfaceSubtypeGenericCollectionArgExecution() { genericInterfaceSubtypeGenericCollectionArgExecutionCount++; } }
@Before("this(org.springframework.aop.aspectj.ThisAndTargetSelectionOnlyPointcutsAtAspectJTests.TestImpl) " + "&& target(org.springframework.aop.aspectj.ThisAndTargetSelectionOnlyPointcutsAtAspectJTests.TestImpl)") public void incrementThisAsClassAndTargetAsClassCounter() { thisAsClassAndTargetAsClassCounter++; }
@org.aspectj.lang.annotation.Before("execution(* scheduled())") public void checkTransaction() { this.count.incrementAndGet(); } }
@Before("serviceExecution()") public void countUse() { this.useCount++; threadLocalCount.set(this.useCount); }
@Before("methodExecution()") public void entryTrace(JoinPoint jp) { this.lastEntry = jp.toString(); } }
@Before("execution(* org.springframework.tests.sample.beans.TestBean.absquatulate(..)) && target(testBean)") public void touchBean(TestBean testBean) { testBean.setName("advisedName"); } }
@Before("execution(* org.springframework.tests.sample.beans.TestBean.absquatulate(..)) && target(testBean)") public void touchBean(TestBean testBean) { testBean.setName("advisedName"); } }
@Before("execution(void *.additionalMethod(*))") public void log(JoinPoint jp) { System.out.println("Before " + jp.getSignature().getName()); } }
@Before(value="execution(void set*(*)) && this(mixin)", argNames="mixin") public void checkNotLocked( Lockable mixin) { // Can also obtain the mixin (this) this way //Lockable mixin = (Lockable) jp.getThis(); if (mixin.locked()) { throw new IllegalStateException(); } }