/** * Gets the pid of this JVM, because Java doesn't provide a real way to do this. * * @return */ publicstatic String process_pid(){ String name = ManagementFactory.getRuntimeMXBean().getName(); String[] split = name.split("@"); if (split.length != 2) { thrownew RuntimeException("Got unexpected process name: " + name); }