2 次程式碼提交

作者 SHA1 備註 提交日期
  ymlam bb665f8e67 Allow communication engines to deny resume by clock 1 年之前
  ymlam 45dafcbd73 Reset jobStatus to null on rescheduling a job. 1 年之前
共有 1 個檔案被更改,包括 7 行新增11 行删除
分割檢視
  1. +7
    -11
      src/main/java/altk/comm/engine/Broadcast.java

+ 7
- 11
src/main/java/altk/comm/engine/Broadcast.java 查看文件

@@ -1020,12 +1020,9 @@ public abstract class Broadcast
protected String resume(String reason) {
if (reason == ACTION_BY_CLOCK) {
boolean inAcceptqble = false;
if (this.reason == null) return null;
for (String acceptable : getPauseModesResumableByClock()) {
if (this.reason.equalsIgnoreCase(acceptable)) inAcceptqble = true;
}
if (!inAcceptqble) return null;
boolean reason_is_ok = this.reason == ACTION_BY_CLOCK || !child_denies_resume_by_clock();
if (!reason_is_ok) return null;
}
if (!withinOperatingHours()) return "Cannot resume outside operating hours";
@@ -1039,17 +1036,15 @@ public abstract class Broadcast
case SUCCESS:
resumeFlag.notifyAll();
return "Broadcast resumed";
case NO_CHANGE:
default:
return null;
}
}
}
/** derived class may override by adding more modes */
protected List<String> getPauseModesResumableByClock() {
Vector<String> modes = new Vector<String>();
modes.add(ACTION_BY_CLOCK);
return modes;
protected boolean child_denies_resume_by_clock() {
return false;
}
/**
@@ -1303,6 +1298,7 @@ public abstract class Broadcast
return null;
}
job.jobStatus = null;
job.errorText = "";
if (rescheduleTimeMS == 0)
{
@@ -1490,7 +1486,7 @@ public abstract class Broadcast
public boolean setJobStatus(Job job, JobStatus status) {
if (job.statusIsFinal()) {
myLogger.warn("Forbidden ttempt to overwrite a final job status '" + job.jobStatus + "' with '" + status + "'", new Exception("info"));
myLogger.warn("Forbidden to overwrite a final job status '" + job.jobStatus + "' with '" + status + "'", new Exception("info"));
return false;
}
job.setStatus(status);


Loading…
取消
儲存