Class VirtualMachine.ForHotSpot

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.String processId
      The target process's id.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected ForHotSpot​(java.lang.String processId)
      Creates a new HotSpot-compatible VM implementation.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract void connect()
      Connects to the target VM.
      void loadAgent​(java.lang.String jarFile, java.lang.String argument)
      Loads an agent into the represented virtual machine.
      protected abstract int read​(byte[] buffer)
      Reads from the communication channel.
      protected abstract void write​(byte[] buffer)
      Writes to the communication channel.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • processId

        protected final java.lang.String processId
        The target process's id.
    • Constructor Detail

      • ForHotSpot

        protected ForHotSpot​(java.lang.String processId)
        Creates a new HotSpot-compatible VM implementation.
        Parameters:
        processId - The target process's id.
    • Method Detail

      • loadAgent

        public void loadAgent​(java.lang.String jarFile,
                              java.lang.String argument)
                       throws java.io.IOException
        Description copied from interface: VirtualMachine
        Loads an agent into the represented virtual machine.
        Specified by:
        loadAgent in interface VirtualMachine
        Parameters:
        jarFile - The jar file to attach.
        argument - The argument to provide or null if no argument should be provided.
        Throws:
        java.io.IOException - If an I/O exception occurs.
      • connect

        protected abstract void connect()
                                 throws java.io.IOException
        Connects to the target VM.
        Throws:
        java.io.IOException - If an I/O exception occurs.
      • read

        protected abstract int read​(byte[] buffer)
                             throws java.io.IOException
        Reads from the communication channel.
        Parameters:
        buffer - The buffer to read into.
        Returns:
        The amount of bytes read.
        Throws:
        java.io.IOException - If an I/O exception occurs.
      • write

        protected abstract void write​(byte[] buffer)
                               throws java.io.IOException
        Writes to the communication channel.
        Parameters:
        buffer - The buffer to write from.
        Throws:
        java.io.IOException - If an I/O exception occurs.