⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 apploadmanagerimpl.java

📁 中兴公司在parlayx开发方面的培训文档
💻 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 + -