Class VirtualMachine.ForOpenJ9

    • Constructor Detail

      • ForOpenJ9

        protected ForOpenJ9​(Socket socket)
        Creates a new virtual machine connection for OpenJ9.
        Parameters:
        socket - The socket on which this VM and the target VM communicate.
    • Method Detail

      • attach

        public static VirtualMachine attach​(String processId)
                                     throws IOException
        Attaches to the supplied process id using the default JNA implementation.
        Parameters:
        processId - The process id.
        Returns:
        A suitable virtual machine implementation.
        Throws:
        IOException - If an IO exception occurs during establishing the connection.
      • attach

        public static VirtualMachine attach​(String processId,
                                            int timeout,
                                            VirtualMachine.ForOpenJ9.Dispatcher dispatcher)
                                     throws IOException
        Attaches to the supplied process id.
        Parameters:
        processId - The process id.
        timeout - The timeout for establishing the socket connection.
        dispatcher - The connector to use to communicate with the target VM.
        Returns:
        A suitable virtual machine implementation.
        Throws:
        IOException - If an IO exception occurs during establishing the connection.
      • getSystemProperties

        public Properties getSystemProperties()
                                       throws IOException
        Loads the target VMs system properties.
        Returns:
        The target VM properties.
        Throws:
        IOException - If an I/O exception occurs.
      • getAgentProperties

        public Properties getAgentProperties()
                                      throws IOException
        Loads the target VMs agent properties.
        Returns:
        The target VM properties.
        Throws:
        IOException - If an I/O exception occurs.
      • loadAgent

        public void loadAgent​(String jarFile,
                              String argument)
                       throws IOException
        Loads an agent into the represented virtual machine.
        Parameters:
        jarFile - The jar file to attach.
        argument - The argument to provide or null if no argument should be provided.
        Throws:
        IOException - If an I/O exception occurs.
      • loadAgentPath

        public void loadAgentPath​(String path,
                                  String argument)
                           throws IOException
        Loads a native agent into the represented virtual machine.
        Parameters:
        path - The agent path.
        argument - The argument to provide or null if no argument should be provided.
        Throws:
        IOException - If an I/O exception occurs.
      • loadAgentLibrary

        public void loadAgentLibrary​(String library,
                                     String argument)
                              throws IOException
        Loads a native agent library into the represented virtual machine.
        Parameters:
        library - The agent library.
        argument - The argument to provide or null if no argument should be provided.
        Throws:
        IOException - If an I/O exception occurs.
      • startManagementAgent

        public void startManagementAgent​(Properties properties)
                                  throws IOException
        Starts a JMX management agent.
        Parameters:
        properties - The properties to transfer to the JMX agent.
        Throws:
        IOException - If an I/O error occurs.
      • startLocalManagementAgent

        public String startLocalManagementAgent()
                                         throws IOException
        Starts a local management agent.
        Returns:
        The local connector address.
        Throws:
        IOException - If an I/O error occurs.
      • detach

        public void detach()
                    throws IOException
        Detaches this virtual machine representation.
        Throws:
        IOException - If an I/O exception occurs.