dispatchersurveillant.java

来自「分布式计算平台P2HP-1的源代码;P2HP-1是基于P2P的高性能计算平台」· Java 代码 · 共 55 行

JAVA
55
字号
/*
 * Created on 2004-10-12
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package cn.edu.hust.cgcl.biogrid.dispatcher;

/**
 * @author Administrator
 *This class is to show the detail information in the dispatcher node
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class DispatcherSurveillant extends Thread{
	DispatcherInfo d_info=null;
	private boolean isActive=true;
public DispatcherSurveillant(DispatcherInfo dinfo){
	d_info=dinfo;
}
public void run(){
	System.out.println("\t~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
	System.out.println("ID\tIp\t\tfirstMonitorID\tfirstMonitorIp\tsecondMonitorID\tsecondMonitorIp\tjobCount\tpcLoad\tworkerCount\tidleWorkerCount\tcanAcceptJob");
	//while(isActive){
		//d_info.dispatcherUpdate();
		System.out.print(d_info.getDispatcherId()+"\t");
		System.out.print(d_info.getDispatcherIp()+"\t");
		System.out.print(d_info.getFirstMonitorId()+"\t\t");
		System.out.print(d_info.getFirstMonitorIp()+"\t");
		System.out.print(d_info.getSecondMonitorId()+"\t\t");
		System.out.print(d_info.getSecondMonitorIp()+"\t");
		System.out.print(d_info.getJobCount()+"\t");
		System.out.print(d_info.getDispatcherLoad()+"\t");
		System.out.print(d_info.getWorkerCount()+"\t");
		System.out.print(d_info.getIdleWorkerCount()+"\t");
		System.out.println(d_info.getCanAcceptJob()+"\t");
		try
        {
            Thread.sleep(2000);
            
        }
        catch (InterruptedException e)
        {
        	if(!isActive) return;
        //get back to work
        }
	//}
}
public void terminated(){
	isActive=false;
	System.out.println("\t~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
	
}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?