protected void init() throws InvalidJobException {
super.init();
// configure any addition recurrences
GenericValue job = this.getJob();
RecurrenceInfo recurrence = JobManager.getRecurrenceInfo(job);
String instanceId = UtilProperties.getPropertyValue("general.properties", "unique.instanceId", "ofbiz0");
if (!instanceId.equals(job.getString("runByInstanceId"))) {
throw new InvalidJobException("Job has been accpeted by a different instance!");
}
try {
if (recurrence != null) {
recurrence.incrementCurrentCount();
long next = recurrence.next();
createRecurrence(job, next);
}
} catch (GenericEntityException e) {
throw new RuntimeException(e.getMessage());
}