?? apploadmanagerimpl.java
字號:
package samples.fw;
public class AppLoadManagerImpl
extends org.csapi.fw.fw_application.integrity.IpAppLoadManagerPOA
{
java.util.Date startTime;
java.util.Date stopTime;
boolean toFwSuspended = false;
java.text.SimpleDateFormat dFormat = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSSZ");
public AppLoadManagerImpl(){}
public void queryAppLoadReq(org.csapi.TpTimeInterval timeInterval)
{
try{
startTime = dFormat.parse(timeInterval.StartTime);
stopTime = dFormat.parse(timeInterval.StopTime);
}catch(Exception e){
}
java.util.TimerTask loadResTask = (new java.util.TimerTask() {
public void run()
{
if (toFwSuspended) return;
if (stopTime.getTime()<=System.currentTimeMillis())
{
cancel();
return;
}
//o/w gather and report the load statistics
// need to be defined
TpLoadStatistic[] loadStatistics = new TpLoadStatistic[0];
/*
public org.csapi.fw.TpLoadStatisticEntityID LoadStatisticEntityID = null;
public String TimeStamp = null;
public org.csapi.fw.TpLoadStatisticInfo LoadStatisticInfo = null;
// info
private org.csapi.fw.TpLoadStatisticData ___LoadStatisticData;
private org.csapi.fw.TpLoadStatisticError ___LoadStatisticError;
private org.csapi.fw.TpLoadStatisticInfoType __discriminator;
*/
try
{
AppFWImpl.ipLoadManager.queryAppLoadRes(loadStatistics);
}catch(Exception e)
{
}
}
});
// FOR Now, just hard code to report load for every 5 second.
AppFWImpl.timer.schedule(loadResTask,startTime,5000);
}
// fw will only call this when we call to ipLoadManager.queryLoadReq
// since we did not call, so we not do need to handle this method.
public void queryLoadRes(org.csapi.fw.TpLoadStatistic[] loadStatistics)
{
}
// fw will only call this when we call to ipLoadManager.queryLoadReq
// since we did not call, so we not do need to handle this method.
public void queryLoadErr (org.csapi.fw.TpLoadStatisticError loadStatisticsError){}
public void loadLevelNotification (org.csapi.fw.TpLoadStatistic[] loadStatistics)
{
}
public void resumeNotification() {toFwSuspended = true;}
public void suspendNotification(){toFwSuspended = false;}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -