|
|
|
@@ -381,7 +381,8 @@ public abstract class Broadcast |
|
|
|
} |
|
|
|
finally |
|
|
|
{ |
|
|
|
updateServiceActivityCount(-batch.size()); |
|
|
|
updateServiceActivityCount(-batch.size()); |
|
|
|
if (serviceActivityCount == 0) postback.wakeOneUp(); |
|
|
|
} |
|
|
|
if (sleepBetweenJobs > 0) |
|
|
|
{ |
|
|
|
@@ -1242,6 +1243,7 @@ public abstract class Broadcast |
|
|
|
synchronized (readyQueue) |
|
|
|
{ |
|
|
|
serviceActivityCount += increment; |
|
|
|
myLogger.debug("serviceActivityCount = " + serviceActivityCount ); |
|
|
|
if (increment < 0 && serviceActivityCount <= 0) |
|
|
|
{ |
|
|
|
if (state == BroadcastState.RUNNING |
|
|
|
@@ -1249,9 +1251,6 @@ public abstract class Broadcast |
|
|
|
|| state == BroadcastState.CANCELING |
|
|
|
) |
|
|
|
{ |
|
|
|
// TODO: investigate possibility that 0 remainingJobCount may |
|
|
|
// not be final. It may still change because a finishing job |
|
|
|
// may cause a job to be scheduled. |
|
|
|
if (getRemainingJobCount() == 0) { |
|
|
|
setState(BroadcastState.COMPLETED); |
|
|
|
} |
|
|
|
@@ -1404,6 +1403,13 @@ public abstract class Broadcast |
|
|
|
return broadcastType; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* To be invoked only when postQueue is empty. |
|
|
|
* Side effect: sets broadcast state from PAUSING to PAUSE |
|
|
|
* when there are no active jobs being processed. |
|
|
|
* Similarly from CANCELING to CANCELED, from ABORTING to ABORTED, from COMPLETED to ALLDONE |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public PostbackThreadActionOnEmpty getPostbackThreadActionOnEmpty() { |
|
|
|
myLogger.debug("getPostbackThreadActionOnEmpty(): broadcast state " + state); |
|
|
|
if (state.isFinal) return PostbackThreadActionOnEmpty.STOP; |
|
|
|
|