DefaultListModel listModel = (DefaultListModel) view.UptimeMart.getModel();
for (int i = 0; i < 1000; i++) {
for (int l = 0; l < listModel.getSize(); l++) {
//Current server
Server server = (Server) listModel.getElementAt(l);
//Debug
System.out.println(server.getURL());
try {
ExecutorService executor = Executors.newCachedThreadPool();
List<Future<Boolean>> statuses = null;
try {
statuses = executor.invokeAll(Arrays.asList(new Monitor(server.getURL())));
} catch (InterruptedException ex) {
Logger.getLogger(view.UptimeMart.class.getName()).log(Level.SEVERE, null, ex);
}
//Set the status of the server
try {
server.setCurrentStatus(statuses.get(0).get());
listModel.set(l, server);
} catch (InterruptedException ex) {
Logger.getLogger(view.UptimeMart.class.getName()).log(Level.SEVERE, null, ex);
} catch (ExecutionException ex) {
Logger.getLogger(view.UptimeMart.class.getName()).log(Level.SEVERE, null, ex);