gpt4 book ai didi

Java 附加 API : How to set agent properties?

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:16:07 26 4
gpt4 key购买 nike

JDK6 的 Java Attach API 在 VirtualMachine 上提供了一个方法 getAgentProperties():

public abstract Properties getAgentProperties() throws IOException

Returns the current agent properties in the target virtual machine. The target virtual machine can maintain a list of properties on behalf of agents. The manner in which this is done, the names of the properties, and the types of values that are allowed, is implementation specific. Agent properties are typically used to store communication end-points and other agent configuration details. For example, a debugger agent might create an agent property for its transport address.

This method returns the agent properties whose key and value is a String. Properties whose key or value is not a String are omitted. If there are no agent properties maintained in the target virtual machine then an empty property list is returned.

(来自Java Attach API)

我的问题是,如何在另一侧设置这些属性(即在运行代理的 JVM 中)?

instrument API 的文档也不谈这个。

最佳答案

在 Hot Spot VM 上,您可以使用 sun.misc.VMSupport.getAgentProperties() 设置代理属性。

关于Java 附加 API : How to set agent properties?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6894920/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com