AspectJ - 如何使用非常大的instruemt方法

时间:2017-01-04 06:39:23

标签: java aspectj bytecode-manipulation

我有一个基于AspectJ的通用Java代理,用于检测具有特定结构的方法。代理应该能够使用任何Java Web应用程序。

问题 - 如果代理尝试检测的方法非常大,生成的字节代码可能大于64k - >因此,检测将失败,因为JVM不支持这样的方法。

有没有办法处理此类案件?我无法控制实际的应用程序代码,只能控制代理。

与JSP相关的示例:

pointcut getJSPRequests(HttpServletRequest req, HttpServletResponse resp):
        args(req, resp) && execution(void _jspService(..));

void around(HttpServletRequest req, HttpServletResponse resp):
        getJSPRequests(req, resp) {
     callSomeMethod(thisJoinPointStaticPart.getSignature(), req, resp);
     proceed(req, resp);

}

谢谢,

0 个答案:

没有答案