sun.tools.attach
Class HotSpotVirtualMachine

java.lang.Object
  extended by com.sun.tools.attach.VirtualMachine
      extended by sun.tools.attach.HotSpotVirtualMachine
Direct Known Subclasses:
LinuxVirtualMachine, WindowsVirtualMachine

public abstract class HotSpotVirtualMachine
extends VirtualMachine

The HotSpot implementation of com.sun.tools.attach.VirtualMachine.


Method Summary
 InputStream dumpHeap(Object... args)
           
 Properties getAgentProperties()
          Returns the current agent properties in the target virtual machine.
 Properties getSystemProperties()
          Send "properties" command to target VM.
 InputStream heapHisto(Object... args)
           
 void loadAgent(String agent, String options)
          Load JPLIS agent which will load the agent JAR file and invoke the agentmain method.
 void loadAgentLibrary(String agentLibrary, String options)
          Load agent library - library name will be expanded in target VM.
 void loadAgentPath(String agentLibrary, String options)
          Load agent - absolute path of library provided to target VM.
 void localDataDump()
           
 InputStream printFlag(String name)
           
 InputStream remoteDataDump(Object... args)
           
 InputStream setFlag(String name, String value)
           
 
Methods inherited from class com.sun.tools.attach.VirtualMachine
attach, attach, detach, equals, hashCode, id, list, loadAgent, loadAgentLibrary, loadAgentPath, provider, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

loadAgentLibrary

public void loadAgentLibrary(String agentLibrary,
                             String options)
                      throws AgentLoadException,
                             AgentInitializationException,
                             IOException
Load agent library - library name will be expanded in target VM.

Specified by:
loadAgentLibrary in class VirtualMachine
Parameters:
agentLibrary - The name of the agent library.
options - The options to provide to the Agent_OnAttach function (can be null).
Throws:
AgentLoadException - If the agent library does not exist, or cannot be loaded for another reason.
AgentInitializationException - If the Agent_OnAttach function returns an error
IOException - If an I/O error occurs
See Also:
AgentInitializationException.returnValue()

loadAgentPath

public void loadAgentPath(String agentLibrary,
                          String options)
                   throws AgentLoadException,
                          AgentInitializationException,
                          IOException
Load agent - absolute path of library provided to target VM.

Specified by:
loadAgentPath in class VirtualMachine
Parameters:
agentLibrary - The full path of the agent library.
options - The options to provide to the Agent_OnAttach function (can be null).
Throws:
AgentLoadException - If the agent library does not exist, or cannot be loaded for another reason.
AgentInitializationException - If the Agent_OnAttach function returns an error
IOException - If an I/O error occurs
See Also:
AgentInitializationException.returnValue()

loadAgent

public void loadAgent(String agent,
                      String options)
               throws AgentLoadException,
                      AgentInitializationException,
                      IOException
Load JPLIS agent which will load the agent JAR file and invoke the agentmain method.

Specified by:
loadAgent in class VirtualMachine
Parameters:
agent - Path to the JAR file containing the agent.
options - The options to provide to the agent's agentmain method (can be null).
Throws:
AgentLoadException - If the agent does not exist, or cannot be started in the manner specified in the java.lang.instrument specification.
AgentInitializationException - If the agentmain throws an exception
IOException - If an I/O error occurs

getSystemProperties

public Properties getSystemProperties()
                               throws IOException
Send "properties" command to target VM.

Specified by:
getSystemProperties in class VirtualMachine
Returns:
The system properties
Throws:
IOException - If an I/O error occurs
See Also:
System.getProperties(), VirtualMachine.loadAgentLibrary(java.lang.String, java.lang.String), VirtualMachine.loadAgent(java.lang.String, java.lang.String)

getAgentProperties

public Properties getAgentProperties()
                              throws IOException
Description copied from class: VirtualMachine
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.

Specified by:
getAgentProperties in class VirtualMachine
Returns:
The agent properties
Throws:
IOException - If an I/O error occurs

localDataDump

public void localDataDump()
                   throws IOException
Throws:
IOException

remoteDataDump

public InputStream remoteDataDump(Object... args)
                           throws IOException
Throws:
IOException

dumpHeap

public InputStream dumpHeap(Object... args)
                     throws IOException
Throws:
IOException

heapHisto

public InputStream heapHisto(Object... args)
                      throws IOException
Throws:
IOException

setFlag

public InputStream setFlag(String name,
                           String value)
                    throws IOException
Throws:
IOException

printFlag

public InputStream printFlag(String name)
                      throws IOException
Throws:
IOException


Copyright © 2007-2012. All Rights Reserved.