java代理是否在单独的线程中运行?
我觉得这是我应该知道的事情,但是java代理(用-javaagent指定)是否在单独的线程中运行?我读过 Java 代理是一个可插入库,它嵌入在 JVM 中运行并拦截类加载过程,但我想确定:它真的拦截它们(听起来像是在另一个线程中运行并监视类加载)还是由 JVM 通知( JVM 调用它来解析类加载;没有单独的线程)?
再次,我感觉我应该能够弄清楚,但是对我好一点,我工作太努力了,我的大脑有点烧焦了:P
谢谢!
I feel that this is something I should know, but does a java agent (specified with -javaagent) run in a separate thread? I've read that a Java agent is a pluggable library that runs embedded in a JVM and intercepts the classloading process, but I want to make sure: does it really intercept them (which sounds like it's running in another thread and monitoring class loads) or is it notified by the JVM (the JVM invokes it to resolve the class load; there isn't a separate thread for it)?
Again, I get the feeling that I should be able to figure it out, but be nice to me, I'm working too hard and my brain is kinda fried :P
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
ClassFileTransformer 由 ClassLoader 调用。对您链接的文章中的变压器进行一些修改,如下所示:
产生以下输出:
The ClassFileTransformer gets invoked by the ClassLoader. A little modification of the transformer from the article you linked, to look like this:
yields this output: