本文介绍了如何在不重启 jvm 的情况下启动 aspectj loadtime weaver 代理/如何在代码中启动 loadtime weaver?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法在应用程序运行期间启动AspectJ loadtime weaver?意味着不重新启动JVM并添加 -javaagent:... ?

Is there any way to start the AspectJ loadtime weaver during the application is running? Means without restarting the JVM and adding -javaagent:... ?

我尝试了https://stackoverflow.com/a/35775792/3880225但没有成功.

推荐答案

是的,你可以这样做,我自己为 AspectJ 实现了这个功能,它从 1.8.7 版开始就包含在内,请参阅 发行说明 示例.

Yes, you can do that, I implemented this capability myself for AspectJ and it was included since version 1.8.7, see release notes for an example.

但请注意,编织仅适用于激活编织器后加载的类.

But please note that weaving will only work for classes loaded after you have activated the weaver.

这篇关于如何在不重启 jvm 的情况下启动 aspectj loadtime weaver 代理/如何在代码中启动 loadtime weaver?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-13 12:03