1 25 package org.ofbiz.service.job; 26 27 34 public abstract class AbstractJob implements Job { 35 36 public static final String module = AbstractJob.class.getName(); 37 38 protected long runtime = -1; 39 protected long sequence = 0; 40 private String jobId; 41 private String jobName; 42 private boolean queued = false; 43 44 protected AbstractJob(String jobId, String jobName) { 45 this.jobId = jobId; 46 this.jobName = jobName; 47 } 48 49 52 public long getRuntime() { 53 return runtime; 54 } 55 56 59 public boolean isValid() { 60 if (runtime > 0) 61 return true; 62 return false; 63 } 64 65 68 public String getJobId() { 69 return this.jobId; 70 } 71 72 75 public String getJobName() { 76 return this.jobName; 77 } 78 79 82 public void queue() throws InvalidJobException { 83 this.queued = true; 84 } 85 86 89 public abstract void exec() throws InvalidJobException; 90 } 91 | Popular Tags |