|
|
@ -54,6 +54,9 @@ import java.util.Date; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
import java.util.concurrent.Executors; |
|
|
|
|
|
|
|
import java.util.concurrent.ScheduledExecutorService; |
|
|
|
|
|
|
|
import java.util.concurrent.TimeUnit; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @author neil |
|
|
|
* @author neil |
|
|
@ -338,17 +341,10 @@ public class InformationCollector implements XMLReadable, XMLWriter { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Thread sendThread = new Thread(new Runnable() { |
|
|
|
ScheduledExecutorService service = Executors.newSingleThreadScheduledExecutor(); |
|
|
|
|
|
|
|
service.schedule(new Runnable() { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void run() { |
|
|
|
public void run() { |
|
|
|
try { |
|
|
|
|
|
|
|
//读取XML的5分钟后开始发请求连接服务器.
|
|
|
|
|
|
|
|
Thread.sleep(SEND_DELAY); |
|
|
|
|
|
|
|
} catch (InterruptedException e) { |
|
|
|
|
|
|
|
FineLoggerFactory.getLogger().error(e.getMessage(), e); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
long currentTime = new Date().getTime(); |
|
|
|
long currentTime = new Date().getTime(); |
|
|
|
long lastTime = getLastTimeMillis(); |
|
|
|
long lastTime = getLastTimeMillis(); |
|
|
|
if (currentTime - lastTime > DELTA) { |
|
|
|
if (currentTime - lastTime > DELTA) { |
|
|
@ -359,8 +355,8 @@ public class InformationCollector implements XMLReadable, XMLWriter { |
|
|
|
TemplateInfoCollector.getInstance().sendTemplateInfo(); |
|
|
|
TemplateInfoCollector.getInstance().sendTemplateInfo(); |
|
|
|
ErrorInfoUploader.getInstance().sendErrorInfo(); |
|
|
|
ErrorInfoUploader.getInstance().sendErrorInfo(); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}, SEND_DELAY, TimeUnit.SECONDS); |
|
|
|
sendThread.start(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|