1 16 17 package org.springframework.aop.framework; 18 19 import java.lang.reflect.Method ; 20 21 import javax.servlet.ServletException ; 22 23 import org.springframework.aop.AfterReturningAdvice; 24 import org.springframework.aop.MethodBeforeAdvice; 25 import org.springframework.aop.ThrowsAdvice; 26 import org.springframework.dao.DataAccessException; 27 28 34 public class CountingMultiAdvice extends MethodCounter 35 implements MethodBeforeAdvice, AfterReturningAdvice, ThrowsAdvice { 36 37 public void before(Method m, Object [] args, Object target) throws Throwable { 38 count(m); 39 } 40 41 public void afterReturning(Object o, Method m, Object [] args, Object target) throws Throwable { 42 count(m); 43 } 44 45 public void afterThrowing(ServletException sex) throws Throwable { 46 count(ServletException .class.getName()); 47 } 48 49 public void afterThrowing(DataAccessException ex) throws Throwable { 50 count(DataAccessException.class.getName()); 51 } 52 53 } 54 | Popular Tags |