1 24 package org.riotfamily.riot.job.context; 25 26 import org.riotfamily.riot.job.JobContext; 27 import org.riotfamily.riot.job.JobInterruptedException; 28 import org.riotfamily.riot.job.support.JobTask; 29 30 public class TaskJobContext implements JobContext { 31 32 private JobTask task; 33 34 public TaskJobContext(JobTask task) { 35 this.task = task; 36 } 37 38 41 public String getObjectId() { 42 return task.getDetail().getObjectId(); 43 } 44 45 49 public void stepCompleted() throws JobInterruptedException { 50 task.stepCompleted(); 51 } 52 53 56 public void logInfo(String message) { 57 task.logInfo(message); 58 } 59 60 63 public void logError(String message) { 64 task.logError(message); 65 } 66 67 public void updateDescription(String description) { 68 task.updateDescription(description); 69 } 70 71 public void updateStepsTotal(int stepsTotal) { 72 task.updateStepsTotal(stepsTotal); 73 } 74 75 } 76 | Popular Tags |