1. 程式人生 > >對方法進行線程處理

對方法進行線程處理

ble 爬取 lock lan ring block rri div super

1對方法實現runable

class threadEnterpriseGrabOther implements Runnable{
        String companyId = "";
        String company = "";
        String sys_language="";
        public threadEnterpriseGrabOther(String companyId, String company,
                String sys_language) {
            super();
            
this.companyId = companyId; this.company = company; this.sys_language = sys_language; } @Override public void run() { try { enterpriseGrabOther(companyId,company,sys_language); } catch (Exception e) {
// TODO Auto-generated catch block e.printStackTrace(); } } }

2調用

//線程爬取企查查裁判文書,法院公告,開庭公告信息數據並保存
            Thread th=new Thread(new threadEnterpriseGrabOther(companyId, companyName, sys_language));
            th.start();

對方法進行線程處理