public class V1MethodBeforeAdviceInterceptor extends V1AbstractAspectAdvice implements V1Advice,V1MethodInterceptor {
private V1JoinPoint joinPoint;
public V1MethodBeforeAdviceInterceptor(Method aspectMethod, Object aspectTarget) {
super(aspectMethod, aspectTarget);
}
private void before(Method method,Object[] args,Object target) throws Throwable{
//传送了给织入参数
//method.invoke(target);
super.invokeAdviceMethod(this.joinPoint,null,null);
}
@Override
public Object invoke(V1MethodInvocation mi) throws Throwable {
//从被织入的代码中才能拿到,JoinPoint
this.joinPoint = mi;
before(mi.getMethod(), mi.getArguments(), mi.getThis());
return mi.proceed();
}
}