// -manInTheMiddle
else if (
(args[argCount].equalsIgnoreCase("-manInTheMiddle"))
|| (args[argCount].equals("-m")))
{
ManInTheMiddle manInTheMiddle = null;
// Increment arg count
argCount++;
// Get the man-in-the-middle object
if ((manInTheMiddle = monitorConfigFromArgs.getManInTheMiddle())
== null)
manInTheMiddle = new ManInTheMiddleImpl();
// ADD: Check for correct number of remaining args
// Create redirect
Redirect redirect = new RedirectImpl();
// Get the redirect values
redirect.setListenPort(Integer.valueOf(args[argCount++]).intValue());
redirect.setHost(args[argCount++]);
redirect.setMaxConnections(
Integer.valueOf(args[argCount++]).intValue());
redirect.setReadTimeoutSeconds(
Integer.valueOf(args[argCount++]).intValue());
// Add redirect
manInTheMiddle.addRedirect(redirect);
// Set the man-in-the-middle
monitorConfigFromArgs.setManInTheMiddle(manInTheMiddle);
}