Even the list of classes being processed is nearly the same, despite the different technique used for intercepting the classloading 被處理的類列表幾乎是相同的,只是用于截取類加載的技術(shù)不同。
There s a subtle problem involved in making this substitution work properly that goes back to the discussion of classloading in 要想讓這種取代可以正確工作,會涉及到一個微妙的問題,它可追溯到本系列
This implementation involves three separate pieces of code : intercepting the classloading, accessing the annotation information, and the actual transformation 方法。該實現(xiàn)涉及三個單獨的代碼段:截獲classloading、訪問注釋信息和實際轉(zhuǎn)換。
The parent last classloader mode causes the classloader to first attempt to load classes from its local classpath before delegating the classloading to its parent parent_lastclassloader模式會導(dǎo)致類裝載器在裝載到父類之前首先嘗試從自身的類路徑裝載類。
Instance . because the current code will only work with j2se 5.0 due to the use of the instrumentation methods to intercept classloading, i could have used the new 因為當(dāng)前的代碼將只使用j2se5.0(由于使用了instrumentation方法來截獲classloading),所以我本應(yīng)該使用新的
As you can see, the jvm s runtime classloading can be nested quite deeply; for performance purposes you ll generally focus on the code leading up to the classloader calls, similar to the highlighted portion of the stack trace shown in figure 5 如您可以看到的,jvm運行期的類加載可以嵌套得相當(dāng)深;出于性能目的您通常應(yīng)該關(guān)注那些引起類加載器調(diào)用的代碼,像圖5中顯示的棧記錄的高亮部分。