Class VirtualMachine.ForHotSpot.Connection.OnPersistentByteChannel<T>

    • Field Detail

      • BLANK

        private static final byte[] BLANK
        A blank line argument.
    • Constructor Detail

      • OnPersistentByteChannel

        public OnPersistentByteChannel()
    • Method Detail

      • execute

        public VirtualMachine.ForHotSpot.Connection.Response execute​(java.lang.String protocol,
                                                                     java.lang.String... argument)
                                                              throws java.io.IOException
        Executes a command on the current connection.
        Specified by:
        execute in interface VirtualMachine.ForHotSpot.Connection
        Parameters:
        protocol - The target VMs protocol version for the attach API.
        argument - The arguments to send to the target VM.
        Returns:
        The response of the target JVM.
        Throws:
        java.io.IOException - If an I/O error occurred.
      • connect

        protected abstract T connect()
                              throws java.io.IOException
        Creates a new connection to the target VM.
        Returns:
        Returns a new connection to the target VM.
        Throws:
        java.io.IOException - If an I/O exception occurs.
      • close

        protected abstract void close​(T connection)
                               throws java.io.IOException
        Closes the connection to the target VM.
        Parameters:
        connection - The connection to close.
        Throws:
        java.io.IOException - If an I/O exception occurs.
      • write

        protected abstract void write​(T connection,
                                      byte[] buffer)
                               throws java.io.IOException
        Writes to the target VM.
        Parameters:
        connection - The connection to write to.
        buffer - The buffer to write to.
        Throws:
        java.io.IOException - If an I/O exception occurs during writing.
      • read

        protected abstract int read​(T connection,
                                    byte[] buffer)
                             throws java.io.IOException
        Reads from the target VM.
        Parameters:
        connection - The connection to read from.
        buffer - The buffer to store the result in.
        Returns:
        The number of byte that were read.
        Throws:
        java.io.IOException - If an I/O exception occurs.