1 16 17 package org.springframework.aop.framework.adapter; 18 19 import org.aopalliance.aop.Advice; 20 import org.aopalliance.intercept.Interceptor; 21 22 import org.springframework.aop.Advisor; 23 import org.springframework.aop.MethodBeforeAdvice; 24 25 28 class BeforeAdviceAdapter implements AdvisorAdapter { 29 30 33 public boolean supportsAdvice(Advice advice) { 34 return advice instanceof MethodBeforeAdvice; 35 } 36 37 40 public Interceptor getInterceptor(Advisor advisor) { 41 MethodBeforeAdvice advice = (MethodBeforeAdvice) advisor.getAdvice(); 42 return new MethodBeforeAdviceInterceptor(advice) ; 43 } 44 45 } 46 | Popular Tags |