private int processId ( final java . lang . Process process ) { int processId = 0 ; try { final Field f = process . getClass ( ) . getDeclaredField ( "pid" ) ; f . setAccessible ( true ) ; processId = f . getInt ( process ) ; } catch ( final Throwable e ) { e . printStackTrace ( ) ; } return processId ; }
Attempt to get the process id for this process