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