1 10 package org.jgap.distr.grid; 11 12 import java.util.*; 13 14 import org.homedns.dade.jcgrid.*; 15 import org.homedns.dade.jcgrid.admin.*; 16 17 23 public class JGAPAdmin { 24 25 private final static String CVS_REVISION = "$Revision: 1.3 $"; 26 27 public JGAPAdmin() 28 throws Exception { 29 org.homedns.dade.jcgrid.admin.GridAdmin admin = new org.homedns.dade.jcgrid. 30 admin.GridAdmin(); 31 admin.start(); 32 while (true) { 33 List v = admin.getWorkerStats(); 34 System.out.println("Number of workers: " + v.size()); 35 Iterator it = v.iterator(); 36 while (it.hasNext()) { 37 WorkerStats stat = (WorkerStats) it.next(); 38 System.out.println(" " + stat.getName() + " / " + stat.getWorkingFor() + 39 " / " + stat.getStatus() + " / " + stat.getUnitSec()); 40 } 41 Thread.sleep(1000); 42 } 43 } 44 45 public static void main(String [] args) 46 throws Exception { 47 new JGAPAdmin(); 50 } 52 } 53 | Popular Tags |