int retries = pDownload.getRetryCounter();
if (retries <= RETRY_LIMIT) {
pDownload.setState(DownloadService.RETRYING);
// mLog.info("Retry timer activated, retries=" + retries);
Timer t = new Timer((int) CALMDOWN_PERIOD, new ActionListener() {
public void actionPerformed(ActionEvent e) {
try {
pDownload
.setRetryCounter(pDownload.getRetryCounter() + 1);
// mLog.info("Retrying"
// + pDownload.getAttachment());
// DownloadLogic.getInstance().download(pDownload);
} catch (Exception e1) {
// mLog.info("Retry failed"
// + pDownload.getAttachment());
}
}
});
t.setInitialDelay((int) CALMDOWN_PERIOD);
t.setRepeats(false);
t.start();
} else {
// mLog.info("No more retries allowed for"
// + pDownload.getAttachment());
// pDownload.setState(DownloadLogic.ERROR);