public void serviceRequestQueue() throws CLIException {
  if (isVerbose()) {
    outputWriter.printlnMessage(rbMessages.getString("verbose-processing-request"));
  }
  try {
    while (!requestQueue.isEmpty()) {
      CLIRequest req=(CLIRequest)requestQueue.remove(0);
      try {
        req.process(this);
        if (statusOS != null) {
          String status=formatStatus(req.getOptions(),0);
          statusOS.write(status.getBytes());
        }
      }
 catch (      CLIException e) {
        if (isVerbose()) {
          e.printStackTrace(System.out);
        }
        if (statusOS != null) {
          String status=formatStatus(req.getOptions(),e.getExitCode());
          statusOS.write(status.getBytes());
        }
        if (bContinue) {
          outputWriter.printlnError(e.getMessage());
        }
 else {
          throw e;
        }
      }
    }
  }
 catch (  IOException e) {
    throw new CLIException(e,ExitCodes.REQUEST_CANNOT_BE_PROCESSED);
  }
 finally {
    if (statusOS != null) {
      try {
        statusOS.close();
      }
 catch (      IOException ex) {
      }
      statusOS=null;
    }
  }
}

public void serviceRequestQueue ( ) throws CLIException { if ( isVerbose ( ) ) { outputWriter . printlnMessage ( rbMessages . getString ( "verbose-processing-request" ) ) ; } try { while ( ! requestQueue . isEmpty ( ) ) { CLIRequest req = ( CLIRequest ) requestQueue . remove ( 0 ) ; try { req . process ( this ) ; if ( statusOS != null ) { String status = formatStatus ( req . getOptions ( ) , 0 ) ; statusOS . write ( status . getBytes ( ) ) ; } } catch ( CLIException e ) { if ( isVerbose ( ) ) { e . printStackTrace ( System . out ) ; } if ( statusOS != null ) { String status = formatStatus ( req . getOptions ( ) , e . getExitCode ( ) ) ; statusOS . write ( status . getBytes ( ) ) ; } if ( bContinue ) { outputWriter . printlnError ( e . getMessage ( ) ) ; } else { throw e ; } } } } catch ( IOException e ) { throw new CLIException ( e , ExitCodes . REQUEST_CANNOT_BE_PROCESSED ) ; } finally { if ( statusOS != null ) { try { statusOS . close ( ) ; } catch ( IOException ex ) { } statusOS = null ; } } }
services the request queue .
