@@ -0,0 +1,1161 @@
+package org.test;%0A%0Apublic class MyThread extends Thread %7B%0A%0A%09private boolean broken = true;%0A%0A%09public void run() %7B%0A%09%09while (broken) %7B%0A%09%09%09try %7B%0A%09%09%09%09Thread.sleep(10000);%0A%09%09%09%09System.out.println(%22broken:%22 + broken);%0A%09%09%09%7D catch (Exception e) %7B%0A%09%09%09%09e.printStackTrace();%0A%09%09%09%7D%0A%09%09%7D%0A%09%7D%0A%0A%09public void setBroken(boolean broken) %7B%0A%09%09this.broken = broken;%0A%09%7D%0A%0A%09public static void main(String%5B%5D args) %7B%0A%09%09MyThread t = new MyThread();%0A%09%09t.start();%0A%09%7D%0A%7D%0A%0Apackage org.test;%0A%0Aimport java.io.IOException;%0Aimport java.util.Enumeration;%0Aimport java.util.Properties;%0A%0Aimport com.sun.tools.attach.AttachNotSupportedException;%0Aimport com.sun.tools.attach.VirtualMachine;%0A%0Apublic class VirtualMachineTest %7B%0A%0A%09@SuppressWarnings(%22rawtypes%22)%0A%09public static void main(String%5B%5D args) %7B%0A%09%09try %7B%0A%09%09%09VirtualMachine vm = VirtualMachine.attach(%22107048%22);%0A%09%09%09Properties props = vm.getSystemProperties();%0A%09%09%09Enumeration en = props.propertyNames();%0A%09%09%09while (en.hasMoreElements()) %7B%0A%09%09%09%09Object key = en.nextElement();%0A%09%09%09%09System.out.println(key+%22:%22 + props.get(key));%0A%09%09%09%7D%0A%09%09%7D catch (AttachNotSupportedException e) %7B%0A%09%09%09e.printStackTrace();%0A%09%09%7D catch (IOException e) %7B%0A%09%09%09e.printStackTrace();%0A%09%09%7D%0A%09%7D%0A%7D%0A

Create InstrumentationAgentmain.java