public static int identifyPid(final String name) throws PidUnavailableException {
  try {
    final int index=name.indexOf("@");
    if (index < 0) {
      throw new PidUnavailableException("Unable to parse pid from " + name);
    }
    return Integer.valueOf(name.substring(0,index));
  }
 catch (  NumberFormatException e) {
    throw new PidUnavailableException("Unable to parse pid from " + name,e);
  }
}

public static int identifyPid ( final String name ) throws PidUnavailableException { try { final int index = name . indexOf ( "@" ) ; if ( index < 0 ) { throw new PidUnavailableException ( "Unable to parse pid from " + name ) ; } return Integer . valueOf ( name . substring ( 0 , index ) ) ; } catch ( NumberFormatException e ) { throw new PidUnavailableException ( "Unable to parse pid from " + name , e ) ; } }
returns the pid for this process using the specified name from runtimemxbean .
