如何在不重新启动Java的情况下启动AspectJ LoadTime Weaver代理/如何在代码中启动LoadTime Weaver? [英] How to start aspectj loadtime weaver agent without restarting jvm / how to start loadtime weaver in code?

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

问题描述

在应用程序运行期间,是否有任何方法可以启动AspectJ加载时间编织器?意味着无需重新启动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 ,但没有成功.

I tried https://stackoverflow.com/a/35775792/3880225 but without any success.

推荐答案

是的,您可以做到的,我自己为AspectJ实现了此功能,该功能自1.8.7版起就包含在内,请参见/www.eclipse.org/aspectj/doc/released/README-187.html"rel =" nofollow noreferrer>发行说明作为示例.

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.

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

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆