public static int getPID ( ) { if ( pid == - 1 ) { RuntimeMXBean mx = ManagementFactory . getRuntimeMXBean ( ) ; String name = mx . getName ( ) ; String token = name . split ( "@" ) [ 0 ] ; pid = parseInt ( token ) ; } return pid ; }
Returns the virtual machine s process identifier .