📄 netclienttest.java
字号:
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实例
* 2、获取Gather,Log,Backup,NetClient
* 3、调用gather采集数据
* 4、调用backup备份数据
* 5、调用netClient发送数据
*/
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();
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -