开发者

Is it possible to modify the bytecode and save it with javassist?

All the references I've found on the web says the byte开发者_如何转开发code can be modified at runtime, but I don't seem to find if that modified bytecode could replace the original.

This way the original bytecode could be substituted once, and the rest of the time, use the enhanced afterwards.


Yes, it's called build-time byte-code instrumentation; javassist as well as libraries such as aspectj supports this model.

I've had good experience with the latter in combination with Apache Maven using the aspectj-maven-plugin.

[Edit] Also see the Implementing Build-time Bytecode Instrumentation With Javassist article.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜