| @@ -1228,19 +1228,6 @@ public abstract class Broadcast | |||
| */ | |||
| public void postJobStatus(Job job) | |||
| { | |||
| postJobStatus(job, -1); | |||
| } | |||
| /** | |||
| * Constructs job report for given job, and posts report in postback queue. | |||
| * If job status is SUCCESS, then the class attribute successCount in incremented by 1.. | |||
| * Optionally reschedules job. | |||
| * If no rescheduling, then decrement number of remainingJobs, | |||
| * @param job | |||
| * @param rescheduleTimeMS - reschedule time in milliseconds (-1 means do not reschedule). | |||
| */ | |||
| protected void postJobStatus(Job job, long rescheduleTimeMS) | |||
| { | |||
| if (job.jobStatus == JobStatus.SUCCESS) successCount.incrementAndGet(); | |||
| if (postback != null) | |||
| { | |||
| @@ -1250,28 +1237,6 @@ public abstract class Broadcast | |||
| postback.queueReport(report.toString()); | |||
| } | |||
| // No more rescheduling on cancel, abort, expired, or pause | |||
| if (state == BroadcastState.CANCELING | |||
| || state == BroadcastState.CANCELED | |||
| || state == BroadcastState.EXPIRED | |||
| || state == BroadcastState.PAUSED | |||
| || state == BroadcastState.PAUSING | |||
| || state == BroadcastState.ABORTED | |||
| || state == BroadcastState.ABORTING | |||
| || state == BroadcastState.ALLDONE | |||
| ) | |||
| { | |||
| return; | |||
| } | |||
| if (rescheduleTimeMS == 0) | |||
| { | |||
| addJob(job); | |||
| //logJobCount("Added a job to queue"); | |||
| } | |||
| else if (rescheduleTimeMS > 0) | |||
| { | |||
| rescheduleJob(job, rescheduleTimeMS); | |||
| } | |||
| } | |||
| /** | |||
| @@ -1335,6 +1300,25 @@ public abstract class Broadcast | |||
| public ScheduledFuture<?> rescheduleJob(final Job job, long rescheduleTimeMS) | |||
| { | |||
| // No more rescheduling on cancel, abort, expired, or alldone | |||
| if (state == BroadcastState.CANCELING | |||
| || state == BroadcastState.CANCELED | |||
| || state == BroadcastState.EXPIRED | |||
| || state == BroadcastState.ABORTED | |||
| || state == BroadcastState.ABORTING | |||
| || state == BroadcastState.ALLDONE | |||
| ) | |||
| { | |||
| return null; | |||
| } | |||
| job.errorText = ""; | |||
| if (rescheduleTimeMS == 0) | |||
| { | |||
| addJob(job); | |||
| return null; | |||
| } | |||
| synchronized(readyQueue) { | |||
| scheduledJobs++; | |||
| } | |||