1 16 17 package org.springframework.aop.framework; 18 19 import org.aopalliance.intercept.MethodInvocation; 20 import org.springframework.aop.interceptor.ExposeInvocationInterceptor; 21 import org.springframework.beans.TestBean; 22 23 24 28 public abstract class ExposedInvocationTestBean extends TestBean { 29 30 public String getName() { 31 MethodInvocation invocation = ExposeInvocationInterceptor.currentInvocation(); 32 assertions(invocation); 33 return super.getName(); 34 } 35 36 public void absquatulate() { 37 MethodInvocation invocation = ExposeInvocationInterceptor.currentInvocation(); 38 assertions(invocation); 39 super.absquatulate(); 40 } 41 42 protected abstract void assertions(MethodInvocation invocation); 43 } | Popular Tags |