@@ -0,0 +1,875 @@
+package forager.client;%0A%0Aimport java.io.IOException;%0A%0Apublic class StatusMonitor implements Runnable %7B%0A%0A    int maxActive = 4;%0A%0A    boolean online;%0A%0A    private Forager forager;%0A%0A    public StatusMonitor(Forager forager) %7B%0A        this.forager = forager;%0A    %7D%0A%0A    public void run() %7B%0A        online = true;%0A%0A        while (online) %7B%0A            int active = forager.threadPool.getActiveCount();%0A            if (active %3C maxActive) %7B%0A                int numTasks = maxActive - active;%0A                try %7B%0A                    forager.submitTaskRequest(numTasks);%0A                %7D catch (IOException e) %7B%0A                    System.out.println(%22Failed to submit task request!%22);%0A                    e.printStackTrace();%0A                %7D%0A            %7D%0A            try %7B%0A                Thread.sleep(5000);%0A            %7D catch (InterruptedException e) %7B %7D%0A        %7D%0A    %7D%0A%7D%0A

Create system status monitor thread