code: private static String getProcessId() {
          // something like '<pid>@<hostname>', at least in SUN / Oracle JVMs
          final String jvmName = ManagementFactory.getRuntimeMXBean().getName();
          final int index = jvmName.indexOf('@');
          return index < 0 ? jvmName : jvmName.substring(0, index);
      }
docs: Hack for finding the process id. Used in creating an unique agent id.