Package model

Examples of model.Server


        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);
View Full Code Here

TOP

Related Classes of model.Server

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.