spring aop获取Method
Signature signature = a_joinPoint.getSignature();MethodSignature methodSignature = (MethodSignature) signature;
Method method = methodSignature.getMethod();
try
{
Object[] arguments = a_joinPoint.getArgs();
result = method.invoke(mock, arguments);
s_logger.debug("Mocking " + formatCall(a_joinPoint));
}
catch (InvocationTargetException e)
{
s_logger.debug("Failed to delegate to mock: "
+ formatCall(a_joinPoint), e);
throw e.getTargetException();
}
你可以这样拿类的方法
Method method = pjp.getTarget().getClass().getMethod(joinPointObject.getName, joinPointObject.getParameterTyeps())
页:
[1]