Package org.jrd.backend.communication
Class InstallDecompilerAgentImpl
- java.lang.Object
-
- org.jrd.backend.communication.InstallDecompilerAgentImpl
-
public final class InstallDecompilerAgentImpl extends java.lang.ObjectThis 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.
-
-
Field Summary
Fields Modifier and Type Field Description private booleanaddToBootprivate java.lang.StringagentJarprivate Configconfigprivate java.lang.Stringhostprivate java.lang.Stringidprivate intportprivate java.lang.Stringpropsprivate booleansetPolicyprivate com.sun.tools.attach.VirtualMachinevm
-
Constructor Summary
Constructors Modifier Constructor Description privateInstallDecompilerAgentImpl(java.lang.String pid, boolean addToBoot, boolean setPolicy, java.lang.String host, int port, java.lang.String[] properties)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidattach()attach to the Java process identified by the process id supplied on the command lineprivate voidinjectAgent()get the attached process to upload and install the agent jar using whatever agent options were configured on the command linestatic voidinstall(java.lang.String pid, boolean addToBoot, boolean setPolicy, java.lang.String host, int port, java.lang.String[] properties)private voidlocateAgent()
-
-
-
Field Detail
-
agentJar
private java.lang.String agentJar
-
id
private java.lang.String id
-
port
private int port
-
host
private java.lang.String host
-
addToBoot
private boolean addToBoot
-
setPolicy
private boolean setPolicy
-
props
private java.lang.String props
-
vm
private com.sun.tools.attach.VirtualMachine vm
-
config
private Config config
-
-
Method Detail
-
install
public static void install(java.lang.String pid, boolean addToBoot, boolean setPolicy, java.lang.String host, int port, 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.IllegalArgumentExceptionjava.io.IOExceptioncom.sun.tools.attach.AttachNotSupportedExceptioncom.sun.tools.attach.AgentLoadExceptioncom.sun.tools.attach.AgentInitializationException
-
attach
private void attach() throws com.sun.tools.attach.AttachNotSupportedException, java.io.IOException, java.lang.IllegalArgumentExceptionattach to the Java process identified by the process id supplied on the command line- Throws:
com.sun.tools.attach.AttachNotSupportedExceptionjava.io.IOExceptionjava.lang.IllegalArgumentException
-
injectAgent
private void injectAgent() throws com.sun.tools.attach.AgentLoadException, com.sun.tools.attach.AgentInitializationException, java.io.IOExceptionget 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.AgentLoadExceptioncom.sun.tools.attach.AgentInitializationExceptionjava.io.IOException
-
locateAgent
private void locateAgent() throws java.io.IOException- Throws:
java.io.IOException
-
-