开发者

Java Attach API: How to set agent properties?

开发者 https://www.devze.com 2023-03-24 09:57 出处:网络
The Java Attach API for JDK6 provides a method getAgentProperties() on VirtualMachine: public abstract Properties getAgentProperties()

The Java Attach API for JDK6 provides a method getAgentProperties() on VirtualMachine:

public abstract Properties getAgentProperties() throws IOException

Returns the current agent pr开发者_运维百科operties 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.

(from the Java Attach API)

My question is, how to set these properties on the other side (i.e. within the JVM where the agent is running) ?

The documentation for the instrument API doesn't talk about this either.


On Hot Spot VM you can set agent properties using sun.misc.VMSupport.getAgentProperties().

0

精彩评论

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