?? netclienttest.java
字號(hào):
package com.briup.impl.net;
import java.util.Collection;
import java.util.Properties;
import com.briup.Backup;
import com.briup.Config;
import com.briup.Gather;
import com.briup.Log;
import com.briup.NetClient;
import com.briup.exception.BackupException;
import com.briup.impl.config.ConfigImpl;
/*
* /*
* 1、獲取config實(shí)例
* 2、獲取Gather,Log,Backup,NetClient
* 3、調(diào)用gather采集數(shù)據(jù)
* 4、調(diào)用backup備份數(shù)據(jù)
* 5、調(diào)用netClient發(fā)送數(shù)據(jù)
*/
public class NetClientTest {
public static void main(String[] agrs){
Collection c = null;
Properties pro = new Properties();
pro.setProperty("config_file_path", "src/com/briup/resource/config.xml");
Backup bu = null;
try {
Config config = ConfigImpl.newInstance(pro);
Gather gather = config.getGather();
Log log = (Log) config.getLog();
bu =config.getBackup();
NetClient nc = config.getNetClient();
c = gather.doGather();
nc.send(c);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
try {
bu.load();
} catch (BackupException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -