String options = sb.toString();
Integer pid = pids.get(0);
final VirtualMachine vm = VirtualMachine.attach("" + pid);
log.log(Level.INFO, "Loading agent with command " + options + " as agent " + agentFile.getCanonicalPath());
vm.loadAgent(agentFile.getCanonicalPath(), options);
server.accept();
shell = server.getShell();
closeable.add(new Closeable() {
public void close() throws IOException {
vm.detach();
}