源代码插装:最基本的技巧是在源代码阶段添加插装,这样编译和部署后的类就已经在运行时包含了插装。
Source code instrumentation: the most basic technique is to add instrumentation at the source code phase so that the compiled and deployed classes already contain the instrumentation at run time.
相反,插装应用程序代码本身会直接修改和影响核心代码的执行。
In contrast, instrumenting the application code itself directly modifies and affects the core code's execution.
类包装背后的理念是:目标类可以包装在一层插装代码中,后者具有与被包装的类相同的外部行为。
The idea behind class wrapping is that a target class can be wrapped in a layer of instrumenting code that retains the same external behavior as the class that's wrapped.
在本文的第1部分中,我只讨论基于源代码的插装;您将在第2部分中了解更多关于截取、字节码插装和类包装的信息。
Here in Part 1, I address only source code based instrumentation; you'll read more about interception, bytecode instrumentation, and class wrapping in Part 2.
本节将讨论如何实现源代码级插装,并将提供一些最佳实践和示例代码。
This section addresses the subject of implementing source level instrumentation and provides some best practices and example source code.
提供有效插装应用程序源代码的方法。
Offers techniques for efficiently instrumenting application source code.
提供有效插装应用程序源代码的方法。
Offers techniques for efficiently instrumenting application source code.
应用推荐