protected String getProcessDescription ( OptionsAndArgs pOpts , VirtualMachineHandler pHandler ) { if ( pOpts . getPid ( ) != null ) { return "PID " + pOpts . getPid ( ) ; } else if ( pOpts . getProcessPattern ( ) != null ) { StringBuffer desc = new StringBuffer ( "process matching \"" ) . append ( pOpts . getProcessPattern ( ) . pattern ( ) ) . append ( "\"" ) ; try { desc . append ( " (PID: " ) . append ( pHandler . findProcess ( pOpts . getProcessPattern ( ) ) . getId ( ) ) . append ( ")" ) ; } catch ( InvocationTargetException e ) { // ignored } catch ( NoSuchMethodException e ) { // ignored } catch ( IllegalAccessException e ) { // ignored } return desc . toString ( ) ; } else { return "(null)" ; } }
Get a description of the process attached either the numeric id only or if a pattern is given the pattern and the associated PID