Class InstallDecompilerAgentImpl


  • public final class InstallDecompilerAgentImpl
    extends java.lang.Object
    This is Byteman's install library copied, with small modifications. This is done with permission of Andrew Dinn, author of Byteman. For the original source of this code, please follow links below: http://byteman.jboss.org/ -- official page https://github.com/bytemanproject/byteman -- git repository This is a provisional solution for the attachment, while I am trying to create an abstract library to share some functionality.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private InstallDecompilerAgentImpl​(java.lang.String pid, boolean addToBoot, boolean setPolicy, java.lang.String host, int port, AgentLoneliness loneliness, java.lang.String[] properties)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private void attach()
      attach to the Java process identified by the process id supplied on the command line
      java.lang.String getHost()  
      java.lang.String getPid()  
      int getPort()  
      private void injectAgent()
      get the attached process to upload and install the agent jar using whatever agent options were configured on the command line
      static void install​(java.lang.String pid, boolean addToBoot, boolean setPolicy, java.lang.String host, int port, AgentLoneliness loneliness, AgentLiveliness liveliness, java.lang.String[] properties)  
      private void locateAgent()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • agentJar

        private java.lang.String agentJar
      • id

        private final java.lang.String id
      • port

        private final int port
      • host

        private final java.lang.String host
      • addToBoot

        private final boolean addToBoot
      • setPolicy

        private final boolean setPolicy
      • props

        private final java.lang.String props
      • vm

        private com.sun.tools.attach.VirtualMachine vm
      • config

        private final Config config
    • Constructor Detail

      • InstallDecompilerAgentImpl

        private InstallDecompilerAgentImpl​(java.lang.String pid,
                                           boolean addToBoot,
                                           boolean setPolicy,
                                           java.lang.String host,
                                           int port,
                                           AgentLoneliness loneliness,
                                           java.lang.String[] properties)
    • Method Detail

      • install

        public static void install​(java.lang.String pid,
                                   boolean addToBoot,
                                   boolean setPolicy,
                                   java.lang.String host,
                                   int port,
                                   AgentLoneliness loneliness,
                                   AgentLiveliness liveliness,
                                   java.lang.String[] properties)
                            throws java.lang.IllegalArgumentException,
                                   java.io.IOException,
                                   com.sun.tools.attach.AttachNotSupportedException,
                                   com.sun.tools.attach.AgentLoadException,
                                   com.sun.tools.attach.AgentInitializationException
        Throws:
        java.lang.IllegalArgumentException
        java.io.IOException
        com.sun.tools.attach.AttachNotSupportedException
        com.sun.tools.attach.AgentLoadException
        com.sun.tools.attach.AgentInitializationException
      • attach

        private void attach()
                     throws com.sun.tools.attach.AttachNotSupportedException,
                            java.io.IOException,
                            java.lang.IllegalArgumentException
        attach to the Java process identified by the process id supplied on the command line
        Throws:
        com.sun.tools.attach.AttachNotSupportedException
        java.io.IOException
        java.lang.IllegalArgumentException
      • injectAgent

        private void injectAgent()
                          throws com.sun.tools.attach.AgentLoadException,
                                 com.sun.tools.attach.AgentInitializationException,
                                 java.io.IOException
        get the attached process to upload and install the agent jar using whatever agent options were configured on the command line
        Throws:
        com.sun.tools.attach.AgentLoadException
        com.sun.tools.attach.AgentInitializationException
        java.io.IOException
      • locateAgent

        private void locateAgent()
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getPort

        public int getPort()
      • getHost

        public java.lang.String getHost()
      • getPid

        public java.lang.String getPid()