1 2 17 18 package org.springframework.aop.interceptor; 19 20 import org.aopalliance.intercept.MethodInterceptor; 21 import org.aopalliance.intercept.MethodInvocation; 22 23 28 public class NopInterceptor implements MethodInterceptor { 29 30 private int count; 31 32 35 public Object invoke(MethodInvocation invocation) throws Throwable { 36 increment(); 37 return invocation.proceed(); 38 } 39 40 public int getCount() { 41 return this.count; 42 } 43 44 protected void increment() { 45 ++count; 46 } 47 48 public boolean equals(Object other) { 49 if (!(other instanceof NopInterceptor)) { 50 return false; 51 } 52 if (this == other) { 53 return true; 54 } 55 return this.count == ((NopInterceptor) other).count; 56 } 57 58 } 59 | Popular Tags |