创建一个线程的对象
public class HRRecruitNewThreadSapQuery {
创建一个线程的框架的对象
private static ExecutorService executors=Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors()*1);
public static void task(String orgId,String companyType){
if(null==orgId||null==companyType)return;
调用这个线程的对象
executors.execute(new HRRecruitNewSapQueryPool(orgId, companyType));
}
}
class HRRecruitNewSapQueryPool implements Runnable{
private String orgId;
private String companyType;
private RecruitAjaxService recruitService;
private final Logger LOG=LoggerFactory.getLogger(HRRecruitNewSapQueryPool.class);
private HRRecruitThreadPoolService hRRecruitThreadPoolService;
public HRRecruitNewSapQueryPool(String orgId, String companyType) {
super();
this.orgId = orgId;
this.companyType = companyType;
this.recruitService=ContextLoaderListener.getCurrentWebApplicationContext().getBean(RecruitAjaxService.class);
}
@Override
public void run() {
}
}