package com.asiainfo.app;
import java.lang.reflect.Field;
import java.util.UUID;
import com.asiainfo.model.Param;
import com.asiainfo.model.User;
import com.asiainfo.service.AppService;
public class TestRunPerl {
public static void main(String[] args) throws Exception {
Param obj = new Param("perl", "insert_test.pl", "192.168.1.254", "3306", "jbwtest", "root", "root");
System.out.println(obj);
boolean flag = true;
for (Field f : obj.getClass().getDeclaredFields()) {
f.setAccessible(true);
if (f.get(obj) == null) { // 判断字段是否为空,并且对象属性中的基本都会转为对象类型来判断
flag = false;
new RuntimeException("Perl run param is null");
}
}
if(flag) {
User user = null;
for (int i = 395; i < 400; i++) {
user = new User();
user.setId(i);
user.setName(UUID.randomUUID().toString());
System.out.println("线程" + i + "开始执行!" + user);
new Thread(new AppService(obj, user)).start();
}
System.out.println("多线程结束");
}
}
}
最近下载更多
pj_fhzy LV3
2024年10月13日
wangjinglin LV1
2019年12月9日
liuyishi LV6
2019年4月6日
blazing LV2
2019年2月19日
a1351328329 LV1
2018年6月25日
jic499 LV27
2018年4月13日
人工智能4708 LV11
2018年3月13日
sdxrh2005 LV1
2018年1月20日
shenkang10086 LV6
2017年5月11日
wyj11www LV1
2016年12月28日

最近浏览