Class AgentLoader

java.lang.Object
com.avrix.agent.AgentLoader

public class AgentLoader extends Object
The AgentLoader class provides a method for loading an agent into a running virtual machine (JVM).
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    The loadAgent method loads the agent into the current JVM if it is not already loaded.
    static void
    loadAgent(String agentJarPath)
    The loadAgent method loads the agent into the current JVM if it is not already loaded.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AgentLoader

      public AgentLoader()
  • Method Details

    • loadAgent

      public static void loadAgent(String agentJarPath)
      The loadAgent method loads the agent into the current JVM if it is not already loaded. To load the agent, the tools.jar library and classes from the com.sun.tools.attach package are used. The path to the agent JAR file is determined from the location of the Launcher class that called the loadAgent method. The resulting path is passed to the loadAgent method of the VirtualMachine class to load the agent. After the agent is loaded, the detach method is called to detach from the virtual machine.
      Parameters:
      agentJarPath - path to the Jar file with this agent
    • loadAgent

      public static void loadAgent()
      The loadAgent method loads the agent into the current JVM if it is not already loaded. To load the agent, the tools.jar library and classes from the com.sun.tools.attach package are used. The path to the agent JAR file is determined from the location of the Launcher class that called the loadAgent method. The resulting path is passed to the loadAgent method of the VirtualMachine class to load the agent. After the agent is loaded, the detach method is called to detach from the virtual machine.