public interface MethodInterceptor extends Interceptor { Object invoke(MethodInvocation invocation) throws Throwable; }
//Adviceの定義(Joinpointで実行される振る舞い) private class SpecialInterceptor implements MethodInterceptor { public Object invoke(MethodInvocation invocation) throws Throwable { //メソッド呼び出し前の処理を記述 System.out.println("前処理"); //実際のメソッド呼び出し Object result = invocation.proceed(); //メソッド呼び出し後の処理を記述 System.out.println("後処理"); return result; } (以下省略)